Compare commits

...

3865 Commits
10.2 ... 10.4

Author SHA1 Message Date
Emil Velikov
cb154bb221 docs: Add sha256 sums for the 10.4.7 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-21 00:50:13 +00:00
Emil Velikov
d26f3c1f86 Add release notes for the 10.4.7 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-21 00:26:27 +00:00
Emil Velikov
b7b218f3f6 Update version to 10.4.7
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-21 00:19:39 +00:00
Marek Olšák
832c94a55c radeonsi: increase coords array size for radeon_llvm_emit_prepare_cube_coords
radeon_llvm_emit_prepare_cube_coords uses coords[4] in some cases (TXB2 etc.)

Discovered by Coverity. Reported by Ilia Mirkin.

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit a984abdad3)
2015-03-18 21:49:33 +00:00
Mario Kleiner
70832be2f1 glx: Handle out-of-sequence swap completion events correctly. (v2)
The code for emitting INTEL_swap_events swap completion
events needs to translate from 32-Bit sbc on the wire to
64-Bit sbc for the events and handle wraparound accordingly.

It assumed that events would be sent by the server in the
order their corresponding swap requests were emitted from
the client, iow. sbc count should be always increasing. This
was correct for DRI2.

This is not always the case under the DRI3/Present backend,
where the Present extension can execute presents and send out
completion events in a different order than the submission
order of the present requests, due to client code specifying
targetMSC target vblank counts which are not strictly
monotonically increasing. This confused the wraparound
handling. This patch fixes the problem by handling 32-Bit
wraparound in both directions. As long as successive swap
completion events real 64-Bit sbc's don't differ by more
than 2^30, this should be able to do the right thing.

How this is supposed to work:

awire->sbc contains the low 32-Bits of the true 64-Bit sbc
of the current swap event, transmitted over the wire.

glxDraw->lastEventSbc contains the low 32-Bits of the 64-Bit
sbc of the most recently processed swap event.

glxDraw->eventSbcWrap is a 64-Bit offset which tracks the upper
32-Bits of the current sbc. The final 64-Bit output sbc
aevent->sbc is computed from the sum of awire->sbc and
glxDraw->eventSbcWrap.

Under DRI3/Present, swap completion events can be received
slightly out of order due to non-monotic targetMsc specified
by client code, e.g., present request submission:

Submission sbc:   1   2   3
targetMsc:        10  11  9

Reception of completion events:
Completion sbc:   3   1   2

The completion sequence 3, 1, 2 would confuse the old wraparound
handling made for DRI2 as 1 < 3 --> Assumes a 32-Bit wraparound
has happened when it hasn't.

The client can queue multiple present requests, in the case of
Mesa up to n requests for n-buffered rendering, e.g., n =  2-4 in
the current Mesa GLX DRI3/Present implementation. In the case of
direct Pixmap presents via xcb_present_pixmap() the number n is
limited by the amount of memory available.

We reasonably assume that the number of outstanding requests n is
much less than 2 billion due to memory contraints and common sense.
Therefore while the order of received sbc's can be a bit scrambled,
successive 64-Bit sbc's won't deviate by much, a given sbc may be
a few counts lower or higher than the previous received sbc.

Therefore any large difference between the incoming awire->sbc and
the last recorded glxDraw->lastEventSbc will be due to 32-Bit
wraparound and we need to adapt glxDraw->eventSbcWrap accordingly
to adjust the upper 32-Bits of the sbc.

Two cases, correponding to the two if-statements in the patch:

a) Previous sbc event was below the last 2^32 boundary, in the previous
glxDraw->eventSbcWrap epoch, the new sbc event is in the next 2^32
epoch, therefore the low 32-Bit awire->sbc wrapped around to zero,
or close to zero --> awire->sbc is apparently much lower than the
glxDraw->lastEventSbc recorded for the previous epoch

--> We need to increment glxDraw->eventSbcWrap by 2^32 to adjust
the current epoch to be one higher than the previous one.

--> Case a) also handles the old DRI2 behaviour.

b) Previous sbc event was above closest 2^32 boundary, but now a
late event from the previous 2^32 epoch arrives, with a true sbc
that belongs to the previous 2^32 segment, so the awire->sbc of
this late event has a high count close to 2^32, whereas
glxDraw->lastEventSbc is closer to zero --> awire->sbc is much
greater than glXDraw->lastEventSbc.

--> We need to decrement glxDraw->eventSbcWrap by 2^32 to adjust
the current epoch back to the previous lower epoch of this late
completion event.

We assume such a wraparound to a higher (a) epoch or lower (b)
epoch has happened if awire->sbc and glxDraw->lastEventSbc differ
by more than 2^30 counts, as such a difference can only happen
on wraparound, or if somehow 2^30 present requests would be pending
for a given drawable inside the server, which is rather unlikely.

v2: Explain the reason for this patch and the new wraparound handling
    much more extensive in commit message, no code change wrt. initial
    version.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit cc5ddd584d)
2015-03-18 21:49:25 +00:00
Emil Velikov
ad259df2e0 auxiliary/os: fix the android build - s/drm_munmap/os_munmap/
Squash this silly typo introduced with commit c63eb5dd5ec(auxiliary/os: get
the mmap/munmap wrappers working with android)

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 55f0c0a29f)
2015-03-18 21:49:18 +00:00
Emil Velikov
df2db2a55f loader: include <sys/stat.h> for non-sysfs builds
Required by fstat(), otherwise we'll error out due to implicit function
declaration.

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89530
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reported-by: Vadim Rutkovsky <vrutkovs@redhat.com>
Tested-by: Vadim Rutkovsky <vrutkovs@redhat.com>
(cherry picked from commit 771cd266b9)
2015-03-18 21:49:05 +00:00
Rob Clark
0506f69f08 freedreno: update generated headers
Fix a3xx texture layer-size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e92bc6b38e)
[Emil Velikov: sqush trivial conflicts, drop the a4xx.xml.h changes]

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	src/gallium/drivers/freedreno/a2xx/a2xx.xml.h
	src/gallium/drivers/freedreno/a3xx/a3xx.xml.h
	src/gallium/drivers/freedreno/a4xx/a4xx.xml.h
	src/gallium/drivers/freedreno/adreno_common.xml.h
	src/gallium/drivers/freedreno/adreno_pm4.xml.h
2015-03-18 21:48:40 +00:00
Ilia Mirkin
a563045009 freedreno: fix slice pitch calculations
For example if width were 65, the first slice would get 96 while the
second would get 32. However the hardware appears to expect the second
pitch to be 64, based on halving the 96 (and aligning up to 32).

This fixes texelFetch piglit tests on a3xx below a certain size. Going
higher they break again, but most likely due to unrelated reasons.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 620e29b748)
2015-03-18 21:32:21 +00:00
Samuel Iglesias Gonsalvez
b2e243f70c glsl: optimize (0 cmp x + y) into (-x cmp y).
The optimization done by commit 34ec1a24d did not take it into account.

Fixes:

dEQP-GLES3.functional.shaders.random.all_features.fragment.20

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b43bbfa90a)
2015-03-18 21:15:35 +00:00
Iago Toral Quiroga
8c25b0f2d1 i965: Fix out-of-bounds accesses into pull_constant_loc array
The piglit test glsl-fs-uniform-array-loop-unroll.shader_test was designed
to do an out of bounds access into an uniform array to make sure that we
handle that situation gracefully inside the driver, however, as Ken describes
in bug 79202, Valgrind reports that this is leading to an out-of-bounds access
in fs_visitor::demote_pull_constants().

Before accessing the pull_constant_loc array we should make sure that
the uniform we are trying to access is valid.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79202
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 6ac1bc90c4)
Nominated-by: Matt Turner <mattst88@gmail.com>
2015-03-11 17:46:03 +00:00
Rob Clark
a91ee1e187 freedreno/ir3: fix silly typo for binning pass shaders
Was resulting in gl_PointSize write being optimized out, causing
particle system type shaders to hang if hw binning enabled.

Fixes neverball, OGLES2ParticleSystem, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 60096ed906)
2015-03-11 17:44:38 +00:00
Marek Olšák
977626f10a r300g: fix sRGB->sRGB blits
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c939231e72)
2015-03-11 17:42:52 +00:00
Marek Olšák
b451a2ffbf r300g: fix a crash when resolving into an sRGB texture
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9953586af2)
2015-03-11 17:42:38 +00:00
Marek Olšák
a561eee82c r300g: fix RGTC1 and LATC1 SNORM formats
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 74a757f92f)
2015-03-11 17:42:07 +00:00
Stefan Dösinger
80ef80d087 r300g: Fix the ATI1N swizzle (RGTC1 and LATC1)
This fixes the GL_COMPRESSED_RED_RGTC1 part of piglit's rgtc-teximage-01
test as well as the precision part of Wine's 3dc format test (fd.o bug
89156).

The Z component seems to contain a lower precision version of the
result, probably a temporary value from the decompression computation.
The Y and W component contain different data that depends on the input
values as well, but I could not make sense of them (Not that I tried
very hard).

GL_COMPRESSED_SIGNED_RED_RGTC1 still seems to have precision problems in
piglit, and both formats are affected by a compiler bug if they're
sampled by the shader with a swizzle other than .xyzw. Wine uses .xxxx,
which returns random garbage.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89156
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f710b99071)
2015-03-11 17:41:43 +00:00
Ilia Mirkin
fa8bfb3ed1 freedreno/ir3: get the # of miplevels from getinfo
This fixes ARB_texture_query_levels to actually return the desired
value.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cb3eb43ad6)
2015-03-11 17:41:32 +00:00
Ilia Mirkin
025cf8cb3f freedreno/ir3: fix array count returned by TXQ
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8ac957a51c)
2015-03-11 17:41:20 +00:00
Ilia Mirkin
4db4f70546 freedreno: move fb state copy after checking for size change
Fixes: 1f3ca56b ("freedreno: use util_copy_framebuffer_state()")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f3dfe6513c)
2015-03-11 17:40:59 +00:00
Andrey Sudnik
d4a95ffcda i965/vec4: Don't lose the saturate modifier in copy propagation.
Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89224
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0dfec59a27)
2015-03-07 16:41:16 +00:00
Emil Velikov
97b0219ed5 mesa: rename format_info.c to format_info.h
The file is auto-generated, and #included by formats.c. Let's rename it
to reflect the latter. This will also help up fix the dependency
tracking by adding it to the _SOURCES variable, without the side effect
of it being compiled (twice).

v2: Update .gitignore to reflect the rename.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 3f6c28f2a9)

Conflicts:
	src/mesa/Makefile.am
	src/mesa/main/.gitignore
2015-03-07 16:40:27 +00:00
Matt Turner
93273f16af r300g: Check return value of snprintf().
Would have at least prevented the crash the previous patch fixed.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit ade0b580e7)
2015-03-07 16:37:22 +00:00
Matt Turner
8e8d215cae r300g: Use PATH_MAX instead of limiting ourselves to 100 chars.
When built with Gentoo's package manager, the Mesa source directory
exists seven directories deep. The path to the .test file is too long
and is silently truncated, leading to a crash. Just use PATH_MAX.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit f5e2aa1324)
2015-03-07 16:37:15 +00:00
Daniel Stone
1a929baa0b egl: Take alpha bits into account when selecting GBM formats
This fixes piglit when using PIGLIT_PLATFORM=gbm

Tom Stellard:
  - Fix ARGB2101010 format

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

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit 65c8965d03)
2015-03-07 16:37:04 +00:00
Marc-Andre Lureau
3a625d0b3f gallium/auxiliary/indices: fix start param
Since commit 28f3f8d, indices generator take a start parameter. However, some
index values have been left to start at 0.

This fixes the glean/fbo test with the virgl driver, and copytexsubimage
with freedreno.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 073a5d2e84)
2015-03-07 16:36:47 +00:00
Emil Velikov
944ef59b2f cherry-ignore: add not applicable/rejected commits
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-07 16:36:05 +00:00
Emil Velikov
fc9dd495b2 docs: Add sha256 sums for the 10.4.6 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-06 19:44:55 +00:00
Emil Velikov
542a754524 Add release notes for the 10.4.6 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-06 19:23:34 +00:00
Emil Velikov
e559d126f9 Update version to 10.4.6
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-06 19:16:58 +00:00
Emil Velikov
fc5881ad73 Revert "gallivm: Update for RTDyldMemoryManager becoming an unique_ptr."
This reverts commit 66a3f104a5.

The commit is likely insufficient for normal work with LLVM 3.6.
The full discussion and reason can be found at
http://lists.freedesktop.org/archives/mesa-dev/2015-March/078795.html
2015-03-06 19:16:28 +00:00
Emil Velikov
9508ca24f1 mesa: cherry-pick the second half of commit 2aa71e9485
Missed out by commit 39ae85732d2(mesa: Fix error validating args for
TexSubImage3D)

Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-06 19:16:19 +00:00
Matt Turner
644bbf88ec mesa: Correct backwards NULL check.
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 491d42135a)
2015-03-06 18:45:13 +00:00
Ian Romanick
a369361f9e mesa: Always generate GL_INVALID_OPERATION in _mesa_GetProgramBinary
There are no binary formats supported, so what are you doing?  At least
this gives the application developer some feedback about what's going
on.  The spec gives no guidance about what to do in this scenario.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87516
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Leight Bade <leith@mapbox.com>
(cherry picked from commit f591712efe)
2015-03-06 18:44:52 +00:00
Ian Romanick
f1663a5236 mesa: Ensure that length is set to zero in _mesa_GetProgramBinary
v2: Fix assignment of length.  Noticed by Julien Cristau.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87516
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Leight Bade <leith@mapbox.com>
(cherry picked from commit 4fd8b30123)
2015-03-06 18:44:37 +00:00
Ian Romanick
e1b5bc9330 mesa: Add missing error checks in _mesa_ProgramBinary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87516
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Leight Bade <leith@mapbox.com>
(cherry picked from commit 201b9c1818)

Conflicts:
	src/mesa/main/shaderapi.c
2015-03-06 18:42:51 +00:00
Emil Velikov
93edf3e7dc Revert "mesa: Correct backwards NULL check."
This reverts commit a598a9bdfe.

The patch was applied without the required dependencies.
2015-03-06 18:40:09 +00:00
José Fonseca
66a3f104a5 gallivm: Update for RTDyldMemoryManager becoming an unique_ptr.
Trivial.

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

(cherry picked from commit ef7e0b39a2)
Nominated-by: Sedat Dilek <sedat.dilek@gmail.com>
2015-03-04 01:51:36 +00:00
Abdiel Janulgue
afa7a851da st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported
There is a bug in the current lowering pass implementation where we lower saturate
to clamp only for vertex shaders on drivers supporting SM 3.0. The correct behavior
is to actually lower to clamp only when we don't support saturate which happens
on drivers that don't support SM 3.0

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit 49e0431211)
Nominated-by: Matt Turner <mattst88@gmail.com>
2015-03-04 01:51:36 +00:00
Abdiel Janulgue
d880aa573c glsl: Don't optimize min/max into saturate when EmitNoSat is set
v3: Fix multi-line comment format (Ian)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit 4ea8c8d56c)
2015-03-04 01:51:36 +00:00
Matt Turner
741aeba26f i965/fs: Don't use backend_visitor::instructions after creating the CFG.
This is a fix for a regression introduced in commit a9f8296d ("i965/fs:
Preserve the CFG in a few more places.").

The errata this code works around is described in a comment before the function:

   "[DevBW, DevCL] Errata: A destination register from a send can not be
    used as a destination register until after it has been sourced by an
    instruction with a different destination register.

The framebuffer write's sources must be in message registers, which SEND
instructions cannot have as a destination. There's no way for this
errata to affect anything at the end of the program. Just remove the
code.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84613
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e214000f25)
2015-03-04 01:51:36 +00:00
Matt Turner
a598a9bdfe mesa: Correct backwards NULL check.
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 491d42135a)
[Emil Velikov: the patch hunk has a different offset.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	src/mesa/main/shaderapi.c
2015-03-04 01:51:36 +00:00
Chris Forbes
0c46d850d9 i965/gs: Check newly-generated GS-out VUE map against correct stage
Previously, we compared our new GS-out VUE map to the existing *VS*-out
VUE map, which is bogus.

This would mostly manifest as redundant dirty flagging where the GS is
in use but the VS and GS output layouts differ; but there is a scary
case where we would fail to flag a GS-out layout change if it happened
to match the VS-out layout.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.5, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88885
(cherry picked from commit b51ff50a76)
2015-03-04 01:51:36 +00:00
Jonathan Gray
da46b1b160 auxilary/os: correct sysctl use in os_get_total_physical_memory()
The length argument passed to sysctl was the size of the pointer
not the type.  The result of this is sysctl calls would fail on
32 bit BSD/Mac OS X.

Additionally the wrong pointer was passed as an argument to store
the result of the sysctl call.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 7983a3d2e0)
2015-03-04 01:51:36 +00:00
Matt Turner
7e723c98ce glsl: Rewrite and fix min/max to saturate optimization.
There were some bugs, and the code was really difficult to follow. We
would optimize

   min(max(x, b), 1.0) into max(sat(x), b)

but not pay attention to the order of min/max and also do

   max(min(x, b), 1.0) into max(sat(x), b)

Corrects four shaders from Champions of Regnum that do

   min(max(x, 1), 10)

and corrects rendering of Mass Effect under VMware Workstation.

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89180
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit cb25087c7b)
2015-03-04 01:51:36 +00:00
Andreas Boll
0a51529a28 glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA
If the renderer supports the core profile the query returned incorrectly
0x8 as value, because it was using (1U << __DRI_API_OPENGL_CORE) for the
returned value.

The same happened with the compatibility profile. It returned 0x1
(1U << __DRI_API_OPENGL) instead of 0x2.

Internal DRI defines:
   dri_interface.h: #define __DRI_API_OPENGL       0
   dri_interface.h: #define __DRI_API_OPENGL_CORE  3

Those two bits are supposed for internal usage only and should be
translated to GLX_CONTEXT_CORE_PROFILE_BIT_ARB (0x1) for a preferred
core context profile and GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB (0x2)
for a preferred compatibility context profile.

This patch implements the above translation in the glx module.

v2: Fix the incorrect behavior in the glx module

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6d164f65c5)
2015-03-04 01:51:36 +00:00
Leo Liu
2a9e9b5aeb st/omx/dec/h264: fix picture out-of-order with poc type 0 v2
poc counter should be reset with IDR frame,
otherwise there would be a re-order issue with
frames before and after IDR

v2: add commit message

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9c7b343bc0)
2015-03-04 01:51:36 +00:00
Emil Velikov
120792fa04 install-lib-links: remove the .install-lib-links file
With earlier commit (install-lib-links: don't depend on .libs directory)
we moved the location of the file from .libs/ to the current dir.
Although we did not attribute that in the former case autotools was
doing us a favour and removing the file. Explicitly remove the file at
clean-local time, otherwise we'll end up with dangling files.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit fece147be5)
2015-03-04 01:51:35 +00:00
Eduardo Lima Mitev
39ae85732d mesa: Fix error validating args for TexSubImage3D
The zoffset and depth values were not being considered when calling
error_check_subtexture_dimensions().

Fixes 2 dEQP tests:
* dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_offset
* dEQP-GLES3.functional.negative_api.texture.texsubimage3d_invalid_offset

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedestkop.org>
(cherry picked from commit 2aa71e9485)
[Emil Velikov: Resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	src/mesa/main/teximage.c
2015-03-04 01:51:35 +00:00
Marek Olšák
61c1aabb9f radeonsi: fix point sprites
Broken by a27b74819a.

This fix is critical and should be ported to stable ASAP.

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7820a11e3d)

Squashed with commit

radeonsi: fix a warning caused by previous commit

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 050bf75c8b)

[Emil Velikov: The file was renamed si_state_{shaders,draw}.c]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	src/gallium/drivers/radeonsi/si_state_shader.c
2015-03-04 01:51:16 +00:00
Marek Olšák
6da4e66d4e vbo: fix an unitialized-variable warning
It looks like a bug to me.

Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 0feb0b7373)
2015-03-04 00:39:01 +00:00
Brian Paul
7e57411b9a st/mesa: fix sampler view reference counting bug in glDraw/CopyPixels
Use pipe_sampler_view_reference() instead of ordinary assignment.
Also add a new sanity check assertion.

Fixes piglit gl-1.0-drawpixels-color-index test crash.  But note
that the test still fails.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 62a8883f32)
2015-03-04 00:38:31 +00:00
Brian Paul
1e6735ead1 swrast: fix multiple color buffer writing
If a fragment program wrote to more than one color buffer, the
first fragment color got replicated to all dest buffers.  This
fixes 5 piglit FBO tests, including fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45348
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 89c96afe3c)
2015-03-04 00:38:23 +00:00
Lucas Stach
deea686c71 install-lib-links: don't depend on .libs directory
This snippet can be included in Makefiles that may, depending on the
project configuration, not actually build any installable libraries.

In that case we don't have anything to depend on and this part of
the makefile may be executed before the .libs directory is created,
so do not depend on it being there.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
(cherry picked from commit 5c1aac17ad)
2015-03-04 00:38:11 +00:00
Emil Velikov
41bdeda102 docs: Add sha256 sums for the 10.4.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-21 12:31:51 +00:00
Emil Velikov
a5c608e951 Add release notes for the 10.4.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-21 12:22:08 +00:00
Emil Velikov
e0276bc297 Update version to 10.4.5
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-21 12:17:35 +00:00
Michel Dänzer
dc16fb1969 Revert "radeon/llvm: enable unsafe math for graphics shaders"
This reverts commit 0e9cdedd2e.

It caused the grass to disappear in The Talos Principle.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89069
Cc: "10.5 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 4db985a5fa)
2015-02-18 12:17:44 +00:00
Kenneth Graunke
aaa823569b glsl: Reduce memory consumption of copy propagation passes.
opt_copy_propagation and opt_copy_propagation_elements create new ACP
and Kill sets each time they enter a new control flow block.  For if
blocks, they also copy the entire existing ACP set contents into the
new set.

When we exit the control flow block, we discard the new sets.  However,
we weren't freeing them - so they lived on until the pass finished.
This can waste a lot of memory (57MB on one pessimal shader).

This patch makes the pass allocate ACP entries using this->acp as the
memory context, and Kill entries out of this->kill.  It also steals
kill entries when moving them from the inner kill list to the parent.

It then frees the lists, including their contents.

v2: Move ralloc_free(this->acp) just before this->acp = orig_acp
    (suggested by Eric Anholt).

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.5 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 76960a55e6)
2015-02-18 12:17:44 +00:00
Laura Ekstrand
f57b41758d main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.
Previously array textures were not working with GetCompressedTextureImage,
leading to failures in the test
arb_direct_state_access/getcompressedtextureimage.c.

Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Reviewed-by: Brian Paul <brianp@vmware.com>

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 92163482bd)
2015-02-18 12:17:44 +00:00
Marek Olšák
67ac6a3951 radeonsi: fix a crash if a stencil ref state is set before a DSA state
+ minor indentation fixes

Discovered by Axel Davy.

This can't be reproduced with any app, because all state trackers set a DSA
state first.

Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 2ead74888a)
2015-02-18 12:17:44 +00:00
Marek Olšák
5d04b9eeed mesa: fix AtomicBuffer typo in _mesa_DeleteBuffers
Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e8625a29fe)
2015-02-18 12:17:43 +00:00
Marek Olšák
53041aecef radeonsi: small fix in SPI state
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

(cherry picked from commit a27b74819a)
[Emil Velikov: The file was renamed si_state_{shaders,draw}.c]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
        src/gallium/drivers/radeonsi/si_state_shader.c
2015-02-18 12:14:04 +00:00
Ilia Mirkin
f76bcbb4cd nvc0: allow holes in xfb target lists
Tested with a modified xfb-streams test which outputs to streams 0, 2,
and 3.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 854eb06bee)
2015-02-18 12:09:55 +00:00
Ilia Mirkin
89289934fc st/mesa: treat resource-less xfb buffers as if they weren't there
If a transform feedback buffer's size is 0, st_bufferobj_data doesn't
end up creating a buffer for it. There's no point in trying to write to
such a buffer, so just pretend as if it's not really there.

This fixes arb_gpu_shader5-xfb-streams-without-invocations on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 80d373ed5b)
2015-02-18 12:09:54 +00:00
Ilia Mirkin
dbf82d753b nvc0: bail out of 2d blits with non-A8_UNORM alpha formats
This fixes the teximage-colors uploads with GL_ALPHA format and
non-GL_UNSIGNED_BYTE type.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68e4f3f572)
2015-02-18 12:09:54 +00:00
Emil Velikov
b786e6332b get-pick-list.sh: Require explicit "10.4" for nominating stable patches
A nomination unadorned with a specific version is now interpreted as
being aimed at the 10.5 branch, which was recently opened.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-18 12:09:54 +00:00
Carl Worth
c0ce908a90 Revert use of Mesa IR optimizer for ARB_fragment_programs
Commit f82f2fb3dc added use of the Mesa
IR optimizer for both ARB_fragment_program and ARB_vertex_program, but
only justified the vertex-program portions with measured performance
improvements.

Meanwhile, the optimizer was seen to generate hundreds of unused
immediates without discarding them, causing failures.

Discard the use of the optimizer for now to fix the regression. (In
the future, we anticpate things moving from Mesa IR to NIR for better
optimization anyway.)

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

CC: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 55a57834bf)
2015-02-18 12:09:54 +00:00
Kenneth Graunke
c83c5f4b69 i965: Fix integer border color on Haswell.
+82 Piglits - 100% of border color tests now pass on Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 08a06b6b89)
2015-02-18 12:09:54 +00:00
Kenneth Graunke
f2663112f6 i965: Use a gl_color_union for sampler border color.
This should have no effect, but will make it easier to implement other
bug fixes.

v2: Eliminate "unsigned one" local; just use the value where necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit e1e73443c5)
2015-02-18 12:09:54 +00:00
Kenneth Graunke
2ad93851ff i965: Override swizzles for integer luminance formats.
The hardware's integer luminance formats are completely unusable;
currently we fall back to RGBA.  This means we need to override
the texture swizzle to obtain the XXX1 values expected for luminance
formats.

Fixes spec/EXT_texture_integer/texwrap formats bordercolor [swizzled]
on Broadwell - 100% of border color tests now pass on Broadwell.

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: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8cb18760cc)
2015-02-18 12:09:54 +00:00
Michel Dänzer
e35e6773c2 st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB
The latter currently implies CPU read access, so only PIPE_USAGE_STAGING
can be expected to be fast.

Mesa demos src/tests/streaming_rect on Kaveri (radeonsi):

Unpatched:  42 frames in  1.023 seconds = 41.056 FPS
Patched:   615 frames in  1.000 seconds = 615.000 FPS

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88658
Cc: "10.3 10.4" <mesa-stable@lists.freedestkop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit a338dc0186)
2015-02-18 12:09:54 +00:00
Marek Olšák
51bdd19c97 radeonsi: fix instanced arrays with non-zero start instance
Fixes piglit ARB_base_instance/arb_base_instance-drawarrays.

Cc: 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 50908a8918)
2015-02-18 12:09:54 +00:00
Marek Olšák
5c623ff071 r600g,radeonsi: don't append to streamout buffers that haven't been used yet
The FILLED_SIZE counter is uninitialized at the beginning, so we can't use it.
Instead, use offset = 0, which is what we always do when not appending.

This unexpectedly fixes spec/ARB_texture_multisample/sample-position/*.
Yes, the test does use transform feedback.

Cc: 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 658f1d4cfe)
2015-02-18 12:09:53 +00:00
Jeremy Huddleston Sequoia
654f197f19 darwin: build fix
xfont.c:237:14: error: implicit declaration of function 'GetGLXDRIDrawable' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable);
             ^
Fixes regression from 291be28476

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit e68b67b53f)
2015-02-11 00:24:04 -08:00
Jeremy Huddleston Sequoia
162cee83ba darwin: build fix
../../../src/mesa/main/compiler.h:47:10: fatal error: 'util/macros.h' file not found

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 1c67a5687a)
2015-02-10 20:35:33 -08:00
Emil Velikov
54da987bae docs: Add sha256 sums for the 10.4.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-07 00:47:18 +00:00
Emil Velikov
62eb27ac8b Add release notes for the 10.4.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-07 00:17:09 +00:00
Emil Velikov
a824179af5 Update version to 10.4.4
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-07 00:12:04 +00:00
Park, Jeongmin
fecedb6c43 st/osmesa: Fix osbuffer->textures indexing
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88930
Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6fd4a61ad6)
2015-02-04 01:37:33 +00:00
Matt Turner
9d1d1f46c7 gallium/util: Don't use __builtin_clrsb in util_last_bit().
Unclear circumstances lead to undefined symbols on x86.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=536916
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 32e98e8ef0)
2015-02-04 01:37:20 +00:00
José Fonseca
b51d369690 egl: Pass the correct X visual depth to xcb_put_image().
The dri2_x11_add_configs_for_visuals() function happily matches a 32
bits EGLconfig with a 24 bits X visual.  However it was passing 32bits
depth to xcb_put_image(), making X server unhappy:

  https://github.com/apitrace/apitrace/issues/313#issuecomment-70571911

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 11a955aef4)
2015-02-02 00:12:04 +00:00
Niels Ole Salscheider
eab8dc28ed configure: Link against all LLVM targets when building clover
Since 8e7df519bd, we initialise all targets in
clover. This fixes bug 85380.

v2: Mention correct bug in commit message

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4b94c3fc31)
2015-02-02 00:12:04 +00:00
Ville Syrjälä
cc580045a8 i965: Fix max_wm_threads for CHV
Change max_wm_threads to match the spec on CHV. The max number of
threads in 3DSTATE_PS is always programmed to 64 and the hardware
internally scales that depending on the GT SKU. So this doesn't
change the max number of threads actually used, but it does affect
the scratch space calculation.

On CHV the old value was too small, so the amount of scratch space
allocated wasn't sufficient to satisfy the actual max number of
threads used.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
(cherry picked from commit 99754446ab)
2015-02-02 00:12:04 +00:00
Mario Kleiner
0d721fa1d6 glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)
Restores proper immediate tearing swap behaviour for
OpenGL bufferswap under DRI3/Present.

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

v2: Add Frank Binns signed off by for his original earlier
patch from April 2014, which is identical to this one, and
Chris Wilsons reviewed tag from May 2014 for that patch, ergo
also for this one.

v3: Incorporate comment about triple buffering as suggested
by Axel Davy, and reference to relevant spec provided by
Eric Anholt.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 455d3036fa)
2015-02-02 00:12:04 +00:00
Brian Paul
c96ed76b3d mesa: fix display list 8-byte alignment issue
The _mesa_dlist_alloc() function is only guaranteed to return a pointer
with 4-byte alignment.  On 64-bit systems which don't support unaligned
loads (e.g. SPARC or MIPS) this could lead to a bus error in the VBO code.

The solution is to add a new  _mesa_dlist_alloc_aligned() function which
will return a pointer to an 8-byte aligned address on 64-bit systems.
This is accomplished by inserting a 4-byte NOP instruction in the display
list when needed.

The only place this actually matters is the VBO code where we need to
allocate a 'struct vbo_save_vertex_list' which needs to be 8-byte
aligned (just as if it were malloc'd).

The gears demo and others hit this bug.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88662
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 53b01938ed)
2015-01-30 08:51:51 -07:00
Emil Velikov
49a5bce780 docs: Add sha256 sums for the 10.4.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-24 12:54:33 +00:00
Emil Velikov
e92bfa3f95 Add release notes for the 10.4.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-24 12:49:17 +00:00
Emil Velikov
f70e4d4afd Update version to 10.4.3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-24 12:44:46 +00:00
Axel Davy
42806f12a9 st/nine: Allocate vs constbuf buffer for indirect addressing once.
When the shader does indirect addressing on the constants,
we allocate a temporary constant buffer to which we copy
the constants from the app given user constants and
the constants filled in the shader.

This patch makes this buffer be allocated once.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f8a74410f1)
2015-01-23 00:47:26 +00:00
Axel Davy
4c9b64fc44 st/nine: Allocate the correct size for the user constant buffer
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e0f75044c8)
2015-01-23 00:47:26 +00:00
Axel Davy
69c7cf70e7 st/nine: Add variables containing the size of the constant buffers
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b9cbea9dbc)
2015-01-23 00:47:26 +00:00
Axel Davy
4d04fd0871 st/nine: Fix sm3 relative addressing for non-debug build
Relative addressing needs the constant buffer to get all
the correct constants, even those defined by the shader.

The code to copy the shader constants to the constant buffer
was enabled only for debug build. Enable it always.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit a721987077)
2015-01-23 00:47:25 +00:00
Axel Davy
0727ab961c st/nine: Remove unused code for ps
Since constant indirect adressing is not allowed for ps,
we can remove our code to handle that.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4b7a9cfddb)
2015-01-23 00:47:25 +00:00
Axel Davy
7280ddea9d st/nine: Correct rules for relative adressing and constants.
relative adressing for constants is possible only for vs float
constants.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9690bf33d7)
2015-01-23 00:47:25 +00:00
Axel Davy
425bc89720 st/nine: Implement TEXREG2AR, TEXREG2GB and TEXREG2RGB
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bce94ce831)
2015-01-23 00:47:25 +00:00
Axel Davy
0b3f8c72f7 st/nine: Implement TEXDP3TEX
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9e23b64c15)
2015-01-23 00:47:25 +00:00
Axel Davy
63e668eb18 st/nine: Implement TEXDP3
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 09eb1e901f)
2015-01-23 00:47:24 +00:00
Axel Davy
2b4c577730 st/nine: Implement TEXDEPTH
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f19e699368)
2015-01-23 00:47:24 +00:00
Axel Davy
e3a393b4c3 st/nine: Implement TEXM3x3SPEC
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3676ab02fb)
2015-01-23 00:47:24 +00:00
Axel Davy
7ecd0f9528 st/nine: Implement TEXM3x2TEX
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2b9f079ae3)
2015-01-23 00:47:24 +00:00
Axel Davy
336887bca1 st/nine: implement TEXM3x2DEPTH
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fdff111dc8)
2015-01-23 00:47:24 +00:00
Axel Davy
8e08ba6f96 st/nine: Fix TEXM3x3 and implement TEXM3x3VSPEC
The fix is that this line:
"src[s] = tx->regs.vT[s];" is wrong if s doesn't start from 0.
Instead access tx->regs.vT directly when needed.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7865210670)

Conflicts:
	src/gallium/state_trackers/nine/nine_shader.c
2015-01-23 00:47:09 +00:00
Axel Davy
77e1136f44 st/nine: Fill missing dst and src number for some instructions.
Not filling them correctly results in bad padding and later crash.

Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b1259544e3)
2015-01-23 00:44:42 +00:00
Axel Davy
22c75f9f5a st/nine: Implement TEXCOORD special behaviours
texcoord for ps < 1_4 should clamp between 0 and 1 the values.

texcrd (texcoord ps 1_4) does not clamp and can be used with
two modifiers _dw and _dz that means the channels are divided
by w or z.
Implement those in shared code, since the same modifiers can be used
for texld ps 1_4.

v2: replace DIV by RCP + MUL
v3: Remove an useless MOV

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5399119fb1)

Conflicts:
	src/gallium/state_trackers/nine/nine_shader.c
2015-01-23 00:43:57 +00:00
Axel Davy
4b65be8860 st/nine: Fix some fixed function pipeline operation
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6378d74937)
2015-01-22 23:43:28 +00:00
Axel Davy
9ea8e7f0df st/nine: Clamp ps 1.X constants
This is wine (and windows) behaviour.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 018407b5d8)
2015-01-22 23:43:28 +00:00
Axel Davy
d0d09a4eee st/nine: Fix CND implementation
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3ca67f8810)
2015-01-22 23:43:27 +00:00
Axel Davy
75f39e45f0 st/nine: Rewrite LOOP implementation, and a0 aL handling
Previous implementation didn't work well with nested loops.

Instead of using several address registers, put a0 and aL
into normal registers, and copy them to one address register when
we need to use them.

Wine tests loop_index_test() and nested_loop_test() now pass correctly.

Fixes r600g crash while loading Bioshock -
bug https://bugs.freedesktop.org/show_bug.cgi?id=85696

Tested-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6a8e5e48be)
2015-01-22 23:43:27 +00:00
Axel Davy
553089093f st/nine: Correct LOG on negative values
We should take the absolute value of the input.

Also return -FLT_MAX instead of -Inf for an input of 0.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c9aa9a0add)
2015-01-22 23:43:27 +00:00
Axel Davy
add30f01ef st/nine: Handle NRM with input of null norm
When the input's xyz are 0.0, the output
should be 0.0. This is due to the fact that
Inf * 0 = 0 for dx9. To handle this case,
cap the result of RSQ to FLT_MAX. We have
FLT_MAX * 0 = 0.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f5e8e3fb80)
2015-01-22 23:43:27 +00:00
Axel Davy
0dfb9c9e86 st/nine: Handle RSQ special cases
We should use the absolute value of the input as input to ureg_RSQ.

Moreover, an input of 0.0 should return FLT_MAX.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2487f73574)
2015-01-22 23:43:27 +00:00
Axel Davy
7e26cf83ba st/nine: Fix POW implementation
POW doesn't match directly TGSI, since we should
take the absolute value of src0.

Fixes black textures in some games

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c12f8c2088)
2015-01-22 23:43:27 +00:00
Axel Davy
00d22ce0fa st/nine: Fix typo for M4x4
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit e0dd9ca985)
2015-01-22 23:43:26 +00:00
Axel Davy
7f700cc35b st/nine: Correctly declare NineTranslateInstruction_Mkxn inputs
Let's say we have c1 and c2 declared in the shader and c0 given by the app

Then here we would have read c0, c1 and c2 given by the app, instead
of the correct c0, c1, c2.

This correction fixes several issues in some games.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 53dc992f20)
2015-01-22 23:43:26 +00:00
Axel Davy
e6167e749c st/nine: Saturate oFog and oPts vs outputs
According to docs and Wine, these two vs outputs have
to be saturated.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9fb58a74a0)
2015-01-22 23:43:26 +00:00
Axel Davy
bce0058333 st/nine: Remove some shader unused code
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a214838181)
2015-01-22 23:43:26 +00:00
Axel Davy
9a0647ba7f st/nine: Convert integer constants to floats before storing them when cards don't support integers
The shader code is already behaving as if they are floats when the the card doesn't support integers

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d08c7b0b88)
2015-01-22 23:43:26 +00:00
Axel Davy
669c5d6d44 st/nine: Rework of boolean constants
Convert them to shader booleans at earlier stage.
Previous code is fine, but later patch will make
integers being converted at earlier stage, so do
the same for booleans

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d9d18fe39f)
2015-01-22 23:43:26 +00:00
Axel Davy
87ac37074f st/nine: Add ATI1 and ATI2 support
Adds ATI1 and ATI2 support to nine.

They map to PIPE_FORMAT_RGTC1_UNORM and PIPE_FORMAT_RGTC2_UNORM,
but need special handling.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 77f0ecf9ce)
2015-01-22 23:43:25 +00:00
Axel Davy
e1bcca4f13 st/nine: Check if srgb format is supported before trying to use it.
According to msdn, we must act as if user didn't ask srgb if we don't
support it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b0b5430322)
2015-01-22 23:43:25 +00:00
Stanislaw Halik
50ea1c1f5f st/nine: Hack to generate resource if it doesn't exist when getting view
Buffers in the MANAGED pool are supposed to have the content in a ram buffer,
a copy in VRAM if there is enough memory (driver manages memory and decide when
to delete the buffer in VRAM).

This is not implemented properly in nine, and a VRAM copy is going to be created
when the RAM memory is filled, and the VRAM copy will get synced with the RAM
memory updates.

Due to some issues (in the implementation or in app logic), it can happen
we try to create a sampler view of the resource while we haven't created the
VRAM resource. This hack creates the resource when we hit this case, which prevents
crashing, but doesn't help with the resource content.

This fixes several games crashing at launch.

Acked-by: Axel Davy <axel.davy@ens.fr>
Acked-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 82810d3b66)
2015-01-22 23:43:25 +00:00
Axel Davy
3ca8b93476 st/nine: NineBaseTexture9: update sampler view creation
While previous code was having the correct behaviour in general,
this new code is more readable (without checking all gallium formats
manually) and has a more defined behaviour for depth stencil resources.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 47280d777d)
2015-01-22 23:43:25 +00:00
Axel Davy
d06b403377 st/nine: Return D3DERR_INVALIDCALL when trying to create a texture of bad format
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 0abfb80dac)
2015-01-22 23:43:12 +00:00
Axel Davy
481af42f28 st/nine: Fix crash when deleting non-implicit swapchain
The implicit swapchains are destroyed when the device instance is
destroyed. However for non-implicit swapchains, it is not the case,
and the application can have kept an reference on the swapchain
buffers to reuse them.

Fixes problems with battle.net launcher.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 0d2c22e648)
2015-01-22 23:41:09 +00:00
Axel Davy
393fffd07d st/nine: CubeTexture: fix GetLevelDesc
This->surfaces contains the surfaces associated to the levels
and faces. This->surfaces[6*Level] is what we want here,
since it gives us a face descriptor for the level 'Level'.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9232161178)
2015-01-22 23:41:08 +00:00
Axel Davy
c159b4095c st/nine: NineBaseTexture9: fix setting of last_layer
Use same similar settings as u_sampler_view_default_template

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 18c7e70226)
2015-01-22 23:41:08 +00:00
Axel Davy
b80b5b35a3 st/nine: Correctly advertise D3DPMISCCAPS_CLIPTLVERTS
The cap means D3DFVF_XYZRHW vertices will see clipping.
This is not the case when
PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION is supported, since
it'll disable clipping.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 05e20e1045)
2015-01-22 23:41:08 +00:00
Xavier Bouchoux
41ca03a7b4 st/nine: Fix D3DRS_POINTSPRITE support
It's done by testing the existence of the point sprite output register *after* parsing the vertex shader.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit dc88989189)
2015-01-22 23:41:08 +00:00
Axel Davy
18ac34825b st/nine: Add new texture format strings
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d2f2a550cf)
2015-01-22 23:41:07 +00:00
Xavier Bouchoux
15ef84ccfb st/nine: Add missing c++ declaration for IDirect3DVolumeTexture9
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 072e2ba8e1)
2015-01-22 23:41:07 +00:00
Xavier Bouchoux
44ee59d300 st/nine: Additional defines to d3dtypes.h
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8bb550b958)
2015-01-22 23:41:07 +00:00
Jose Fonseca
1e0ab5b826 nine: Drop use of TGSI_OPCODE_CND.
This was the only state tracker emitting it, and hardware was just having
to lower it anyway (or failing to lower it at all).

v2: Extracted from a larger patch by Jose (which also dropped DP2A), fixed
    to actually not reference TGSI_OPCODE_CND.  Change by anholt.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 925cb75f89)
2015-01-22 23:40:09 +00:00
Jonathan Gray
a3381286d8 glsl: Link glsl_test with pthreads library.
Otherwise pthread_mutex_lock will be an undefined reference
on OpenBSD.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88219
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c5be9c126d)
2015-01-22 22:27:12 +00:00
Kenneth Graunke
882f702441 i965: Work around mysterious Gen4 GPU hangs with minimal state changes.
Gen4 hardware appears to GPU hang frequently when using Chromium, and
also when running 'glmark2 -b ideas'.  Most of the error states contain
3DPRIMITIVE commands in quick succession, with very few state packets
between them - usually VERTEX_BUFFERS/ELEMENTS and CONSTANT_BUFFER.

I trimmed an apitrace of the glmark2 hang down to two draw calls with a
glUniformMatrix4fv call between the two.  Either draw by itself works
fine, but together, they hang the GPU.  Removing the glUniform call
makes the hangs disappear.  In the hardware state, this translates to
removing the CONSTANT_BUFFER packet between the two 3DPRIMITIVE packets.

Flushing before emitting CONSTANT_BUFFER packets also appears to make
the hangs disappear.  I observed a slowdown in glxgears by doing it all
the time, so I've chosen to only do it when BRW_NEW_BATCH and
BRW_NEW_PSP are unset (i.e. we haven't done a CS_URB_STATE change or
already flushed the whole pipeline).

I'd much rather understand the problem, but at this point, I don't see
how we'd ever be able to track it down further.  We have no real tools,
and the hardware people moved on years ago.  I've analyzed 20+ error
states and read every scrap of documentation I could find.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80568
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85367
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c4fd0c9052)
2015-01-22 16:11:03 +00:00
Jason Ekstrand
a25e26f67f mesa: Fix clamping to -1.0 in snorm_to_float
This patch fixes the return of a wrong value when x is lower than
-MAX_INT(src_bits) as the result would not be between [-1.0 1.0].

v2 by Samuel Iglesias <siglesias@igalia.com>:
    - Modify snorm_to_float() to avoid doing the division when
      x == -MAX_INT(src_bits)

Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 7d1b08ac44)
2015-01-17 14:59:56 +00:00
Kenneth Graunke
021d71b848 i965: Respect the no_8 flag on Gen6, not just Gen7+.
When doing repclears, we only want to use the SIMD16 program, not the
SIMD8 one.  Kristian added this to the Gen7+ code, but apparently we
missed it in the Gen6 code.  This patch copies that code over.

Approximately doubles the performance in a clear microbenchmark from
mesa-demos (clearspd -width 500 -height 500 +color) on Sandybridge.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
References: https://code.google.com/p/chrome-os-partner/issues/detail?id=34681
(cherry picked from commit f95733ddb7)

Conflicts:
	src/mesa/drivers/dri/i965/gen6_wm_state.c
2015-01-17 14:59:08 +00:00
Emil Velikov
14f1659b43 docs: Add sha256 sums for the 10.4.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:37:09 +00:00
Emil Velikov
02f2e97c3e Add release notes for the 10.4.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:30:28 +00:00
Emil Velikov
5906dd6c99 Update version to 10.4.2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:24:59 +00:00
Dave Airlie
2d05942b74 r600g/sb: implement r600 gpr index workaround. (v3.1)
r600, rv610 and rv630 all have a bug in their GPR indexing
and how the hw inserts access to PV.

If the base index for the src is the same as the dst gpr
in a previous group, then it will use PV instead of using
the indexed gpr correctly.

The workaround is to insert a NOP when you detect this.

v2: add second part of fix detecting DST rel writes followed
by same src base index reads.

v3: forget adding stuff to structs, just iterate over the
previous node group again, makes it more obvious.
v3.1: drop local_nop.

Fixes ~200 piglit regressions on rv635 since SB was introduced.

Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 3c8ef3a74b)
2015-01-07 17:39:52 +00:00
Dave Airlie
099ed78a04 r600g: fix regression since UCMP change
Since d8da6decea where the
state tracker started using UCMP on cayman a number of tests
regressed.

this seems to be r600g is doing CNDGE_INT for UCMP which is >= 0,
we should be doing CNDE_INT with reverse arguments.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0d4272cd8e)
2015-01-07 17:35:39 +00:00
Vadim Girlin
91c5770ba1 r600g/sb: fix issues with loops created for switch
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit de0fd375f6)
2015-01-07 17:31:12 +00:00
Dave Airlie
3306ed6fd7 Revert "r600g/sb: fix issues cause by GLSL switching to loops for switch"
This reverts commit 7b0067d23a.

Vadim's patch fixes this a lot better.

(cherry picked from commit 34e512d9ea)
2015-01-07 17:29:01 +00:00
Marek Olšák
81f8006f7d radeonsi: fix VertexID for OpenGL
This fixes all failing piglit VertexID tests.

Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d7c6f397f4)
2015-01-07 17:25:06 +00:00
Marek Olšák
1b498cf5b7 st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEX
Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit eaae92a349)
2015-01-07 17:04:21 +00:00
Marek Olšák
8c77be7ef9 vbo: ignore primitive restart if FixedIndex is enabled in DrawArrays
From GL 4.4 Core profile:

  If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are
  enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX is
  used. If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not
  performed for array elements transferred by any drawing command not taking a
  type parameter, including all of the *Draw* commands other than *DrawEle-
  ments*.

Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8f5d309521)
2015-01-07 16:51:02 +00:00
Leonid Shatz
ef43d21bbc gallium/util: make sure cache line size is not zero
The "normal" detection (querying clflush size) already made sure it is
non-zero, however another method did not. This lead to crashes if this
value happened to be zero (apparently can happen in virtualized environments
at least).
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87913

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5fea39ace3)
2015-01-06 16:21:03 +00:00
Roland Scheidegger
ac3ca98a1b gallium/util: fix crash with daz detection on x86
The code used PIPE_ALIGN_VAR for the variable used by fxsave, however this
does not work if the stack isn't aligned. Hence use PIPE_ALIGN_STACK function
decoration to fix the segfault which can happen if stack alignment is only
4 bytes.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87658.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b59c7ed0ab)
2015-01-06 16:02:10 +00:00
Ilia Mirkin
af1a690075 nv50/ir: fix texture offsets in release builds
assert's get compiled out in release builds, so they can't be relied
upon to perform logic.

Reported-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Roy Spliet <rspliet@eclipso.eu>
Cc: "10.2 10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fb1afd1ea5)
2015-01-06 15:52:12 +00:00
Chad Versace
fffe533f08 i965: Use safer pointer arithmetic in gather_oa_results()
This patch reduces the likelihood of pointer arithmetic overflow bugs in
gather_oa_results(), like the one fixed by b69c7c5dac.

I haven't yet encountered any overflow bugs in the wild along this
patch's codepath. But I get nervous when I see code patterns like this:

   (void*) + (int) * (int)

I smell 32-bit overflow all over this code.

This patch retypes 'snapshot_size' to 'ptrdiff_t', which should fix any
potential overflow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 414be86c96)
2015-01-04 21:39:10 +00:00
Chad Versace
4d5e0f78b7 i965: Use safer pointer arithmetic in intel_texsubimage_tiled_memcpy()
This patch reduces the likelihood of pointer arithmetic overflow bugs in
intel_texsubimage_tiled_memcpy() , like the one fixed by b69c7c5dac.

I haven't yet encountered any overflow bugs in the wild along this
patch's codepath. But I recently solved, in commit b69c7c5dac, an overflow
bug in a line of code that looks very similar to pointer arithmetic in
this function.

This patch conceptually applies the same fix as in b69c7c5dac. Instead
of retyping the variables, though, this patch adds some casts. (I tried
to retype the variables as ptrdiff_t, but it quickly got very messy. The
casts are cleaner).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 225a09790d)
2015-01-04 21:39:00 +00:00
Marek Olšák
b9e56ea151 glsl_to_tgsi: fix a bug in copy propagation
This fixes the new piglit test: arb_uniform_buffer_object/2-buffers-bug

Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 48094d0e65)
2015-01-04 21:38:26 +00:00
Kenneth Graunke
e05c595acd i965: Fix start/base_vertex_location for >1 prims but !BRW_NEW_VERTICES.
This is a partial revert of c89306983c.
It split the {start,base}_vertex_location handling into several steps:

1. Set brw->draw.start_vertex_location = prim[i].start
   and brw->draw.base_vertex_location = prim[i].basevertex.
   (This happened once per _mesa_prim, in the main drawing loop.)
2. Add brw->vb.start_vertex_bias and brw->ib.start_vertex_offset
   appropriately.  (This happened in brw_prepare_shader_draw_parameters,
   which was called just after brw_prepare_vertices, as part of state
   upload, and only happened when BRW_NEW_VERTICES was flagged.)
3. Use those values when emitting 3DPRIMITIVE (once per _mesa_prim).

If we drew multiple _mesa_prims, but didn't flag BRW_NEW_VERTICES on
the second (or later) primitives, we would do step #1, but not #2.
The first _mesa_prim would get correct values, but subsequent ones
would only get the first half of the summation.

The reason I originally did this was because I needed the value of
gl_BaseVertexARB to exist in a buffer object prior to uploading
3DSTATE_VERTEX_BUFFERS.  I believed I wanted to upload the value
of 3DPRIMITIVE's "Base Vertex Location" field, which was computed
as: (prims[i].indexed ? prims[i].start : prims[i].basevertex) +
brw->vb.start_vertex_bias.  The latter value wasn't available until
after brw_prepare_vertices, and the former weren't available in the
state upload code at all.  Hence the awkward split.

However, I believe that including brw->vb.start_vertex_bias was a
mistake.  It's an extra bias we apply when uploading vertex data into
VBOs, to move [min_index, max_index] to [0, max_index - min_index].

>From the GL_ARB_shader_draw_parameters specification:
"<gl_BaseVertexARB> holds the integer value passed to the <baseVertex>
 parameter to the command that resulted in the current shader
 invocation.  In the case where the command has no <baseVertex>
 parameter, the value of <gl_BaseVertexARB> is zero."

I conclude that gl_BaseVertexARB should only include the baseVertex
parameter from glDraw*Elements*, not any internal biases we add for
optimization purposes.

With that in mind, gl_BaseVertexARB only needs prim[i].start or
prim[i].basevertex.  We can simply store that, and go back to computing
start_vertex_location and base_vertex_location in brw_emit_prim(), like
we used to.  This is much simpler, and should actually fix two bugs.

Fixes missing geometry in Unvanquished.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85529
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit c633528cba)
2015-01-04 21:38:16 +00:00
Ilia Mirkin
c48d0d8dd2 nv50,nvc0: set vertex id base to index_bias
Fixes the piglits which check that gl_VertexID includes the base vertex
offset:
  arb_draw_indirect-vertexid elements
  gl-3.2-basevertex-vertexid

Note that this leaves out the original G80, for which this will continue
to fail. It could be fixed by passing a driver constbuf value in, but
that's beyond the scope of this change.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit be0311c962)
2015-01-04 21:37:51 +00:00
Tiziano Bacocco
aafd13027a nv50,nvc0: implement half_pixel_center
LAST_LINE_PIXEL has actually been renamed to PIXEL_CENTER_INTEGER in
rnndb; use that method to implement the rasterizer setting, used for
st/nine.

Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 609c3e51f5)
2015-01-04 21:37:32 +00:00
Michel Dänzer
1f42230fa7 radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0
E.g. this could happen on older kernels which don't support the
RADEON_INFO_SI_BACKEND_ENABLED_MASK query yet. The code in
si_write_harvested_raster_configs() doesn't deal with this correctly and
would probably mangle the value badly.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit b3057f8097)
2015-01-04 21:34:08 +00:00
Kenneth Graunke
2b85ed72db i965: Add missing BRW_NEW_*_PROG_DATA to texture/renderbuffer atoms.
This was probably missed when moving from a fixed binding table layout
to a dynamic one that changes based on the shader.

Fixes newly proposed Piglit test fbo-mrt-new-bind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87619
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Mike Stroyan <mike@LunarG.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4616b2ef85)
2015-01-04 21:33:26 +00:00
Emil Velikov
4cd38a592e docs: Add sha256 sums for the 10.4.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 02:38:02 +00:00
Emil Velikov
60e2e04fe8 Add release notes for the 10.4.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 02:11:34 +00:00
Emil Velikov
1a3df8cc77 Update version to 10.4.1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 02:07:33 +00:00
Emil Velikov
45416a255f Revert "glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)"
This reverts commit ee241a6889.

May not be the correct fix. Discussion is ongoing.

http://lists.freedesktop.org/archives/mesa-dev/2014-December/072969.html
2014-12-30 01:03:14 +00:00
Cody Northrop
fb3f7c0bc5 i965: Require pixel alignment for GPU copy blit
The blitter will start at a pixel's natural alignment. For PBOs, if the
provided offset if not aligned, bits will get dropped.

This change adds offset alignment check for src and dst, kicking back if
the requirements are not met.

The change is based on following verbiage from BSPEC:
 Color pixel sizes supported are 8, 16, and 32 bits per pixel (bpp).
 All pixels are naturally aligned.

Found in the following locations:
page 35 of intel-gfx-prm-osrc-hsw-blitter.pdf
page 29 of ivb_ihd_os_vol1_part4.pdf
page 29 of snb_ihd_os_vol1_part5.pdf

This behavior was observed with Steam Big Picture rendering incorrect
icon colors.  The fix has been tested on Ubuntu and SteamOS on Haswell.

Signed-off-by: Cody Northrop <cody@lunarg.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83908
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 83e8bb5b1a)
Nominated-by: Matt Turner <mattst88@gmail.com>
2014-12-21 21:19:31 +00:00
Ian Romanick
4f570f2fb3 linker: Assign varying locations geometry shader inputs for SSO
Previously only geometry shader outputs would be assigned locations if
the geometry shader was the only stage in the linked program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: pavol@klacansky.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit a909b995d9)
Nominted-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-21 21:18:09 +00:00
Ian Romanick
a4c8348597 linker: Wrap access of producer_var with a NULL check
producer_var could be NULL if consumer_var is not NULL and
consumer_is_fs is false.  This will occur when the producer is NULL and
the consumer is the geometry shader for a program that contains only a
geometry shader.  This will occur starting with the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: pavol@klacansky.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 5eca78a00a)
Nominated-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-21 21:17:45 +00:00
Maxence Le Doré
893583776e glsl: Add gl_MaxViewports to available builtin constants
It seems to have been forgotten during viewports array implementation time.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 19e05d6898)
2014-12-21 21:17:24 +00:00
Andres Gomez
2d669f6583 i965/brw_reg: struct constructor now needs explicit negate and abs values.
We were assuming, when constructing a new brw_reg struct, that the
negate and abs register modifiers would not be present by default in
the new register.

Now, we force explicitly setting these values when constructing a new
register.

This will avoid problems like forgetting to properly set them when we
are using a previous register to generate this new register, as it was
happening in the dFdx and dFdy generation functions.

Fixes piglit test shaders/glsl-deriv-varyings

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82991
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 8517e665bc)
2014-12-21 21:17:16 +00:00
Mario Kleiner
bccfe7ae0f glx/dri3: Don't fail on glXSwapBuffersMscOML(dpy, window, 0, 0, 0) (v2)
glXSwapBuffersMscOML() with target_msc=divisor=remainder=0 gets
translated into target_msc=divisor=0 but remainder=1 by the mesa
api. This is done for server DRI2 where there needs to be a way
to tell the server-side DRI2ScheduleSwap implementation if a call
to glXSwapBuffers() or glXSwapBuffersMscOML(dpy,window,0,0,0) was
done. remainder = 1 was (ab)used as a flag to tell the server to
select proper semantic. The DRI3/Present backend ignored this
signalling, treated any target_msc=0 as glXSwapBuffers() request,
and called xcb_present_pixmap with invalid divisor=0, remainder=1
combo. The present extension responded kindly to this with a
BadValue error and dropped the request, but mesa's DRI3/Present
backend doesn't check for error codes. From there on stuff went
downhill quickly for the calling OpenGL client...

This patch fixes the problem.

v2: Change comments to be more clear, with reference to
relevant spec, as suggested by Eric Anholt.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 0d7f4c8658)
2014-12-14 15:45:27 +00:00
Mario Kleiner
ee241a6889 glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)
Restores proper immediate tearing swap behaviour for
OpenGL bufferswap under DRI3/Present.

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

v2: Add Frank Binns signed off by for his original earlier
patch from April 2014, which is identical to this one, and
Chris Wilsons reviewed tag from May 2014 for that patch, ergo
also for this one.

v3: Incorporate comment about triple buffering as suggested
by Axel Davy, and reference to relevant spec provided by
Eric Anholt.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 455d3036fa)
2014-12-14 15:45:21 +00:00
Mario Kleiner
4b37a18da5 glx/dri3: Track separate (ust, msc) for PresentPixmap vs. PresentNotifyMsc (v2)
Prevent calls to glXGetSyncValuesOML() and glXWaitForMscOML()
from overwriting the (ust,msc) values of the last successfull
swapbuffers call (PresentPixmapCompleteNotify event), as
glXWaitForSbcOML() relies on those values corresponding to
the most recent completed swap, not to whatever was last
returned from the server.

Problematic call sequence without this patch would have been, e.g.,

glXSwapBuffers()
... wait ...
swap completes -> PresentPixmapComplete event -> (ust,msc)
updated to reflect swap completion time and count.
... wait for at least 1 video refresh cycle/vblank increment.

glXGetSyncValuesOML()
-> PresentNotifyMsc event overwrites (ust,msc) of swap
completion with (ust,msc) of most recent vblank

glXWaitForSbcOML()
-> Returns sbc of last completed swap but (ust,msc) of last
completed vblank, not of last completed swap.
-> Client is confused.

Do this by tracking a separate set of (ust, msc) for the
dri3_wait_for_msc() call than for the dri3_wait_for_sbc()
call.

This makes the glXWaitForSbcOML() call robust again and restores
consistent behaviour with the DRI2 implementation.

Fixes applications originally written and tested against
DRI2 which also rely on this not regressing under DRI3/Present,
e.g., Neuro-Science software like Psychtoolbox-3.

This patch fixes the problem.

v2: Rename vblank_msc/ust to notify_msc/ust as suggested by
Axel Davy for better clarity.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit ad8b0e8bf6)
2014-12-14 15:45:15 +00:00
Mario Kleiner
93f6f55983 glx/dri3: Fix glXWaitForSbcOML() to handle targetSBC==0 correctly. (v2)
targetSBC == 0 is a special case, which asks the function
to block until all pending OpenGL bufferswap requests have
completed.

Currently the function just falls through for targetSBC == 0,
returning bogus results.

This breaks applications originally written and tested against
DRI2 which also rely on this not regressing under DRI3/Present,
e.g., Neuro-Science software like Psychtoolbox-3.

This patch fixes the problem.

v2: Simplify as suggested by Axel Davy. Add comments proposed
by Eric Anholt.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8cab54de16)
2014-12-14 15:45:10 +00:00
Emil Velikov
af0c82099b docs: Add 10.4 sha256 sums, news item and link release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-14 13:57:54 +00:00
Emil Velikov
5fe79b0b12 docs: Update 10.4.0 release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-14 13:45:54 +00:00
Emil Velikov
45f3aa0bc7 Bump version to 10.4.0 (final)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-14 13:32:44 +00:00
Alexander von Gluck IV
90239276ff mesa/drivers: Add missing mesautil lib to Haiku swrast
* Resolves missing util_format_linear_to_srgb_8unorm_table symbol.

(cherry picked from commit ad2ffd3bc6)
2014-12-11 13:54:54 +00:00
Roland Scheidegger
57868b1ee4 llvmpipe: fix lp_test_arit denorm handling
llvmpipe disables denorms on purpose (on x86/sse only), because denorms are
generally neither required nor desired for graphic apis (and in case of d3d10,
they are forbidden).
However, this caused some arithmetic tests using denorms to fail on some
systems, because the reference did not generate the same results anymore.
(It did not fail on all systems - behavior of these math functions is sort
of undefined when called with non-standard floating point mode, hence the
result differing depending on implementation and in particular the sse
capabilities.)
So, for the reference, simply flush all (input/output) denorms manually
to zero in this case.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8148a06b8f)
Nominated-by: Matt Turner <mattst88@gmail.com>
2014-12-11 13:54:54 +00:00
Marek Olšák
fe2eac2237 docs/relnotes: document the removal of GALLIUM_MSAA
Cc: 10.2.10.3 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ac319d94d3)
2014-12-11 13:54:54 +00:00
Matt Turner
db784a09f1 i965: Disable unlit-centroid workaround on Gen < 6.
Back to the original commit (8313f444) adding the workaround, we were
enabling it on gens <= 7, even though gens <= 5 can't do multisampling.

I cannot find documentation that says that Sandybridge needs this
workaround but in practice disabling it causes these piglit tests to
fail:

EXT_framebuffer_multisample/interpolation {2,4} centroid-deriv{,-disabled}

On Ironlake:

total instructions in shared programs: 4358478 -> 4349671 (-0.20%)
instructions in affected programs:     117680 -> 108873 (-7.48%)

A bunch of shaders in TF2, Portal 2, and L4D2 are cut by 25~30%.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit 1a2de7dce8)
2014-12-11 13:54:53 +00:00
Dave Airlie
d9f4aaa095 r600g: only init GS_VERT_ITEMSIZE on r600
On evergreen there are 4 regs, on r600/700 there is only one.

Don't initialise regs and trash someone elses state.

Not sure this fixes anything, but hey one less stupid.

Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 7f21cf7198)
2014-12-11 13:54:53 +00:00
Timothy Arceri
e340a28dba mesa: use build flag to ensure stack is realigned on x86
Nowadays GCC assumes stack pointer is 16-byte aligned even on 32-bits, but that is an assumption OpenGL drivers (or any dynamic library for that matter) can't afford to make as there are many closed- and open- source application binaries out there that only assume 4-byte stack alignment.

V4: fix comment and indentation

V3: move all sse4.1 build flag config to the same location
 and add comment as to why we need to do the realign

V2: use $target_cpu rather than $host_cpu
  and setup build flags in config rather than makefile

https://bugs.freedesktop.org/show_bug.cgi?id=86788
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Matt Turner <mattst88@gmail.com>
CC: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f1b5f2b157)
2014-12-11 13:54:53 +00:00
Tom Stellard
6b908efd58 radeonsi: Program RASTER_CONFIG for harvested GPUs v5
Harvested GPUs have some of their render backends disabled, so
in order to prevent the hardware from trying to render things
with these disabled backends we need to correctly program
the PA_SC_RASTER_CONFIG register.

v2:
  - Write RASTER_CONFIG for all SEs.

v3:
  - Set GRBM_GFX_INDEX.INSTANCE_BROADCAST_WRITES bit.
  - Set GRBM_GFX_INFEX.SH_BROADCAST_WRITES bit when done setting
    PA_SC_RASTER_CONFIG.
  - Get num_se and num_sh_per_se from kernel.

v4:
  - Get correct value for num_se
  - Remove loop for setting PA_SC_RASTER_CONFIG
  - Only compute raster config when a backend has been disabled.

v5: Michel Dänzer
  - Fix computation for chips with multiple SEs

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

CC: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 67dcbcd92c)
2014-12-11 13:54:53 +00:00
Abdiel Janulgue
65f03e6733 ir_to_mesa: Remove sat to clamp lowering pass
Fixes an infinite loop in swrast where the lowering pass unpacks saturate into
clamp but the opt_algebraic pass tries to do the opposite.

v3 (Ian):
This is a revert of commit cfa8c1cb "ir_to_mesa: lower ir_unop_saturate" on
the ir_to_mesa.cpp portion. prog_execute.c can handle saturates in vertex
shaders, so classic swrast shouldn't need this lowering pass.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83463
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
(cherry picked from commit 39f7b72428)
2014-12-11 13:54:53 +00:00
Chris Forbes
ffaf58e7d0 i965/Gen6-7: Fix point sprites with PolygonMode(GL_POINT)
This was an oversight in the original patch. When PolygonMode is
used, then front faces, back faces, or both may be rendered as
points and are affected by point sprite state.

Note that SNB/IVB can't actually be fully conformant here, for
a legacy context -- we don't have separate sets of pointsprite
enables for front and back faces. Haswell ignores pointsprite
state correctly in hardware for non-point rasterization, so can
do this correctly, but it doesn't seem worth it.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86764
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit ed56c16820)
2014-12-11 13:54:53 +00:00
Ben Widawsky
bb9dea8a29 i965/gs: Avoid DW * DW mul
The GS has an interesting use for mul. Because the GS can emit multiple
vertices per input vertex, and it also has a unique count at the top of the URB
payload, the GS unit needs to be able to dynamically specify URB write offsets
(relative to the global offset). The documentation in the function has a very
good explanation from Paul on the mechanics.

This fixes around 2000 piglit tests on BSW.

v2:
Reworded commit message (Ben) no mention of CHV (Matt)
Change SHRT_MAX to USHRT_MAX (Ken, and Matt)
Update comment in code to reflect the use of UW (Ben)
Add Gen7+ assertion for the relevant GS code, since it won't work on Gen6- (Ken)
Drop the bogus hunk in emit_control_data_bits() (Ken)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84777 (with many dupes)
Cc: "10.4 10.3 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit f13870db09)
2014-12-11 13:54:53 +00:00
José Fonseca
be59440b53 util/primconvert: Avoid point arithmetic; apply offset on all cases.
Matches what u_vbuf_get_minmax_index() does.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit f9098f0972)
2014-12-11 13:54:52 +00:00
Ilia Mirkin
ac8d596498 util/primconvert: take ib offset into account
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c3bed13604)
2014-12-11 13:54:52 +00:00
Ilia Mirkin
112d2fdb17 util/primconvert: support instanced rendering
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit fb434e675f)
2014-12-11 13:54:52 +00:00
Ilia Mirkin
c6353cee0c util/primconvert: pass index bias through
The index_bias (aka base_vertex) applies to the downstream draw just as
much, since the actual index values are never modified.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 1dfa039168)
2014-12-11 13:54:52 +00:00
Emil Velikov
09e4f1a50f Increment version to 10.4.0-rc4
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-05 18:52:11 +00:00
Axel Davy
c7b9a2e38a st/nine: Fix vertex declarations for non-standard (usage/index)
Nine code to match vertex declaration to vs inputs was limiting
the number of possible combinations.

Some sm3 games have issues with that, because arbitrary (usage/index)
can be used.

This patch does the following changes to fix the problem:
. Change the numbers given to (usage/index) combinations to uint16
. Do not put limits on the indices when it doesn't make sense
. change the conversion rule (usage/index) -> number to fit all combinations
. Instead of having a table usage_map mapping a (usage/index) number to
an input index, usage_map maps input indices to their (usage/index)

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: Yaroslav Andrusyak <pontostroy@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 712a4c5438)
2014-12-03 23:20:56 +00:00
Axel Davy
6fcbf9aee3 st/nine: sm1_declusage_to_tgsi, do not restrict indices with TGSI_SEMANTIC_GENERIC
With sm3, you can declare an input/output with an usage and an usage index.

Nine code hardcodes the translation usage/index to a corresponding TGSI code.
The translation was limited to a few usage/index combinations that were corresponding
to most of the needs of games, but some games did not work.

This patch rewrites that Nine code to map all possible usage/index combination
to TGSI code. The index associated to TGSI_SEMANTIC_GENERIC doesn't need to be low
for good performance, as the old code was supposing, and is not particularly bounded
(it's UINT16). Given the index is BYTE, we can map all combinations.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: Yaroslav Andrusyak <pontostroy@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 5d6d260833)
2014-12-03 23:20:01 +00:00
Axel Davy
fd2852fe5b st/nine: Queries: Fix D3DISSUE_END behaviour.
Issuing D3DISSUE_END should:
. reset previous queries if possible
. end the query

Previous behaviour wasn't calling end_query for
queries not needing D3DISSUE_BEGIN, nor resetting
previous queries.

This fixes several applications not launching properly.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit eac0b9b68a)

Conflicts:
	src/gallium/state_trackers/nine/query9.c
2014-12-03 23:18:48 +00:00
Brian Paul
57057c439e mesa: fix height error check for 1D array textures
height=0 is legal for 1D array textures (as depth=0 is legal for
2D arrays).  Fixes new piglit ext_texture_array-errors test.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4e6244e80f)
2014-12-03 23:16:36 +00:00
Dave Airlie
b5cc04b6ad r600g/sb: fix issues cause by GLSL switching to loops for switch
Since 73dd50acf6
glsl: implement switch flow control using a loop

The SB backend was falling over in an assert or crashing.

Tracked this down to the loops having no repeats, but requiring
a working break, initial code just called the loop handler for
all non-if statements, but this caused a regression in
tests/shaders/dead-code-break-interaction.shader_test.
So I had to add further code to detect if all the departure
nodes are empty and avoid generating an empty loop for that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86089
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 7b0067d23a)
2014-12-03 23:15:27 +00:00
Brian Paul
d2e9fd5b6d mesa: fix arithmetic error in _mesa_compute_compressed_pixelstore()
We need parenthesis around the expression which computes the number of
blocks per row.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 991d5cf8ce)
2014-12-03 23:15:12 +00:00
Ilia Mirkin
b61192f2ae freedreno/ir3: fix UMAD
Looks like none of the mad variants do u16 * u16 + u32, so just add in
the extra value "by hand".

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit de83ef677f)
2014-12-03 23:15:05 +00:00
Ilia Mirkin
75c4824d2f freedreno/a3xx: only enable blend clamp for non-float formats
This fixes arb_color_buffer_float-render GL_RGBA16F.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3de9fa8ff4)
2014-12-03 23:14:48 +00:00
Christoph Bumiller
f30fbbdbdd nv50/ir/tgsi: handle TGSI_OPCODE_ARR
This instruction is used by st/nine.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f3b4b263c2)
2014-12-03 23:14:34 +00:00
Emil Velikov
b247956c77 cherry-ignore: drop whitespace commit
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-03 23:13:53 +00:00
Axel Davy
72a802a9c2 st/nine: Fix setting of the shift modifier in nine_shader
It is an sint_4, but it was stored in a uint_8...
The code using it was acting as if it was signed.

Problem found thanks to Coverity

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit d52328fc39)
2014-12-03 22:59:28 +00:00
David Heidelberg
cfbc474d80 st/nine: remove unused pipe_viewport_state::translate[3] and scale[3]
2efabd9f5a removed them as unused.

This caused random memory overwrites (reported by Coverity).

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 90fea6b3e0)
2014-12-03 22:59:21 +00:00
Axel Davy
360872a45e st/nine: fix wrong variable reset
Error detected by Coverity (COPY_PASTE_ERROR)

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 614d9387c7)
2014-12-03 22:59:12 +00:00
David Heidelberg
42839ea5ba st/nine: return GetAvailableTextureMem in bytes as expected (v2)
PIPE_CAP_VIDEO_MEMORY returns the amount of video memory in megabytes,
so need to converted it to bytes.

Fixed Warframe memory detection.

v2: also prepare for cards with more than 4GB memory

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: Yaroslav Andrusyak <pontostroy@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit a99f31bced)
2014-12-03 22:59:07 +00:00
Axel Davy
8dc03bd575 st/nine: Add pool check to SetTexture (v2)
D3DPOOL_SCRATCH is disallowed according to spec.
D3DPOOL_SYSTEMMEM should be allowed but we don't handle it right for now.

v2: Fixes segfault in SetTexture when unsetting the texture

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 4eea2496bc)
2014-12-03 22:58:54 +00:00
Axel Davy
41906e9764 st/nine: propertly declare constants (v2)
Fixes "Error : CONST[20]: Undeclared source register" when running
dx9_alpha_blending_material. Also artifacts on ilo.

v2: also remove unused MISC_CONST

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 890f963d64)
2014-12-03 22:58:49 +00:00
Stanislaw Halik
56572002fc st/nine: call DBG() at more external entry points
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
(cherry picked from commit 7f74b9d479)
2014-12-03 22:58:44 +00:00
Axel Davy
c0e0de45dc st/nine: rework the way D3DPOOL_SYSTEMMEM is handled
This patch moves the data field from Resource9 to Surface9 and cleans
D3DPOOL_SYSTEMMEM handling in Texture9. This fixes HL2 lost coast.

It also removes in Texture9 some code written to support importing
and exporting non D3DPOOL_SYSTEMMEM shared buffers. This code hadn't
the design required to support the feature and wasn't used.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 6aeae7442d)
2014-12-03 22:58:39 +00:00
Axel Davy
b75a285633 st/nine: Rework Basetexture9 and Resource9.
Instead of having parts of the structures initialised by the parents,
have them initialised by the children.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 133b2087c5)
2014-12-03 22:58:35 +00:00
Axel Davy
1cf4dbdc81 st/nine: clean device9ex.
Pass ex specific parameters as arguments to device9 ctor instead
of passing them by filling the structure.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 104b5a8193)
2014-12-03 22:58:29 +00:00
Emil Velikov
c29ddc923f Increment version to 10.4.0-rc3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-28 17:58:26 +00:00
Ilia Mirkin
085de45812 freedreno/ir3: don't pass consts to madsh.m16 in MOD logic
madsh.m16 can't handle a const in src1, make sure to unconst it

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 37fe347542)
2014-11-28 17:29:29 +00:00
Dave Airlie
31c7e6c51d r600g: merge the TXQ and BUFFER constant buffers (v1.1)
We are using 1 more buffer than we have, although in the future the
driver should just end up using one buffer in total probably, this
is a good first step, it merges the txq cube array and buffer info
constants on r600 and evergreen.

This should in theory fix geom shader tests on r600.

v1.1: fix comments from Glenn.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 07ae69753c)

Squashed with commit

r600g: fix fallout from last patch

I accidentally rebased from the wrong machine and missed some
fixes that were on my r600 box.

doh.

this fixes a bunch of geom shader textureSize tests on rv635
from gpu reset to pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86760
Reported-by: wolput@onsneteindhoven.nl
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b10ddf962f)

Squashed with commit

r600g: make llvm code compile this time

Actually compiling the code helps make it compile.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 91a827624c)
2014-11-28 17:29:07 +00:00
José Fonseca
2a0290d5f5 st/wgl: Don't export wglGetExtensionsStringARB.
It's not exported by the official opengl32.dll neither.  Applications are
supposed to get it via wglGetProcAddress(), not GetProcAddress().

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit cb009bdd44)
2014-11-28 17:28:28 +00:00
José Fonseca
f77a97f057 mapi/glapi: Fix dll linkage of GLES1 symbols.
This fixes several MSVC warnings like:

  warning C4273: 'glClearColorx' : inconsistent dll linkage

In fact, we should avoid using `declspec(dllexport)` altogether, and use
exclusively the .DEF instead, which gives more precise control of which
symbols must be exported, but all the public GL/GLES headers practically
force us to pick between `declspec(dllexport)` or
`declspec(dllimport)`.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 5fdb6d6839)
2014-11-28 17:28:20 +00:00
José Fonseca
d45c35c3d7 util/u_snprintf: Don't redefine HAVE_STDINT_H as 0.
We now always guarantee availability of stdint.h on MSVC -- if MSVC
doesn't supply one we use our own.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 4b6e93650c)
2014-11-28 17:28:13 +00:00
Emil Velikov
16eaf01a6a nine: the .pc file should not follow mesa version
The version provided by it should be the same as the one
provided/handled by the module. Add the missing tiny version.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 9b7037a369)
2014-11-26 21:23:59 +00:00
Chris Forbes
6316d415c4 i965/Gen6-7: Do not replace texcoords with point coord if not drawing points
Fixes broken rendering in Windows-based QtQuick2 apps run through Wine.
This library sets all texture units' GL_COORD_REPLACE, leaves point
sprite mode enabled, and then draws a triangle fan.

Will need a slightly different fix for Gen4-5, but I don't have my old
machines in a usable state currently.

V2: - Simplify patch -- the real changes are no longer duplicated across
      the Gen6 and Gen7 atoms.
    - Also don't clobber attr overrides -- which matters on Haswell too,
      and fixes the other half of the problem
    - Fix newly-introduced warnings
V3: - Use BRW_NEW_GEOMETRY_PROGRAM and brw->geometry_program rather than
      core flag and state; keep the state flags in order.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84651
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0008d0e59e)
2014-11-26 21:23:23 +00:00
Kenneth Graunke
dca88397ca glsl: Make lower_constant_arrays_to_uniforms require dereferences.
Ilia noticed that my lowering pass was converting the constant array
used by textureGatherOffsets' offsets parameter to a uniform.  This
broke textureGather for Nouveau, and is generally a horrible plan,
since it violates the GLSL constraint that offsets must be an
immediate constant.

When I wrote this pass, I neglected to consider whole array assignment.
I figured opt_array_splitting would handle constant indexing, so this
pass was really about fixing variable indexing.

textureGatherOffsets is an example of whole array access that we really
don't want to touch.  Whole array copies don't appear to benefit from
this either - they're most likely initializers for temporary arrays
which are going to be mutated anyway.  Since you're copying, you may
as well copy from immediates, not uniforms.

This patch makes the pass look for ir_dereference_arrays of
ir_constants, rather than looking for any ir_constant directly.
This way, it ignores whole array assignment.

No shader-db changes or Piglit regressions on Haswell.  Some Piglit
tests generate different code (fixing textureGatherOffsets on Nouveau).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 60f011af1a)
2014-11-26 21:23:14 +00:00
Chris Forbes
6c383aaadd mesa: Fix Get(GL_TRANSPOSE_CURRENT_MATRIX_ARB) to transpose
This was just returning the same value as GL_CURRENT_MATRIX_ARB.
Spotted while investigating something else in apitrace.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2b4fe85f0e)
2014-11-26 21:23:08 +00:00
Chris Forbes
7e47ae3185 glsl: Generate unique names for each const array lowered to uniforms
Uniform names (even for hidden uniforms) are required to be unique; some
parts of the compiler assume they can be looked up by name.

Fixes the piglit test: tests/spec/glsl-1.20/linker/array-initializers-1

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 129178893b)
2014-11-26 21:20:33 +00:00
Chris Forbes
9e94c05936 i965: Handle nested uniform array indexing
When converting a uniform array reference to a pull constant load, the
`reladdr` expression itself may have its own `reladdr`, arbitrarily
deeply. This arises from expressions like:

   a[b[x]]     where a, b are uniform arrays (or lowered const arrays),
               and x is not a constant.

Just iterate the lowering to pull constants until we stop seeing these
nested. For most shaders, there will be only one pass through this loop.

Fixes the piglit test:
tests/spec/glsl-1.20/linker/double-indirect-1.shader_test

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit adefccd12a)
2014-11-26 21:20:11 +00:00
Dave Airlie
4952c49f21 r600g: do all CUBE ALU operations before gradient texture operations (v2.1)
This moves all the CUBE section above the gradients section,
so that the gradient emission happens on one block which
is what sb/hardware expect.

v2: avoid changes to bytecode by using spare temps
v2.1: shame gcc, oh the shame. (uninit var warnings)

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit c88385603a)
2014-11-26 21:20:05 +00:00
Dave Airlie
013eba0ec1 r600: fix texture gradients instruction emission (v2)
The piglit tests were failing, and it appeared to be SB
optimising out things, but Glenn pointed out the gradients
are meant to be clause local, so we should emit the texture
instructions in the same clause. This moves things around
to always copy to a temp and then emit the texture clauses
for H/V.

v2: Glenn pointed out we could get another ALU fetch in
the wrong place, so load the src gpr earlier as well.

Fixes at least:
./bin/tex-miplevel-selection textureGrad 2D

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 38ec184419)
2014-11-26 21:19:56 +00:00
Ilia Mirkin
db9a6b96ab nv50,nvc0: buffer resources can be bound as other things down the line
res->bind is not an indicator of how the resource is currently bound.
buffers can be rebound across different binding points without changing
underlying storage.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fecae4625c)
2014-11-24 00:55:28 +00:00
Ilia Mirkin
4d9c0445dd nv50,nvc0: actually check constbufs for invalidation
The number of vertex buffers has nothing to do with the number of bound
constbufs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e80a0a7d9a)
2014-11-24 00:55:22 +00:00
Ilia Mirkin
1a8f90dc70 nv50/ir: set neg modifiers on min/max args
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86618
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7d07083cfd)
2014-11-24 00:55:17 +00:00
Emil Velikov
7fe9292069 Increment version to 10.4.0-rc2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-22 03:58:31 +00:00
Chad Versace
c260cb700b i965: Fix segfault in WebGL Conformance on Ivybridge
Fixes regression of WebGL Conformance test texture-size-limit [1] on
Ivybridge Mobile GT2 0x0166 with Google Chrome R38.

Regression introduced by

    commit 6c04423153
    Author: Kenneth Graunke <kenneth@whitecape.org>
    Date:   Sun Feb 2 02:58:42 2014 -0800

        i965: Bump GL_MAX_CUBE_MAP_TEXTURE_SIZE to 8192.

The test regressed because the pointer offset arithmetic in
intel_miptree_map_gtt() overflows for large textures. The pointer
arithmetic is not 64-bit safe.

[1] 52f0dc240f/sdk/tests/conformance/textures/texture-size-limit.html

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=78770
Fixes: Intel CHRMOS-1377
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Ian Romanic <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit b69c7c5dac)
2014-11-19 18:58:22 +00:00
Dave Airlie
aab3758916 r600g: limit texture offset application to specific types (v2)
For 1D and 2D arrays we don't want the other coordinates being
offset and affecting where we sample. I wrote this patch 6 months
ago but lost it.

Fixes:
./bin/tex-miplevel-selection textureLodOffset 1DArray
./bin/tex-miplevel-selection textureLodOffset 2DArray
./bin/tex-miplevel-selection textureOffset 1DArray
./bin/tex-miplevel-selection textureOffset 1DArrayShadow
./bin/tex-miplevel-selection textureOffset 2DArray
./bin/tex-miplevel-selection textureOffset(bias) 1DArray
./bin/tex-miplevel-selection textureOffset(bias) 2DArray

v2: rewrite to handle more cases and be consistent with code
above.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 1830138cc0)
2014-11-19 00:53:30 +00:00
Dave Airlie
be24d54195 r600g: geom shaders: always load texture src regs from inputs
Otherwise we seem to lose the split_gs_inputs and try and
pull from an uninitialised register.

fixes 9 texelFetch geom shader tests.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d4c342f67e)
2014-11-19 00:53:23 +00:00
Marek Olšák
8751abf752 radeonsi: support per-sample gl_FragCoord
Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit da2dea3843)
2014-11-19 00:53:14 +00:00
Ilia Mirkin
da7475f35f st/mesa: add a fallback for clear_with_quad when no vs_layer
Not all drivers can set gl_Layer from VS. Add a fallback that passes the
instance id from VS to GS, and then uses the GS to set the layer.

Tested by adding

  quad_buffers |= clear_buffers;
  clear_buffers = 0;

to the st_Clear logic, and forcing set_vertex_shader_layered in all
cases. No piglit regressions (on piglits with 'clear' in the name).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68db29c434)
2014-11-19 00:53:08 +00:00
Dave Airlie
7b62f0eb50 r600g/cayman: handle empty vertex shaders
Some of the geom shader tests produce an empty vertex shader,
on cayman we'd crash in the finaliser because last_cf was NULL.

cayman doesn't need the NOP workaround, so if the code arrives
here with no last_cf, just emit an END.

fixes crashes in a bunch of piglit geom shader tests.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 4e520101e6)
2014-11-19 00:53:00 +00:00
Dave Airlie
fa62619da5 r600g/cayman: fix texture gather tests
It appears on cayman the TG4 outputs were reordered.

This fixes a lot of piglit tests.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 27e1e0e710)
2014-11-19 00:52:52 +00:00
Dave Airlie
2e3d2035cf r600g/cayman: fix integer multiplication output overwrite (v2)
This fixes tests/spec/glsl-1.10/execution/fs-op-assign-mult-ivec2-ivec2-overwrite.shader_test.

hopeful fix for fd.o bug 85376

Reported-by: ghallberg
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 4a128d5a16)
2014-11-19 00:52:44 +00:00
Brian Paul
edb2186671 st/mesa: copy sampler_array_size field when copying instructions
The sampler_array_size field was added by "mesa/st: add support for
dynamic sampler offsets".  But the field wasn't getting copied in
the get_pixel_transfer_visitor() or get_bitmap_visitor() functions.

The count_resources() function then didn't properly compute the
glsl_to_tgsi_visitor::samplers_used bitmask.  Then, we didn't declare
all the sampler registers in st_translate_program().  Finally, we
asserted when we tried to emit a tgsi ureg src register with File =
TGSI_FILE_UNDEFINED.

Add the missing assignments and some new assertions to catch the
invalid register sooner.

Cc: "10.3, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 11abd7b2bc)
2014-11-19 00:52:36 +00:00
Michel Dänzer
5a2ff2002b radeonsi: Disable asynchronous DMA except for PIPE_BUFFER
Using the asynchronous DMA engine for multi-dimensional operations seems
to cause random GPU lockups for various people. While the root cause for
this might need to be fixed in the kernel, let's disable it for now.

Before re-enabling this, please make sure you can hit all newly enabled
paths in your testing, preferably with both piglit and real world apps,
and get in touch with people on the bug reports below for stability
testing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85647
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83500
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
(cherry picked from commit ae4536b4f7)
2014-11-19 00:51:57 +00:00
Vinson Lee
0a3c146723 scons: Require glproto >= 1.4.13 for X11.
GLXBadProfileARB and X_GLXCreateContextAtrribsARB require glproto >=
1.4.13. These symbols were added in commit
d5d41112cb "st/xlib: Generate errors as
specified."

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 876c53375e)
2014-11-19 00:51:50 +00:00
Emil Velikov
6452e24ebc configure.ac: roll up a program for the sse4.1 check
So when checking/building sse code we have three possibilities:
 1 Old compiler, throws an error when using -msse*
 2 New compiler, user disables sse* (-mno-sse*)
 3 New compiler, user doesn't disable sse

The original code, added code for #1 but not #2. Later on we patched
around the lack of handling #2 by wrapping the code in __SSE4_1__.
Yet it lead to a missing/undefined symbol in case of #1 or #2, which
might cause an issue for #2 when using the i965 driver.

A bit later we "fixed" the undefined symbol by using #1, rather than
updating it to handle #2. With this commit we set things straight :)

To top it all up, conventions state that in case of conflicting
(-enable-foo -disable-foo) options, the latter one takes precedence.
Thus we need to make sure to prepend -msse4.1 to CFLAGS in our test.

v2: Clean the #includes. Suggested by Ilia, Matt & Siavash.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Tested-by: Siavash Eliasi <siavashserver@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1a6ae84041)
2014-11-19 00:51:44 +00:00
Ilia Mirkin
4186c1c7b1 nv50,nvc0: use clip_halfz setting when creating rasterizer state
This enables the ARB_clip_control extension.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3bc42a09e2)
2014-11-19 00:51:38 +00:00
Emil Velikov
d133096d26 Increment version to 10.4.0-rc1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-18 02:30:18 +00:00
Axel Davy
01c9bf999e nine: Implement threadpool
DRI_PRIME setups have different issues due the lack of dma-buf fences
support in the drivers. For DRI3 DRI_PRIME, a race can appear, making
tearings visible, or worse showing older content than expected. Until
dma-buf fences are well supported (and by all drivers), an alternative
is to send the buffers to the server only when rendering has finished.
Since waiting the rendering has finished in the main thread has a
performance impact, this patch uses an additional thread to offload the
wait and the sending of the buffers to the server.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 7f565845a1)
2014-11-18 02:30:18 +00:00
Axel Davy
df63e76c2c nine: Add drirc options (v2)
Implements vblank_mode and throttling, which  allows us change default ratio
between framerate and input lag.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 948e6c5228)
2014-11-18 02:30:18 +00:00
Joakim Sindholt
b46e80ae60 nine: Add state tracker nine for Direct3D9 (v3)
Work of Joakim Sindholt (zhasha) and Christoph Bumiller (chrisbmr).
DRI3 port done by Axel Davy (mannerov).

v2: - nine_debug.c: klass extended from 32 chars to 96 (for sure) by glennk
    - Nine improvements by Axel Davy (which also fixed some wine tests)
    - by Emil Velikov:
     - convert to static/shared drivers
     - Sort and cleanup the includes
     - Use AM_CPPFLAGS for the defines
     - Add the linker garbage collector
     - Restrict the exported symbols (think llvm)

v3: - small nine fixes
    - build system improvements by Emil Velikov

v4: [Emil Velikov]
   - Do no link against libudev. No longer needed.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit fdd96578ef)
[Emil Velikov: use correct ureg_property* functions]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-18 02:29:26 +00:00
Christoph Bumiller
ff97fbd9e9 gallium/auxiliary: add contained and rect checks (v6)
v3: thanks to Brian, improved coding style, also glennk helped spot few
things (unsigned -> int, two constify)
v4: thanks Ilia improved function, dropped u_box_clip_3d
v5: incorporated rest of Gregor proposed changes,clean ups
v6: u_box_clip_2d simplify proposed by Ilia Mirkin

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 7d2573b537)
2014-11-18 02:23:12 +00:00
Christoph Bumiller
504d73f342 gallium/auxiliary: add inc and dec alternative with return (v4)
At this moment we use only zero or positive values.

v2: Implement it for also for Solaris, MSVC assembly
    and enable for other combinations.

v3: Replace MSVC assembly by assert + warning during compilation

v4: remove inc and dec with return for MSVC assembly

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit cb49132166)
2014-11-18 02:23:11 +00:00
Christoph Bumiller
7bbf0836c8 gallium/auxiliary: implement sw_probe_wrapped (v2)
Implement pipe_loader_sw_probe_wrapped which allows to use the wrapped
software renderer backend when using the pipe loader.

v2: - remove unneeded ifdef
    - use GALLIUM_PIPE_LOADER_WINSYS_LIBS
    - check for CALLOC_STRUCT
    thanks to Emil Velikov

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit e23d63cffd)
2014-11-18 02:23:10 +00:00
Christoph Bumiller
8d6963f005 winsys/sw/wrapper: implement is_displaytarget_format_supported for swrast
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 8314315dff)
2014-11-18 02:23:08 +00:00
Christoph Bumiller
50e6b471c5 tgsi/ureg: add ureg_UARL shortcut (v2)
v2: moved in in same order as in p_shader_tokens (thanks Brian)

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit 259ec77db9)
2014-11-18 02:23:05 +00:00
Kristian Høgsberg
a4ffc2a445 i965: Move fs_visitor ra pass to new fs_visitor::allocate_registers()
This will be reused for the scalar VS pass.

v2 (Ken): Rebase on master.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-14 19:38:08 -08:00
Kristian Høgsberg
c50f2dadc5 i965: Move fs_visitor optimization pass into new method fs_visitor::optimize()
We'll reuse this toplevel optimization driver for the scalar VS.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-14 19:38:06 -08:00
Kristian Høgsberg
5c4efc644e i965: Move more code into codegen-branch of the fs_visitor::run() if statement
These last few operations all only apply when we've actually generated
code, optimized and allocated registers.  The dummy and the repclear
shaders don't need the gen4 send workaround, and don't spill.  This
means we can move these lines into the else-branch, which will make
the following refactoring easier.

v2 (Ken): Rebase on master, which removed the uncompressed stack.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-14 19:38:05 -08:00
Kristian Høgsberg
f2bb655ac7 i965: Refactor fs_generator API
We split out SIMD8 and SIMD16 generation into seperate calls to
new method generate_code(), which returns the start offset for the
generated code.  A new get_assembly() method returns the generated code.

This avoids asserting MESA_SHADER_FRAGMENT and accessing wm_prog_data
in the generator.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-14 19:38:03 -08:00
José Fonseca
13849f327c st/wgl: Implement WGL_EXT_create_context_es/es2_profile.
Derived from st/glx's GLX_EXT_create_context_es/es2_profile implementation.

Tested with an OpenGL ES 2.0 ApiTrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-11-14 23:29:59 +00:00
José Fonseca
d5d41112cb st/xlib: Generate errors as specified.
Tested with piglit glx tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-11-14 23:29:59 +00:00
Rob Clark
82103206fe freedreno/ir3: move some helpers
Split out a few helpers from fd3_program so we don't have to duplicate
for fd4_program.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-14 13:59:54 -05:00
Rob Clark
e091c08089 freedreno: rename draw->draw_vbo
Gets rid of a namespace conflict w/ a4xx which wants an fd4_draw()
version of fd_draw()..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-14 13:59:31 -05:00
Rob Clark
2f024d2b10 freedreno/a3xx: missing u_upload_destroy
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-14 12:07:57 -05:00
Rob Clark
28b2269ee0 freedreno: fix borked check for a320.0
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-14 12:07:39 -05:00
Rob Clark
8b898c1174 freedreno/ir3: half vs full reg in standalone compiler output
Handle hrN.c in printing outputs/inputs.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-14 12:02:43 -05:00
José Fonseca
7037793f6b st/dri: Support EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR/GLX_CONTEXT_DEBUG_BIT_ARB on ES contexts.
The latest version of the specs explicitly allow it, and given that Mesa
universally supports KHR_debug we should definitely support it.

Totally untested.  (Just happened to noticed this while implementing
GLX_EXT_create_context_es2_profile for st/xlib.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-11-14 16:10:22 +00:00
Marek Olšák
363b53f000 egl: remove egl_gallium from the loader
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Informally acked-by: Jose Fonseca
2014-11-14 16:16:12 +01:00
Marek Olšák
c46c551c56 configure.ac: remove enable flags for EGL and GBM Gallium state trackers
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Informally acked-by: Jose Fonseca
2014-11-14 16:16:12 +01:00
Kenneth Graunke
bd20fad316 i965/vec4: Combine all the math emitters.
17 insertions(+), 102 deletions(-).  Works just as well.

v2: Make emit_math take const references (suggested by Matt),
    drop redundant WRITEMASK_XYZW setting (Matt and Curro).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-11-13 20:55:41 -08:00
Kenneth Graunke
dba683cf16 i965/vec4: Use const references in emit() functions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-11-13 20:55:41 -08:00
Kenneth Graunke
0efc53a96c i965: Use macros to create prototypes for emitter helpers.
We do this almost everywhere else; this should make it easier to modify.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-11-13 20:55:41 -08:00
Ben Widawsky
f14a35f9dc i965: Always enable VF statistics
Every other unit in the geometry pipeline automatically enables
statistics gathering. This part of the pipe has been controlled by the
DEBUG_STATS variable, but this is asymmetric. This dates back to the
original implementation, and I am not sure if there is a reason for it.

I need access to these stats to implement ARB_pipeline_statistics_query.

Eric wrote it, and Ken touched it last. Do you have any opposition?

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86145
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-11-13 10:48:24 -08:00
Ville Syrjälä
0d924738d9 i915: Emit 3DSTATE_SCISSOR_RECTANGLE_0 before 3DSTATE_SCISSOR_ENABLE
According to gen2 BSpec the pipeline must be flushed at least up to the
windower before changing the scissor rect enable field. Emitting the
3DSTATE_SCISSOR_RECTANGLE_0 before 3DSTATE_SCISSOR_ENABLE is sufficient
to do that.

gen3 BSpec no longer has that piece of text, but let's make the same
change there too for symmetry. The spec does still say that the scissor
rectangle must be defined before enabling it, so the new order does seem
more in line with the spec.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
81c31e560f i915: Don't call _mesa_meta_glsl_Clear() on gen2
Gen2 doesn't have fragment shaders so we shouldn't be calling
_mesa_meta_glsl_Clear() on gen2. Restore the appropriate
ARB_fragment_shader check to the clear path which was lost in:

 commit 94f22fbe78
 Author: Tapani Pälli <tapani.palli@intel.com>
 Date:   Wed Aug 8 20:46:45 2012 +0300

    intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2

v2: Fix spelling in commit message

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
4747b2638c i915: Protect macro argument for TEXTURE_SET()
TEXTURE_SET() is the only register macro that forgets to wrap the
argument evaluation in parens. Only simple integers are passed to this
macro so there's no bug but sitll it seems prudent to add the
parens.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
3746ff89bc i915: Kill intel_context::hw_stencil
ctx.hw_stencil is not used anywhere so kill it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
dafae910d4 i915: Accept GL_DEPTH_STENCIL GL_DEPTH_COMPONENT formats for renderbuffers
Gen2 doesn't support depth/stencil textures, and since

 commit c1d4d49993
 Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
 Date:   Thu Apr 24 14:11:43 2014 +0300

    i915: Don't advertise Z formats in TextureFormatSupported on gen2

depth/stencil formats are no longer accepted as texture formats.
However we still want depth/stencil renderbuffers, so add explicit
format checks to intel_alloc_renderbuffer_storage() to allow such
things.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
a071425817 i915: Override mip filter to nearest with aniso
gen2 doesn't supporte linear mip filter with anisotropic min/mag
filtering. The hardware would automagically downgrade the min/mag
filters to linear in such cases, which IMO looks worse than forcing
the mip filter to nearest.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
40a08e0d6a i915: Use L8A8 instead of I8 to simulate A8 on gen2
Gen2 doesn't support the A8 texture format. Currently the driver
substitutes it with I8, but that results in incorrect RGB values.
Use A8L8 instead. We end up wasting a bit of memory, but at least
we should get the correct results.

v2: Handle the fallback in _mesa_choose_tex_format() and also
    do it for all alpha formats that currently accept A8

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72819
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80050
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38873
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Ville Syrjälä
7988ff2fd1 i915: Fix GL_DOT3_RGBA a bit
The spec says using DOT4 for alpha is undefined unless DOT4 is also used
for color. It seems to do the right thing anyway, but better safe than sorry.

Also override numAlphaArgs to 2 for DOT4 since that's what it wants.
This migth fix something in case the specified alpha mode has only one
argument. Also avoids emitting a needless 3DSTATE_MAP_BLEND_ARG if
the specified alpha mode has three arguments.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13 19:13:27 +02:00
Neil Roberts
352f8f2d13 linker: Add a missing space in an error message
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-11-13 16:46:12 +00:00
José Fonseca
d5b1731178 llvmpipe: Call pipe_thread_wait() on Linux.
To address http://lists.freedesktop.org/archives/mesa-dev/2014-November/070569.html

In short, revert 706ad3b649 for non-Windows
OSes.
2014-11-13 15:01:19 +00:00
Kenneth Graunke
2b6e703863 i915g: we also have more than 0 viewports!
See 546d6c8d for the corresponding fix in freedreno.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Stephane Marchesin <stephane.marchesin@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-11-12 20:59:28 -08:00
Eric Anholt
b3d269f5ae vc4: Avoid reusing a pointer from c->outputs[] after add_output().
add_output() can resize the qreg array, so we might use a stale pointer.
2014-11-12 18:24:10 -08:00
Eric Anholt
acc1cca7ae vc4: Fix assumption of TGSI OUT[0] being POSITION in the VS.
All the shaders we've received so far had this be the case, but with
nir-to-tgsi that changed.

I might decide to make nir-to-tgsi keep the outputs in the same order, for
debugging sanity, but I'm not sure.
2014-11-12 18:23:40 -08:00
Ilia Mirkin
22543dd8a1 nvc0: remove unused mm_VRAM_fe0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-11-12 15:24:15 -05:00
José Fonseca
9247509a8d st/glx: Implement GLX_EXT_create_context_es2_profile.
apitrace now supports it, and it makes it much easier to test
tracing/replaying on OpenGL ES contexts since
GLX_EXT_create_context_{es2,es}_profile are widely available.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-11-12 19:03:50 +00:00
Tom Stellard
0cae7ea271 Revert "clover: Fix build after llvm r221375"
This reverts commit cd93d82ba9.

llvm r221375 was reverted, so this commit needs to be too.
2014-11-12 12:30:08 -05:00
José Fonseca
977b18e486 gallivm: Fix build with LLVM 3.6 (r221751).
Tested with LLVM 3.3, 3.4, 3.5, and 3.6.

Trivial.
2014-11-12 11:08:07 +00:00
Matt Turner
7a82961b71 i965/cfg: Remove if_block/else_block.
I used these in the SEL peephole, but they require extra tracking and
fix ups. The SEL peephole can pretty easily find the blocks it needs
without these.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-11 09:41:06 -08:00
Matt Turner
4001181ba3 i965/fs: Don't use if_block/else_block in SEL peephole.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-11 09:41:06 -08:00
Chia-I Wu
20a061d2b4 ilo: clean up gen6_3DSTATE_SF()
Make the helpers fill out valid Gen7 3DSTATE_SF and 3STATE_SBE.  This
prevents the helpers from having to do

  dw[0] = GEN7_SBE_DW1_x; // setting DW1 value to dw[0]!?

and simplifies gen7_3DSTATE_{SF,SBE}().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 16:04:18 +08:00
Chia-I Wu
239dca78b1 ilo: clean up gen7_3DSTATE_STREAMOUT()
Render stream and render enable are independent from so enable.  Having a
single return point makes it easier to see that.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:26 +08:00
Chia-I Wu
eab595d573 ilo: rework gen7_3DSTATE_SO_DECL_LIST()
Started to make pipe_stream_output_info mandatory, but ended up adding support
for stream id and making a workaround Gen7-specific.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:26 +08:00
Chia-I Wu
c637075ea2 ilo: add 3DSTATE_SO_BUFFER variants
Add gen7_disable_3DSTATE_SO_BUFFER() to disable SO buffers.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:25 +08:00
Chia-I Wu
2ff88ce4be ilo: add gen6_3dstate_constant()
It replaces gen6_fill_3dstate_constant().  gen6_3DSTATE_CONSTANT_{VS,GS,PS}
are made wrappers of the new function.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:25 +08:00
Chia-I Wu
31372f2d2c ilo: add variants of 3DSTATE_{HS,DS}
Rename them to gen7_disable_3DSTATE_{HS,DS}() to reflect the fact.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:25 +08:00
Chia-I Wu
421b565b3b ilo: add variants of 3DSTATE_GS
Add gen6_so_3DSTATE_GS(), gen6_disable_3DSTATE_GS(), and
gen7_disable_3DSTATE_GS() to do SO on GEN6 or to disable GS.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:52:22 +08:00
Chia-I Wu
63ded78e1c ilo: add variants of 3DSTATE_VS
Add gen6_disable_3DSTATE_VS() to disable VS.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:51:36 +08:00
Chia-I Wu
9087239df8 ilo: add variants of 3DSTATE_PS
Add gen7_disable_3DSTATE_PS() to disable PS.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:51:31 +08:00
Chia-I Wu
8ebb86325b ilo: add variants of 3DSTATE_WM
Add gen6_hiz_3DSTATE_WM() and gen7_hiz_3DSTATE_WM() for HiZ ops without
dispatching.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:51:28 +08:00
Chia-I Wu
703ae84ac2 ilo: add variants of 3DSTATE_CLIP
Add gen6_disable_3DSTATE_CLIP to disable clipping.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 13:51:21 +08:00
Chia-I Wu
8abf4976c6 ilo: prefix 3DSTATE_VF with gen75
3DSTATE_VF is Gen7.5+ only.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-11 09:11:56 +08:00
Michael Varga
9d6253cf82 st/va: MPEG4 call vlVaDecoderFixMPEG4Startcode()
If the VOP and GOV headers were truncated they will be regenerated.

Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Michael Varga
d335f5ffa6 st/va: MPEG4 generate GOV and VOP header
Also, Implemented a small locally used interface for writing bits to a buffer.

Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Michael Varga
fa9e461967 st/va: MPEG4 populate the SPS structure
Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Michael Varga
92350a65c4 st/va: MPEG4 populate the iq matrix buffers
Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Michael Varga
9f1ee1b5c9 st/va: MPEG4 populate the PPS structure
Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Michael Varga
c24ee2cf43 st/va: refactored handleVASliceDataBufferType
This patch cleans the function handleVASliceDataBufferType() for better
readability.

Signed-off-by: Michael Varga <Michael.Varga@amd.com>
2014-11-10 10:24:07 -05:00
Ian Romanick
46a2323c3f mesa: Remove _mesa_max_buffer_index
It appears to be completely unused since f9be8543 (February 2012).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-10 05:38:03 -08:00
Ian Romanick
8e4a6481e8 mesa: Uniform logging is very, very unlikely
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:40 -08:00
Ian Romanick
9cdf66657a glsl: Swap the order of glsl_type::name and ::length
On x86-64 this saves 8 bytes of padding in the structure, and this
reduces the size of the structure to 32 bytes.

v2: Fix constructor so that GCC won't warn about the order of
initialization.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:40 -08:00
Ian Romanick
3711abd780 glsl: Store glsl_type::vector_elements and ::matrix_columns as uint8_t
Due to the total number of bits used in the bitfield, this does not
increase the size of the structure.

It does, however, reduce the number of instructions required each time
one of these fields is accessed.  To access ::matrix_columns with the
bitfield, three instructions were required:

    movzbl 0x9(%rdx),%eax
    shr    %al
    and    $0x7,%eax

As a uint8_t, only one instruction is required.

    movzbl 0xa(%rdx),%eax

These fields are accessed *a lot*.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (64-bit):       48,103,497       16,556,096          676,447
After  (64-bit):       45,722,616       15,737,964          670,607

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (32-bit):       61,472,611       21,051,222          821,361
After  (32-bit):       57,987,421       19,872,226          811,609

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:40 -08:00
Ian Romanick
378d92c74e mesa: Don't check for API_OPENGLES in _mesa_uniform_matrix
There are no uniforms in OpenGL ES 1.x, so we can't even get to this
code in that API.

Also, reorder the checks.  First check that transpose is true, then
check whether or not that is legal in the current API.  transpose should
never be true in an ES2 context, so this gets one check (the more
expensive one) out of the main path.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_UniformMatrix4fv  _mesa_UniformMatrix3fv
Before (64-bit):             96,119,025              24,240,510
After  (64-bit):             90,726,569              22,926,662

                 _mesa_UniformMatrix4fv  _mesa_UniformMatrix3fv
Before (32-bit):            132,434,452              29,051,808
After  (32-bit):            126,658,112              27,989,316

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:40 -08:00
Ian Romanick
91a2fa1490 mesa: Rework array error checks in validate_uniform_parameters
Before ARB_explicit_uniform_location, Mesa's location encoding allowed
locations for non-array types that had non-zero array indices.
Basically, part of the location was the uniform and part was the array
index.  This meant that some checks had to occur for arrays and
non-arrays.  This is no longer possible, we the checks can be split up.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (64-bit):       50,499,557      17,487,316           686,227
After  (64-bit):       50,023,791      17,274,432           684,293

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (32-bit):       62,968,039       21,732,380          828,147
After  (32-bit):       62,373,967       21,490,756          826,223

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:40 -08:00
Ian Romanick
366540e9af mesa: Get some gl_shader_program::LinkStatus checking out of the main path
I really wanted to remove 'shProg != NULL' as well, but that would have
required adding a dummy program as the default program.  That seemed
like more churn than removing one test was worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:39 -08:00
Ian Romanick
3f5ebb98b7 mesa: Rework location == -1 error checking
Only one caller wanted to generate an error when location == -1, so move
the error generation to that caller.  There will be more callers in the
future that do not want to generate errors.

Move the location == -1 check later in validate_uniform_parameters.  As
currently implemented, glUniform1iv(-1, -1, data) would not generate an
error, but it should due to count being < 0.

The location that I have moved it to will make more sense with the next
commit.

Valgrind callgrind results for a trace of Tesseract:

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (64-bit):       51,241,217      17,740,162           689,181
After  (64-bit):       50,499,557      17,487,316           686,227

                 _mesa_Uniform4fv  _mesa_Uniform4f  _mesa_Uniform1i
Before (32-bit):       63,940,605       21,987,918          831,065
After  (32-bit):       62,968,039       21,732,380          828,147

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:39 -08:00
Ian Romanick
23dcbf623f mesa: Minor clean ups in _mesa_uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:39 -08:00
Ian Romanick
9c38d4db52 mesa: Remove GLSL_TYPE_SAMPLER check
Noting the assertion just a few lines earlier, returnType cannot be
GLSL_TYPE_SAMPLER.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:39 -08:00
Ian Romanick
5b9cf337b4 mesa/main: Pass the data that _mesa_uniform actually wants
The GL_ enums were previously used because glsl_types.h couldn't be used
in C code.  That was fixed some time ago (and uniforms.c already
includes glsl_types.h), so this is no longer necessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-11-10 04:25:39 -08:00
Chia-I Wu
d388d8576f ilo: derive fb blending caps at bind time
Derive whether a RT supports blending, logicop, and the like when
set_framebuffer_state() is called.  This enables us to simplify
gen6_BLEND_STATE().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-10 15:46:31 +08:00
Chia-I Wu
55d70e0669 ilo: remove inlined state functions
We had some inlined state functions for dispatching.  They were not needed
with the new top/bottom split.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-10 15:46:19 +08:00
Chia-I Wu
c88c49baf4 ilo: use top/bottom split for state functions
Follow the builder and split state functions into top (vertex processing) and
bottom (pixel processing).

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-10 13:14:04 +08:00
Kenneth Graunke
f3b709c0ac i965: Advertise a line width of 40.0 on Cherryview and Skylake.
According to the documentation, line widths higher than 40.0 may have
quality problems.  That's already 20 times larger than we've been
exposing, so it seems totally sufficient.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-11-08 22:24:08 -08:00
Kenneth Graunke
6dab04d7e3 i965: Advertise larger line widths.
We've artificially been limiting this to 5 for no particular reason.

On Gen4-5, the limit is [0, 7.5] with a granularity of 0.5 (U3.1).
On Gen6+, the limit is [0, 7.9921875].  Since it's a U3.7, the
granularity should be 0.125 (1/8).

This patch conservatively advertises one granularity smaller than the
hardware's maximum value, just in case there's a problem using the
largest possible value.  On Gen4-5, this is 7.5 - 0.5 = 7.0.  On Gen6+,
this is 8.0 - 0.125 = 7.875.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-11-08 22:22:54 -08:00
Kenneth Graunke
61838fd9ad i965: Use ctx->Const.MaxLineWidth when clamping ctx->Line.Width.
Rather than hardcoding platform values in every code path, just use the
maximum value we set.

Currently, ctx->Const.LineWidth == 5, which is smaller than the hardware
limit.  But applications shouldn't be using a value larger than we
support anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-11-08 22:22:53 -08:00
Kenneth Graunke
87927ed1f0 i965: Set Line Width correctly on Cherryview and Skylake.
Line Width moved to DW1 bits 29:12.  It's actually now a U11.7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-11-08 22:22:18 -08:00
Emil Velikov
a6d8413d7c docs: add news item and link release notes for mesa 10.3.3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-08 17:22:15 +00:00
Emil Velikov
caa0fb4709 docs: Add sha256 sums for the 10.3.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9cc26056ee)
2014-11-08 17:22:15 +00:00
Emil Velikov
0d5da6d9a8 Add release notes for the 10.3.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1a9cc5f50d)
2014-11-08 17:22:15 +00:00
José Fonseca
b238c756da util/format: Fix clamping to 32bit integers.
Use clamping constants that guarantee no integer overflows.

As spotted by Chris Forbes.

This causes the code to change as:

-         value |= (uint32_t)CLAMP(src[0], 0.0f, 4294967295.0f);
+         value |= (uint32_t)CLAMP(src[0], 0.0f, 4294967040.0f);

-         value |= (uint32_t)((int32_t)CLAMP(src[0], -2147483648.0f, 2147483647.0f));
+         value |= (uint32_t)((int32_t)CLAMP(src[0], -2147483648.0f, 2147483520.0f));

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-11-08 10:32:39 +00:00
José Fonseca
d268eac3a9 util/format: Generate floating point constants for clamping.
This commit causes the generated C code to change as

            union util_format_r32g32b32a32_sscaled pixel;
  -         pixel.chan.r = (int32_t)CLAMP(src[0], -2147483648, 2147483647);
  -         pixel.chan.g = (int32_t)CLAMP(src[1], -2147483648, 2147483647);
  -         pixel.chan.b = (int32_t)CLAMP(src[2], -2147483648, 2147483647);
  -         pixel.chan.a = (int32_t)CLAMP(src[3], -2147483648, 2147483647);
  +         pixel.chan.r = (int32_t)CLAMP(src[0], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.g = (int32_t)CLAMP(src[1], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.b = (int32_t)CLAMP(src[2], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.a = (int32_t)CLAMP(src[3], -2147483648.0f, 2147483647.0f);
            memcpy(dst, &pixel, sizeof pixel);

which surprisingly makes a difference for MSVC.

Thanks to Juraj Svec for diagnosing this and drafting a fix.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29661
2014-11-08 10:32:39 +00:00
Vinson Lee
42443339f1 glsl/list: Revert unintentional file mode change in previous commit.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-11-07 21:04:08 -08:00
Vinson Lee
f9fc3949e1 glsl/list: Move declaration before code.
Fixes MSVC build error.

shaderapi.c
src\glsl\list.h(535) : error C2143: syntax error : missing ';' before 'type'
src\glsl\list.h(535) : error C2143: syntax error : missing ')' before 'type'
src\glsl\list.h(536) : error C2065: 'node' : undeclared identifier

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86025
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-11-07 15:36:26 -08:00
Jason Ekstrand
0c36aac832 glsl/list: Add an exec_list_validate function
This can be very useful for trying to debug list corruptions.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-07 14:53:40 -08:00
José Fonseca
706ad3b649 llvmpipe: Avoid deadlock when unloading opengl32.dll
On Windows, DllMain calls and thread creation/destruction are
serialized, so when llvmpipe is destroyed from DllMain waiting for the
rasterizer threads to finish will deadlock.

So, instead of waiting for rasterizer threads to have finished, simply wait for the
rasterizer threads to notify they are just about to finish.

Verified with this very simple program:

   #include <windows.h>
   int main() {
      HMODULE hModule = LoadLibraryA("opengl32.dll");
      FreeLibrary(hModule);
   }

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

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
2014-11-07 21:00:06 +00:00
José Fonseca
edb7b1c566 docs: Update minimum required LLVM version. 2014-11-07 21:00:06 +00:00
Emil Velikov
21925ec3fc i965: drop the custom gen8_instruction CFLAG
No longer needed as the file was removed with
commit 8c229d306b
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Aug 11 10:07:07 2014 -0700

    i965: Delete the Gen8 code generators.

    We now use the brw_eu_emit.c code instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-07 18:32:17 +00:00
Emil Velikov
f6432c4d72 gbm/dri: cleanup memory leak on teardown
During teardown we free the driver_configs list pointer, but we forget
to deallocate each config in that list.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-07 18:32:07 +00:00
Emil Velikov
8ed08e69bc egl_dri2: add a note about dri2_create_screen
The function is not called by platform_drm. As such one needs to
pay special attention at teardown.

v2: Fix the comment block. Spotted by Ken.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-11-07 18:31:23 +00:00
Emil Velikov
38cec0303b egl_dri2: fix double free on drm platforms
Earlier commit failed to attribure that for drm platforms one does not
call dri2_create_screen, thus it does not create the screen and
driver_configs but inherits them from the "display" - gbm.

As such wrap cleanup in Platform != _EGL_PLATFORM_DRM to prevent
the issue and still cleanup correctly for non-drm platforms.

v2:
 - Drop the ifdef HAVE_DRM_PLATFORM, reindent the code and fix the
comment block. Suggested by Ken.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-11-07 18:29:08 +00:00
Chia-I Wu
9a0a4d67a9 ilo: tidy up message descriptor decoding
Move opcode to string mappings to functions of their own.  Have for consistent
outputs for similar opcodes.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-07 23:34:56 +08:00
Chia-I Wu
d3c5976a3b ilo: decode INTERFACE_DESCRIPTOR_DATA
This is at least much better than decoding as blobs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-07 23:33:21 +08:00
Matt Turner
58a54091a9 i965/fs: Wire up control flow correctly in predicated break pass.
When the earlier block ended with control flow, we'd mistakenly remove
some of its links to its children. The same happened with the later
block.

Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-06 16:37:56 -08:00
Matt Turner
f0cfc4fca0 i965/cfg: Add functions to get first and last non-CF instructions.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-06 16:37:56 -08:00
Kenneth Graunke
a16ca4ac6a glsl: Skip loop-too-large heuristic if indexing arrays of a certain size
A pattern in certain shaders is:

   uniform vec4 colors[NUM_LIGHTS];

   for (int i = 0; i < NUM_LIGHTS; i++) {
      ...use colors[i]...
   }

In this case, the application author expects the shader compiler to
unroll the loop.  By doing so, it replaces variable indexing of the
array with constant indexing, which is more efficient.

This patch extends the heuristic to see if arrays accessed within the
loop are indexed by an induction variable, and if the array size exactly
matches the number of loop iterations.  If so, the application author
probably intended us to unroll it.  If not, we rely on the existing
loop-too-large heuristic.

Improves performance in a phong shading microbenchmark by 2.88x, and a
shadow mapping microbenchmark by 1.63x.  Without variable indexing, we
can upload the small uniform arrays as push constants instead of pull
constants, avoiding shader memory access.  Affects several games, but
doesn't appear to impact their performance.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
2014-11-06 16:30:47 -08:00
Kenneth Graunke
4f22db5fbb glsl: Lower constant arrays to uniform arrays.
Consider GLSL code such as:

   const ivec2 offsets[] =
      ivec2[](ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1),
              ivec2(0, -1),  ivec2(0, 0),  ivec2(0, 1),
              ivec2(1, -1),  ivec2(1, 0),  ivec2(1, 1));

   ivec2 offset = offsets[<non-constant expression>];

Both i965 and nv50 currently handle this very poorly.  On i965, this
becomes a pile of MOVs to load the immediate constants into registers,
a pile of scratch writes to move the whole array to memory, and one
scratch read to actually access the value - effectively the same as if
it were a non-constant array.

We'd much rather upload large blocks of constant data as uniform data,
so drivers can simply upload the data via constbufs, and not have to
populate it via shader instructions.

This is currently non-optional because both i965 and nouveau benefit
from it, and according to Marek radeonsi would benefit today as well.
(According to Tom, radeonsi may want to handle this itself in the long
term, but we can always add a flag when it becomes useful.)

Improves performance in a terrain rendering microbenchmark by about 2x,
and cuts the number of instructions in about half.  Helps a lot of
"Natural Selection 2" shaders, as well as one "HOARD" shader.

total instructions in shared programs: 5473459 -> 5471765 (-0.03%)
instructions in affected programs:     5880 -> 4186 (-28.81%)

v2: Use ir_var_hidden to avoid exposing the new uniform via the GL
    uniform introspection API.

v3: Alphabetize Makefile.sources properly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77957
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-06 16:20:01 -08:00
Kenneth Graunke
0c0bfb2ead glsl: Add infrastructure for "hidden" uniforms.
In the compiler, we'd like to generate implicit uniforms for internal
use.  These should not be visible via the GL uniform introspection API.

To support that, we add a new ir_variable::how_declared value of
ir_var_hidden, and plumb that through to gl_uniform_storage.

v2 (idr): Fix some memory management issues in
move_hidden_uniforms_to_end.  The comment block on the function has more
details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-11-06 16:20:01 -08:00
Timothy Arceri
1378617218 mesa: Add SSE 4.1 optimisation for glDrawElements.
Makes use of SSE 4.1 to speed up compute of min and max elements.

Callgrind cpu usage results from pts benchmarks:

Openarena 0.8.8: 3.67% -> 1.03%
UrbanTerror: 2.36% -> 0.81%

V5:
- actually make use of the optimisation in android (Emil Velikov)
- set a better array size limit for using SSE and added TODO

V4:
- fixed bugs with incrementing pointer and updating counters

V3:
- Removed sse_minmax.c from Makefile.sources
- handle the first few values without SSE until the pointer is aligned
 and use _mm_load_si128 rather than _mm_loadu_si128
- guard the call to the SSE code better at build time

V2:
- removed GL* types
- use _mm_store_si128() rather than _mm_store_ps()
- add runtime check for SSE
- use aligned attribute for local mix/max
- bunch of tidyups

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-11-06 11:39:59 -08:00
Matt Turner
9557cf7d0d i965: Remove non-existent vertical strides from array.
These never existed, as far as I can tell.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-06 11:11:37 -08:00
Matt Turner
cc3b028a4f i965: Convert stride/width/execution size macros into enums.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-06 11:11:34 -08:00
Matt Turner
497122a338 i965/fs: Remove force uncompressed stack.
Last use was in shader_time.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-06 11:09:46 -08:00
Matt Turner
7e19e6c877 i965/fs: Use execution size of 1 for some shader_time operations.
The ADDs depended on dispatch_width, which really isn't what we wanted.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-11-06 11:09:46 -08:00
Matt Turner
ee7e6009a9 i965/fs: Use mov(4) instructions to read timestamp.
We only want fields 0-2.
2014-11-06 11:09:45 -08:00
Jan Vesely
cd93d82ba9 clover: Fix build after llvm r221375
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-11-06 11:39:36 -05:00
Emil Velikov
ba0bb4227e egl_dri2: do not leak dri2_dpy->driver_configs
Walk through the list and free each config, and finally free the list
itself. Freeing approx 20KiB of memory, according to valgrind.
Inspired by a similar patch by enpeng xu.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-06 13:23:51 +00:00
Emil Velikov
54a065d9a6 ilo: add two missing headers to the sources list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-06 13:19:08 +00:00
Alexandros Frantzis
f53b6d0134 Releasing a surfaceless EGL context doesn't release underlying DRI context.
driUnbindContext() checks for valid drawables before calling the driver
unbind function. In case of Surfaceless contexts, the drawables are always
Null and we end up not releasing the underlying DRI context. Moving the
call to the driver function before the drawable validity checks fixes things.

Steps to trigger this bug are following:

   - create surfaceless context and make it current
   - make some other context current
   - {another thread} destroy surfaceless context
   - make another context current

Signed-off-by: Alexandros Frantzis <Alexandros.Frantzis@canonical.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74563
2014-11-06 13:40:39 +02:00
Chia-I Wu
cd745d46ce ilo: let ilo_shader_compile_cs() return a dummy shader
The dummy shader sends an EOT message to end itself.  There are many more
works need to be done on the compiler side before we can advertise
PIPE_CAP_COMPUTE.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:45:20 +08:00
Chia-I Wu
ce40fa3a4a ilo: hook up launch_grid()
All we need to do is to upload the input data and call
ilo_render_emit_launch_grid() with space checking.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:53 +08:00
Chia-I Wu
a1a701877a ilo: add ilo_render_emit_launch_grid()
ilo_render_emit_launch_grid() emits all the hardware states needed for a
launch_grid() call.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:53 +08:00
Chia-I Wu
9dd596c99f ilo: improve media command helpers
They were written for Gen6 but mostly untested.  Make them work for Gen7+.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:53 +08:00
Chia-I Wu
a2054af85c ilo: disassemble DP DC messages
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:53 +08:00
Chia-I Wu
58099ed0a1 ilo: disassemble TS messages
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:53 +08:00
Chia-I Wu
bfaed536dd ilo: update genhw headers for media pipeline
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:45 +08:00
Chia-I Wu
207eccc5bf ilo: add ilo_finalize_compute_states()
It updates the handles of the global bindings.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:31 +08:00
Chia-I Wu
9feb637cd0 ilo: use a dynamic array for global bindings
Use util_dynarray in ilo_set_global_binding() to allow for unlimited number of
global bindings.  Add a comment for global bindings.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:43:31 +08:00
Chia-I Wu
1d51947693 ilo: add kernel queries for compute shaders
We need to know the local/input/private sizes and others.  This is not
complete.  We need many others for CURBE setup.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:42:19 +08:00
Chia-I Wu
99742998fc ilo: fix compute params
Based on beignet, hardware capabilities, and OpenCL requirements.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:26:34 +08:00
Chia-I Wu
510a1a9012 ilo: add eu_count and thread_count to ilo_dev_info
They will be used to report compute params or program compute states.
thread_count can also be used for 3DSTATE_VS.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:26:34 +08:00
Chia-I Wu
29253f44d0 ilo: fix intel_bo_wait() on kernel 3.17
drm_intel_gem_bo_wait() with negative timeout is broken on kernel 3.17.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-11-06 10:26:34 +08:00
Ian Romanick
93a92d2c69 mesa: Silence unused parameter warning in check_context_limits in non-debug builds
../../src/mesa/main/context.c: In function 'check_context_limits':
../../src/mesa/main/context.c:733:41: warning: unused parameter 'ctx' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-05 09:36:04 -08:00
Ian Romanick
6f3b8bb747 util: Implement unreachable for MSVC using __assume
Based on the description of __assume at:

http://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-11-05 09:36:04 -08:00
Chris Forbes
1ca88aa582 i965: Fix sampler state pointer adjustment for nonconst samplers
This started hitting an assertion recently. Only affects Haswell
(Ivybridge doesn't support this meddling with the sampler state pointer,
and ARB_gpu_shader5 is not enabled yet on Broadwell)

14 Piglits crash->pass.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-05 23:32:42 +13:00
Nick Sarnie
9e2473763d ilo: add drm_configuration for the pipe-target
Allows the driver to advertise DMA-BUF and throttling.
2014-11-04 21:22:52 +00:00
Kenneth Graunke
6107557f8f i965: Re-enable Z16 on Gen8+.
Improves performance in GLBenchmark 2.7 TRex by 3.88889% +/- 0.336383%
(n=80) at 1280x720 on Broadwell GT3.  Together with the previous patch,
it improves performance by 5.42738% +/- 0.541971% (n=10) at 1920x1080.

Note that without the PMA stall fix, this would instead decrease
performance by 22%.

v2: Update comment (noticed by Kristian Høgsberg).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-04 11:39:18 -08:00
Kenneth Graunke
7423cc891b i965: Implement the PMA stall fix.
Certain non-promoted depth cases typically incur stalls.  In very
specific cases, we can enable a workaround which improves performance.

Improves performance in GLBenchmark 2.7 TRex by 1.17762% +/- 0.448765%
(n=75) at 1280x720 on Broadwell GT3.

Haswell has this feature as well, but we can't currently write registers
from userspace batches (and we'd incur additional software batch
scanning overhead as well), so we haven't enabled it.  Broadwell allows
us to write CACHE_MODE_1.  Backporters beware: the formula and flushing
incantation differs between Haswell and Broadwell.

v2: Move pma_stall_bits from brw->state to brw itself (requested by
    Kristian Høgsberg).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-04 11:38:01 -08:00
Kenneth Graunke
8ccf54ab09 i965: Add #defines for Broadwell HiZ workarounds in CACHE_MODE_1.
This patch adds macros needed for the HiZ PMA stall optimization.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-04 11:35:11 -08:00
Kenneth Graunke
b5ad8a5d72 i965: Update compaction code to handle Skylake like Cherryview.
Matt requested this in review feedback on the original patch, which I
completely missed when pushing this series.  Kristian also made this
change, but I grabbed the wrong version of the patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-03 22:37:11 -08:00
Kenneth Graunke
8ca8dd123a mesa: Don't call _mesa_ClipControl from glPopAttrib when unsupported.
Otherwise, calling glPopAttrib on drivers that don't support
ARB_clip_control gives you a GL error, which is surprising at best.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 18:26:08 -08:00
Kenneth Graunke
f781965097 i965: Disable fast color clears on Skylake for now.
We're not programming the clear values yet, so this won't work.

This patch should be (effectively) reverted eventually.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 15:35:25 -08:00
Kristian Høgsberg
c31ce2c40c i965/skl: Use new MOCS for SKL
On Skylake, the MOCS bits are an index into a table of 63 different,
configurable cache configurations.  As for previous GENs, we only care about
WB and WT, which are available in the documented default set.  Define
SKL_MOCS_WB and SKL_MOCS_WT to the indices for those configucations and use
those for the Skylake MOCS values.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:12 -08:00
Jordan Justen
5745aaf15c i965/skl: Implement workaround for VF Invalidate issue
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:09 -08:00
Kenneth Graunke
35bbe177ec i965/skl: Update Viewport Z Clip Test Enable bits for Skylake.
Skylake has separate controls for enabling the Z Clip Test for the near
and far planes.  For now, maintain the legacy behavior by setting both.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:07 -08:00
Kenneth Graunke
77f584c7f9 i965/skl: Emit extra zeros in 3DSTATE_DS on Skylake.
Skylake's 3DSTATE_DS packet has a few more fields; we don't support
domain shaders yet though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:05 -08:00
Kristian Høgsberg
0bb072b42b i965/skl: Init instructions compaction tables for SKL
They are the same as for BDW, so just add a case for SKL to the init switch.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 15:32:59 -08:00
Kristian Høgsberg
d235c5afde i965/skl: Add fast clear resolve rect multipliers for SKL
SKL updates the resolve rectangle scaling factors again.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:55 -08:00
Kenneth Graunke
051bfe4d52 i965/skl: Always emit 3DSTATE_BINDING_TABLE_POINTERS_* on Skylake.
On SKL, 3DSTATE_CONSTANT_* command is not committed until we give
the corresponding 3DSTATE_BINDING_TABLE_POINTERS_* command.  If we
fail to do so, the constant buffers wont be read and push constants
will be wrong.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:53 -08:00
Kenneth Graunke
1df496edb9 i965/skl: Allocate 16 DWords for SURFACE_STATE on Skylake.
Otherwise they overlap and horrible things happen.  All the new DWords
are for fast color clear values, which we don't do yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:51 -08:00
Kenneth Graunke
d18949ad82 i965/skl: Refactor surface state allocation.
We will need to allocate more DWords on Skylake.

v2: Don't mark brw_context parameter const.  It's modified.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:49 -08:00
Kenneth Graunke
263b584d5e i965/skl: Emit extra zeros in STATE_BASE_ADDRESS on Skylake.
Skylake introduces a new base address for a feature we don't yet expose.
Setting these to 0 should be safe.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:47 -08:00
Kenneth Graunke
eaf12022d2 i965/skl: Update stencil reference handling for Skylake.
Skylake uploads the stencil reference values in DW3 of the
3DSTATE_WM_DEPTH_STENCIL packet, rather than in COLOR_CALC_STATE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:45 -08:00
Kenneth Graunke
822e791321 i965/skl: Set mask bits in PIPELINE_SELECT on Skylake.
Skylake has some extra bits in PIPELINE_SELECT, none of which are
interesting for a 3D driver.  In order to selectively change them, it
also introduces new "mask bits" in 15:8.  We care about the "Pipeline
Selection" bits (1:0), so set the mask to 0x3.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:43 -08:00
Jordan Justen
e813728b2b i965/skl: Set max OpenGL version the same as gen7/8
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:41 -08:00
Damien Lespiau
48157b904a i965/skl: Update 3DSTATE_SBE for Skylake.
This commands has seen the addition of 2 dwords that allow to specify
which channels of which attributes need to be forwarded to the fragment
shader.

v2: Rebase forward a year (done by Ken).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:34 -08:00
Kenneth Graunke
2b7f73af9c glsl: Improve the CSE pass debugging output.
The CSE pass now prints out why it thinks a value is not a candidate for
adding to the AE set.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-03 15:16:50 -08:00
Matt Turner
799106d387 i965/fs: Don't compute_to_mrf() on Gen >= 7.
No differences in shader-db on Haswell (Gen 7.5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 11:27:52 -08:00
Matt Turner
5fbcb1b41d glsl: Remove now useless dot optimization on basis vect
The optimization in commit d056863b covers these cases, which were the
first optimizations I added to the GLSL compiler.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-11-03 11:27:50 -08:00
Matt Turner
336e76c143 glsl: Emit mul instead of dot if only one component left.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85683
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85691
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-11-03 11:27:38 -08:00
Tom Stellard
263eb7fa39 clover: Fix clBuildProgram piglit regression
Should trigger CL_INVALID_VALUE if device_list is NULL and num_devices
is greater than zero.

Introduced by e5468dfa52

Reported by: EdB

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-11-03 10:35:07 -05:00
José Fonseca
bfd453f942 gallivm: Disable frame-pointer-omission on x86 to ensure right stack alignment.
Between release 3.2 and 3.3 LLVM stopped aligning properly when certain
conditions (no allocas, but large number of vectors causing spills to
the stack, and frame pointer omission enabled).

We were already disabling frame-pointer-omission on several build types,
but we now disable it on all build types.

It's not clear whether this affects 32-bits x86 processes only, or if it
can also affect 64-bits x86_64 processes when AVX registers are
available and used.  So disable frame-pointer-omission on both
x86/x86_64 to be on the safe side.

See also:
- http://llvm.org/PR21435

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-11-03 14:47:00 +00:00
José Fonseca
b7e447d323 gallivm: When disassemble a function, start by printing out its name.
To help recognize what's supposed to do.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-11-03 14:47:00 +00:00
Ben Widawsky
5695303563 i965/chv: Increase VS and GS thread counts
AFAICT the number of threads is 80, not 70. I am not sure if Ken knows
something I do not.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-02 21:18:08 -08:00
Brian Paul
52576dcb88 gallium/docs: fix NRM, NRM4 docs
Need to do a sqrt().

FWIW, the html that Sphinx 1.1.3 generates for the math expressions
looks completely broken.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-11-01 09:00:07 -06:00
Brian Paul
afdc4309dc softpipe: use the tgsi_free_tokens() function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:30:00 -06:00
Brian Paul
e6ee85ec61 tgsi: add a tgsi_free_tokens() function
To match tgsi_alloc_tokens().

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul
c996b22329 util: simplify u_pstipple.c code
Use the new helper functions in the tgsi_transform.h file to emit
declarations and instructions.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul
55008ef697 util: simplify temp register selection in u_pstipple.c
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul
ccd1ea9d52 util: simplify util_pstipple_create_fragment_shader() params
Pass and return tgsi_token buffers instead of pipe_shader_state.

And update softpipe driver (the only user of this function).

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul
e3ecb8206a softpipe: remove unused softpipe_create_fs_variant_exec() parameter
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul
2b9e63823f softpipe: check for SP_NEW_STIPPLE when building quad pipeline
Fixes polygon stipple if both DO_PSTIPPLE_IN_DRAW_MODULE and
DO_PSTIPPLE_IN_HELPER_MODULE are zero/off.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Tom Stellard
b9e41b587f r600g: Fix build with opencl and radeonsi disabled 2014-10-31 16:26:52 -04:00
Tom Stellard
64b0fac5e2 clover: Fix bug when binary programs are passed to clBuildProgram() v2
This was a regression introduced by
611d66fe45

Passing a binary program to clBuildProgram() is legal, but passing one
to clCompileProgram() is not.

v2:
  - Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-31 15:24:00 -04:00
Tom Stellard
e5468dfa52 clover: Factor input validation of clCompileProgram into a new function v2
This factors out the validation that is common with clBuildProgram().

v2:
  - Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-31 15:24:00 -04:00
Tom Stellard
1f4e48d5b5 radeonsi/compute: Enable PIPE_SHADER_IR_NATIVE for compute shaders v2
v2:
  - Drop dependency on LLVM >= 3.5.1
  - Rename si_create_shader() to si_shader_binary_read()
2014-10-31 15:24:00 -04:00
Tom Stellard
fa07f4b68a r600g/compute: Enable PIPE_SHADER_IR_NATIVE for compute shaders v2
v2:
  - Drop dependency on LLVM >= 3.5.1
2014-10-31 15:24:00 -04:00
Tom Stellard
e91735a641 gallium/radeon: Add query for symbol specific config information
This adds a query which allows drivers to access the config
information of a specific function within the LLVM generated ELF
binary.  This makes it possible for the driver to handle ELF
binaries with multiple kernels / global functions.
2014-10-31 15:24:00 -04:00
Marek Olšák
f058c6bbd1 r300g: remove enabled/disabled hyperz and AA compression messages
It's annoying with octave. Reported by Michael Burian.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
2014-10-30 22:24:18 +01:00
Dieter Nützel
068b9f4f7a r600g: Delete unused variable 'max_global_size' in 'r600_get_compute_param'
Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2014-10-30 22:24:18 +01:00
Chia-I Wu
4ded2ef5e8 mesa: protect the debug state with a mutex
We are about to change mesa to spawn threads for deferred glCompileShader and
glLinkProgram, and we need to make sure those threads can send compiler
warnings/errors to the debug output safely.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu
2d64e4ffba glsl: protect glsl_type with a mutex
glsl_type has several static hash tables and a static ralloc context.  They
need to be protected by a mutex as they are not thread-safe.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69200
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu
a6706163cb glsl: protect anonymous struct id with a mutex
There may be two contexts compiling shaders at the same time, and we want the
anonymous struct id to be globally unique.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu
61c3d49388 util: initialize locale_t with a static object
_mesa_strtod and _mesa_strtof may be called from multiple threads.  They need
to be thread-safe.

v2: platform checks are now done in configure.ac

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-30 02:26:19 -07:00
Chia-I Wu
b039dbfffd configure: check for xlocale.h and strtof
With the assumptions that xlocale.h implies newlocale and strtof_l.  SCons is
updated to define HAVE_XLOCALE_H on linux and darwin.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-30 02:26:19 -07:00
Chia-I Wu
e3f2029479 util: add _mesa_strtod and _mesa_strtof
Both core mesa and glsl have their own wrappers for strtof_l.  Merge
and move them to util/.  They are compiled with a C++ compiler so that
we can make them thread-safe in a following commit.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whiteacpe.org>
2014-10-30 02:26:19 -07:00
Mathias Fröhlich
2c2ada6720 mesa/gallium: Signal _NEW_TRANSFORM from glClipControl.
This removes the need for the gallium rasterizer state
to listen to viewport changes.
Thanks to Marek Olšák <maraeo@gmail.com>.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-30 07:52:00 +01:00
Matt Turner
600066af93 Revert "i965/compaction: Disable compaction on SNB temporarily."
This reverts commit cabc93c5ad.

Mark thinks the failures on the SNB GT2 in the lab are actually because
of faulty hardware, not instruction compaction. The GT1 didn't see any
problems after changes to the compaction code.
2014-10-29 21:38:39 -07:00
Matt Turner
601a134180 i965/vec4: Perform CSE on MAD instructions with final arguments switched.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:35:46 -07:00
Matt Turner
b65bd9583b i965/fs: Perform CSE on MAD instructions with final arguments switched.
Multiplication is commutative.

instructions in affected programs:     48314 -> 47954 (-0.75%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:35:46 -07:00
Matt Turner
d056863b3c glsl: Drop constant 0.0 components from dot products.
Helps a small number of vertex shaders in the games Dungeon Defenders
and Shank, as well as an internal benchmark.

instructions in affected programs:     2801 -> 2719 (-2.93%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:35:46 -07:00
Kenneth Graunke
26122e09a3 glx/dri3: Implement LIBGL_SHOW_FPS=1 for DRI3/Present.
v2: Use the UST value provided in the PRESENT_COMPLETE_NOTIFY event
    rather than gettimeofday(), which gives us the presentation time
    instead of the time when SwapBuffers was called.  Suggested by
    Keith Packard.  This relies on the fact that the X DRI3/Present
    implementations use microseconds for UST.

v3: Properly ignore PresentCompleteKindMSCNotify; multiply in 64 bits
    (caught by Keith Packard).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com> [v3]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v1]
2014-10-29 15:13:58 -07:00
Kenneth Graunke
62b07b934e i965: Rename brw_vec4_gs.[ch] to brw_gs.[ch].
These source files support actual geometry shaders, so using "gs" for
the name makes a lot of sense.  We're going to be adding SIMD8 geometry
shader support as well, at which point "vec4_gs" will be a misnomer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
2014-10-29 12:38:56 -07:00
Kenneth Graunke
02f8f90cc2 i965: Rename brw_gs{,_emit}.[ch] to brw_ff_gs{,_emit}.[ch].
The brw_gs.[ch] and brw_gs_emit.c source files contain code for
emulating fixed-function unit functionality (VF primitive decomposition
or SOL) using the GS unit.  They do not contain code to support proper
geometry shaders.

We've taken to calling that code "ff_gs" (see brw_ff_gs_prog_key,
brw_ff_gs_prog_data, brw_context::ff_gs, brw_ff_gs_compile,
brw_ff_gs_prog).  So it makes sense to make the filenames match.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
2014-10-29 12:38:42 -07:00
Kenneth Graunke
1480814173 i965: Rename intel_bufferobj_* functions to match GL and DD hooks.
The GL functions and driver hooks use corresponding names---for example,
glMapBufferRange and Driver.MapBufferRange.  But our implementation was
called "intel_bufferobj_map_range," which has the words "map" and
"buffer" swapped, as well as randomly adding "obj."

FlushMappedBufferRange was even trickier: it ordered the words
3, "obj", 1, 2, 4: intel_bufferobj_flush_mapped_range.

Even though the old names were consistent, I always had trouble
rearranging the jumble of words when searching for a function,
and it took a few tries to eventually land there.

The new names match the word order of GL and the driver hooks;
FlushMappedBufferRange is simply brw_flush_mapped_buffer_range.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-29 12:38:28 -07:00
Jan Vesely
993e2922c9 configure: fix typos
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-10-29 19:10:48 +00:00
Jan Vesely
af9551e68c configure: include llvm systemlibs when using static llvm
v2: drop -WL,--exclude-libs, it's not necessary
    fix tabs/spaces

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70410
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-10-29 18:52:46 +00:00
Michel Dänzer
402ab50bed radeon/llvm: Dynamically allocate branch/loop stack arrays
This prevents us from silently overflowing the stack arrays, and allows
arbitrary stack depths.

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

Cc: mesa-stable@lists.freedesktop.org
Reported-and-Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-29 19:01:25 +09:00
Chris Forbes
0d5f4960a4 mesa: Fix order of errors for glDrawTransformFeedbackStream
The OpenGL 4.0 core profile specification, section 2.17.3
Transform Feedback Draw Operations says:

   "The error INVALID_VALUE is generated if <stream> is greater
    than or equal to the value of MAX_VERTEX_STREAMS.
    ...
    The error INVALID_OPERATION
    is generated if EndTransformFeedback has never been called
    while the object named by id was bound."

Fixes the piglit test:
   ARB_transform_feedback3/arb_transform_feedback3-draw_using_invalid_stream_index
   (with the test itself fixed to eliminate an unrelated failure)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:25:20 +13:00
Eric Anholt
f87c700895 vc4: Add support for ARL and indirect register access on TGSI_FILE_CONSTANT.
Fixes 14 ARB_vp tests (which had no lowering done), and should improve
performance of indirect uniform array access in GLSL.
2014-10-28 17:16:05 -07:00
Eric Anholt
5539a5b685 vc4: Fix mixup of return type in reloc_tex(). 2014-10-28 17:15:36 -07:00
Eric Anholt
926ab7dfa5 vc4: Drop redundant check for is_tmu_write().
This function is only called when it would return true.
2014-10-28 17:15:36 -07:00
Eric Anholt
8911879dec vc4: Don't forget to validate code that's got PROG_END on it.
This signal doesn't terminate the program now, it terminates the program
soon.  So you have to actually validate the code in the instruction.
2014-10-28 17:15:36 -07:00
Eric Anholt
fc1eb614a7 vc4: Add .dir-locals.el for kernel style in the kernel code. 2014-10-28 17:15:36 -07:00
Eric Anholt
6576dc1e92 vc4: Fix a couple missing '\n's in error output. 2014-10-28 17:15:36 -07:00
Brian Paul
6ad1c1eec1 st/mesa: use PIPE_BIND_DISPLAY_TARGET when checking for sRGB capability
When we're checking if the framebuffer is sRGB capable, call
is_format_supported() with the PIPE_BIND_DISPLAY_TARGET flag.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-28 18:07:54 -06:00
Marek Olšák
6fcb5520b7 Revert "st/mesa: set MaxUnrollIterations = 255"
This reverts commit 20836c8185.

255 is a huge number. If you have a loop with 255 iterations, unrolling it
will exceed the SM3 instruction limit. Let's use the default again.

The comment about a SM3 limit doesn't make sense. For SM3, we generally
want 32 (default) or a lower number due to the SM3 instruction limit, which
is 512 instructions. For SM4, we can try higher numbers if needed, but
some shaders can end up being pretty huge and shader compilation can take
more time.

This fixes a shader compile failure on R500/SM3. Reported on IRC.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-28 23:20:51 +01:00
David Heidelberger
b7186ebea9 r300g/vdpau: enable again
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-10-28 23:20:51 +01:00
Marek Olšák
3fc499a1dd r300g: only set clip_halfz for chips with HW TCL
I forgot that we cannot emit vertex shader state on a chip without VS.
In such a case, clip_halfz is handled by the Draw module.
2014-10-28 23:20:45 +01:00
Marek Olšák
e05259b637 radeonsi: fix incorrect index buffer max size for lowered 8-bit indices
Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-28 23:20:45 +01:00
Marek Olšák
72424061e0 radeonsi: fix polygon mode for points and lines and point/line fill modes
Fixes piglit/polygon-mode-offset.

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-28 23:20:45 +01:00
Marek Olšák
dab177ea99 r600g: fix polygon mode for points and lines and point/line fill modes
Fixes piglit/polygon-mode-offset.

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-28 23:20:45 +01:00
Glenn Kennard
7b1c0cbc90 r600g: Implement sm5 UBO/sampler indexing
Caveat: Shaders using UBO/sampler indexing will
not be optimized by SB, due to SB not currently
supporting the necessary CF_INDEX_[01] index
registers.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-10-28 23:20:45 +01:00
Glenn Kennard
444c8c2f28 r600g: Implement sm5 interpolation functions
Requires evergreen/cayman

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-10-28 23:20:44 +01:00
Neil Roberts
3b83a5c35c docs: Update GL3.txt and relnotes for GL_KHR_context_flush_control 2014-10-28 16:51:12 +00:00
Neil Roberts
60ec95fa1e mesa: Add support for the GL_KHR_context_flush_control extension
The GL side of this extension just provides an accessor via glGetIntegerv for
the value of GL_CONTEXT_RELEASE_BEHAVIOR so it is trivial to implement. There
is a constant on the context for the value of the enum which is initialised to
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH. The extension is always enabled because it
doesn't need any driver interaction to retrieve the value.

If the value of the enum is anything but FLUSH then _mesa_make_current will
now refrain from calling _mesa_flush. This should only affect drivers that
explicitly change the enum to a non-default value.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-28 16:40:18 +00:00
Neil Roberts
1ecf6e1595 gles2: Update gl2ext.h to revision 28335
The main incentive to do this is to get the defines for the
GL_KHR_context_flush_control extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-28 16:40:18 +00:00
Jason Ekstrand
17d98ae254 i965/fs: Don't set dependency hints on instructions with spilled destinations
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-27 17:54:10 -07:00
Jason Ekstrand
547a7fb458 i965/fs: Make scratch write instructions use the correct execution size
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 13:35:57 -07:00
Jason Ekstrand
9d1f72ebde i965/fs: Use correct spill offsets
Different platforms require the offset to be in different units.  However,
the generator fixes all of this up for us and only requires an offset in
bytes.  Previously, we were getting this wrong all over the place.  Some
computed/used it correctly as bytes while others treated the offset as
whole registers or computed it as bytes or bytes*2 in SIMD16 mode.  This
commit cleans all this up and makes us properly treat it as bytes
everywhere.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 13:35:57 -07:00
Jason Ekstrand
4242eb14c1 i965: Use the spill destination for the message header on GEN >= 7
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 13:35:57 -07:00
Jason Ekstrand
76bb695f09 i965/fs: Don't [un]spill multiple registers at a time in SIMD8 mode
I thought this would be a clever way to make spilling less expensive.
However, it appears that the oword read/write messages we are using for
spilling ignore the execution size and assume SIMD16 whenever working with
more than one register.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 13:35:57 -07:00
Jason Ekstrand
3a5df8b612 i965/fs: Use instruction execution sizes when generating scratch reads/writes
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 13:35:57 -07:00
Lionel Landwerlin
d175e7c16b egl/drm: do not crash when swapping buffers without any rendering
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-27 10:36:21 -07:00
Tobias Klausmann
1a170980a0 nv50: handle inverted render conditions
This enables ARB_conditional_render_inverted.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-26 07:33:16 -04:00
Rob Clark
13862812dc freedreno/ir3: consider instruction neighbors in cp
Fanin (merge) nodes require it's srcs to be "adjacent" in consecutive
scalar registers.  Keep track of instruction neighbors in copy-
propagation step and avoid eliminating mov's which would cause an
instruction to need multiple distinct left and/or right neighbors.

This lets us not fall on our face when we encounter things like:

  1: MOV TEMP[2], IN[0].xyzw
  2: TEX OUT[0].xy, TEMP[2], SAMP[0], SHADOW2D
  3: MOV TEMP[2].xy, IN[0].yxzz
  4: TEX OUT[0].zw, TEMP[2], SAMP[0], SHADOW2D
  5: END

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-25 12:07:43 -04:00
Rob Clark
4dff2a6429 freedreno/ir3: always mov tex coords
Always insert extra mov's for the tex coord into the fanin.  This
simplifies things a bit, and avoids a scenario where multiple sam
instructions can have mutually exclusive input's to it's fanin, for
example:

  1: TEX OUT[0].xy, IN[0].xyxx, SAMP[0], 2D
  2: TEX OUT[0].zw, IN[0].yxxx, SAMP[0], 2D

The CP pass can always remove the mov's that are not actually needed,
so better to start out with too many mov's in the front end, than not
enough.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-25 12:07:34 -04:00
Rob Clark
33193540fc freedreno: rename a couple debug flags
dscis -> noscis
dbypass -> nobypass

a bit more consistant w/ nobin, etc.  And IMO a bit more sensible names.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-25 12:07:21 -04:00
Rob Clark
ded5013c4c freedreno/ir3: skip virtual outputs in standalone compiler
Kills get added to the outputs list, to ensure they get scheduled.  But
they aren't *really* outputs so skip them in the header comment block.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-25 10:25:15 -04:00
Mathias Fröhlich
a9c634dded glx: Fix make check.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=85429.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-25 15:14:24 +02:00
Mathias Fröhlich
ce61559413 mesa: Add ARB_clip_control.xml to automake.
Adding this makes 'make check' catch failures introduced from
within ARB_clip_control.xml earlier.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-25 15:14:24 +02:00
Rob Clark
d6252d0f63 freedreno/ir3: standalone compiler updates for ir3test
In order to test compiler changes more easily, spit out the assembled
shader with some header information so that we can know about
inputs/outputs more easily.

See: git://people.freedesktop.org/~robclark/ir3test

In ir3test we have a big collection of tgsi shaders and reference
ir3_compiler outputs.  When making compiler changes, regenerate the
compiler outputs and feed to ir3test to compare the new vs reference
shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-25 09:08:15 -04:00
Chia-I Wu
762c68b879 ilo: improve blob decoding
The last few dwords were skipped if the total number of dwords was not a
multiple of 4.  Change the formatting for better readability.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-25 14:28:08 +08:00
Eric Anholt
08599f668c i965: Skip recalculating URB allocations if the entry size didn't change.
We only get here if the VS/GS compiled programs change, but we can even
skip it if the VS/GS size didn't change.

Affects cairo runtime on glamor by -1.26471% +/- 0.674335% (n=234)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 23:17:14 -07:00
Andres Gomez
b0e0c26f02 glsl: Standardize names and fix typos
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 23:14:04 -07:00
Ian Romanick
7d560a3861 i965: Silence unused parameter warning in brw_dump_ir
Just remove the parameter.  Silences:

brw_program.c: In function 'brw_dump_ir':
brw_program.c:566:33: warning: unused parameter 'brw' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
4939c2eced i965: Remove brwIsProgramNative
Originally I just fixed some unused parameter warnings in this
function.  However, Ken pointed out:

    "You could instead remove this driver hook.  If the dd pointer is
    NULL, arbprogram.c will return true.  I think I'd prefer that."

Way, way back in time, I think _mesa_GetProgramivARB had the opposite
behavior.  Given that it works the way it now works, I also prefer
removing the driver hook.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
66d950464c mesa: Silence unused parameter warning in _mesa_init_shader_program
Just remove the parameter.  Silences:

../../src/mesa/main/uniform_query.cpp:1062:1: warning: unused parameter 'ctx' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
99e8a3973f mesa: Remove context parameter from dd_function_table::NewShaderProgram
This fixes some unused parameter warnings introduced by the previous
commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
c76cc7bab0 mesa: Make _mesa_init_shader_program static
Since a couple commits ago, there is only one caller, and that caller is
in the same file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
cfe195f901 mesa: Remove context parameter from _mesa_init_shader_program
Silences:

../../src/mesa/main/shaderobj.c: In function '_mesa_init_shader_program':
../../src/mesa/main/shaderobj.c:239:46: warning: unused parameter 'ctx' [-Wunused-parameter]

For now, this adds a couple other unused parameter warnings, but future
patches will clean those up.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
edcba62655 glsl_to_tgsi: Remove st_new_shader
It was identical to the default implementation in _mesa_new_shader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
2014-10-24 19:54:39 -07:00
Ian Romanick
deee3b0f9e glsl_to_tgsi: Remove st_new_shader_program
It was identical to the default implementation in
_mesa_new_shader_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
2014-10-24 19:54:39 -07:00
Ian Romanick
a2dc16ed81 i965: Remove brw_new_shader_program
It was identical to the default implementation in
_mesa_new_shader_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:39 -07:00
Ian Romanick
9cdf2f78fc mesa: Silence unused parameter warning in _mesa_clear_shader_program_data
Just remove the parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:38 -07:00
Ian Romanick
fefead3b63 linker: Rely on _mesa_clear_shader_program_data to clear link information
_mesa_link_shader_program already calls _mesa_clear_shader_program_data
before calling link_shaders, so this is already done.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 19:54:38 -07:00
Ian Romanick
7cbcff0606 mesa: Add some missing clean-up to _mesa_clear_shader_program_data
All of this is already done in link_shaders.  More clean-ups coming.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:38 -07:00
Ian Romanick
a3bfc7d313 mesa: Remove prototypes for nonexistent functions
_mesa_UseShaderProgramEXT, _mesa_ActiveProgramEXT, and
_mesa_CreateShaderProgramEXT were all removed when support for
GL_EXT_separate_shader_objects was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:38 -07:00
Ian Romanick
1ac924a77d ff_fragment_shader: Silence unused parameter warning in smear
Just remove the parameter.  Silences:

../../src/mesa/main/ff_fragment_shader.cpp:668:1: warning: unused parameter 'p' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-24 19:54:38 -07:00
Ian Romanick
3e462d9221 meta: Only use _mesa_ClipControl if the extension is supported
Fixes many piglit failures on IVB since 85edaa8.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85425
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
2014-10-24 19:24:54 -07:00
Emil Velikov
f9a9054b61 docs: add news item and link release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-25 01:13:11 +00:00
Emil Velikov
95d00f6640 docs: Add sha256 sums for the 10.3.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9599470642)
2014-10-25 01:11:02 +00:00
Emil Velikov
95d31ab54c Add release notes for the 10.3.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 3b6a4758fa)
2014-10-25 01:09:55 +00:00
Jason Ekstrand
5d1046291a i965/fs: Compute q-values for register allocation manually
Previously, we were allowing the register allocation code to do the
computation for us in ra_set_finalize.  However, the runtime for this
computation is O(c^4 * g) where c is the number of classes and g is the
number of GRF registers.  However, these q-values are directly computable
based on the way we lay out our register classes so there is no need for
the aweful runtime algorithm.

We were doing ok until commit 7210583eb where we bumped the number of
register classes from 11 to 16.  While startup times don't normally matter,
this caused piglit to take 4 times as long to run on Bay Trail.  This patch
should make generating the ra_set much faster and melt the piglit run
times.

v2: Fixed a couple of bugs.  I have now verified that the same q-values are
generated both ways.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 16:25:31 -07:00
Jason Ekstrand
2ec161b239 i965/fs: Don't interfere with too many base registers
On older GENs in SIMD16 mode, we were accidentally building too much
interference into our register classes.  Since everything is divided by 2,
the reigster allocator thinks we have 64 base registers instead of 128.
The actual GRF mapping still needs to be doubled, but as far as the ra_set
is concerned, we only have 64.  We were accidentally adding way too much
interference.

Signed-off-by: Jason Ekstrand <jason.ekstrand@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 16:24:05 -07:00
Jason Ekstrand
ee65f2b50d i965/fs: Properly precolor payload registers on GEN5 in SIMD16
For GEN6 SIMD16 mode, we have to 2-align all the registers, so we only have
the even-numbered ones.  This means that we have to divide the register
number by 2 when we precolor.  This wasn't a problem before because we were
setting up the interference between ra_node registers wrong.  This will be
fixed in the next commit.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 16:23:54 -07:00
Jason Ekstrand
1988b71655 i965/fs: Add another use of MAX_VGRF_SIZE
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 16:23:24 -07:00
Jason Ekstrand
f84adb8481 util: Use reg_belongs_to_class instead of BITSET_TEST
This shouldn't be a functional change since reg_belongs_to_class is just a
wrapper around BITSET_TEST.  It just makes the code a little easier to
read.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-24 16:23:08 -07:00
José Fonseca
701f739d7f llvmpipe: Ensure the packed input of the lp_test_format is aligned.
Fixes:
- https://bugs.freedesktop.org/show_bug.cgi?id=85377
- http://llvm.org/bugs/show_bug.cgi?id=21365

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-10-24 21:35:23 +01:00
José Fonseca
1ef6d439ba llvmpipe: Flush stdout on lp_test_* unit tests.
So that the order of test messages and gallivm/llvmpipe debug output is
preserved.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-10-24 21:35:09 +01:00
Mathias Fröhlich
5fc0e11053 gallium: Enable ARB_clip_control for gallium drivers.
Gallium should be prepared fine for ARB_clip_control.
So enable this and mention it in the release notes.

v2:
Only enable for drivers announcing the freshly introduced
PIPE_CAP_CLIP_HALFZ capability.

v3:
Use extension enable infrastructure to connect PIPE_CAP_CLIP_HALFZ
with ARB_clip_control.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-24 19:21:21 +02:00
Mathias Fröhlich
56088131d0 gallium: introduce PIPE_CAP_CLIP_HALFZ.
In preparation of ARB_clip_control. Let the driver decide if
it supports pipe_rasterizer_state::clip_halfz being set to true.

v3:
Initially enable on ilo.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de
2014-10-24 19:21:21 +02:00
Mathias Fröhlich
85edaa8b72 mesa: Handle clip control in meta operations.
Restore clip control to the default state if MESA_META_VIEWPORT
or MESA_META_DEPTH_TEST is requested.

v3:
Handle clip control state with MESA_META_TRANSFORM.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-24 19:21:21 +02:00
Mathias Fröhlich
34a3c97fe6 mesa: Implement ARB_clip_control.
Implement the mesa parts of ARB_clip_control.
So far no driver enables this.

v3:
Restrict getting clip control state to the availability
of ARB_clip_control.
Move to transformation state.
Handle clip control state with the GL_TRANSFORM_BIT.
Move _FrontBit update into state.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-24 19:21:21 +02:00
Mathias Fröhlich
6340e609a3 mesa: Refactor viewport transform computation.
This is for preparation of ARB_clip_control.

v3:
Add comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-24 19:21:20 +02:00
Eric Anholt
8c7ac377b7 vc4: Reuse uniform_data/contents indices when making uniforms.
This allows vc4_opt_cse.c to CSE-away operations involving the same
uniform values.

total instructions in shared programs: 37341 -> 36906 (-1.16%)
instructions in affected programs:     10233 -> 9798 (-4.25%)
total uniforms in shared programs: 10523 -> 10320 (-1.93%)
uniforms in affected programs:     2467 -> 2264 (-8.23%)
2014-10-24 18:04:26 +01:00
Eric Anholt
18ccda7b86 vc4: When asked to discard-map a whole resource, discard it.
This saves a bunch of extra flushes when texsubimaging a whole texture
that's been used for rendering, or subdataing a whole BO.  In particular,
this massively reduces the runtime of piglit texture-packed-formats (when
the probes have been moved out of the inner loop).
2014-10-24 18:04:26 +01:00
Eric Anholt
a71c3b885a vc4: Refactor flushing before mapping a BO.
I'm going to want to make some other decisions here before flushing.
2014-10-24 18:04:26 +01:00
Eric Anholt
52824811b9 vc4: Allow dead code elimination of unused varyings.
total instructions in shared programs: 39022 -> 37341 (-4.31%)
instructions in affected programs:     26979 -> 25298 (-6.23%)
total uniforms in shared programs: 11242 -> 10523 (-6.40%)
uniforms in affected programs:     5836 -> 5117 (-12.32%)
2014-10-24 18:04:26 +01:00
Eric Anholt
5d32e26335 vc4: Add debug output to match shaderdb info to program dumps.
I'm going to be using VC4_DEBUG=shaderdb,norast to do shaderdb stats, but
when debugging regressions, I want to match shaderdb output to shader
disassembly.
2014-10-24 18:04:26 +01:00
Andreas Boll
14bdcc6ff9 radeon: enable Hyper-Z on r600g and radeonsi by default
This reverts commit 01e6371149.
Since then many Hyper-Z issues have been fixed or worked around.

Enable Hyper-Z by default so that we get enough feedback for the upcoming
mesa 10.4 release.

If you have issues with Hyper-Z try to disable Hyper-Z using the enviroment
variable R600_DEBUG=nohyperz and please report the issue on the bugtracker.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75011
See also: https://bugs.freedesktop.org/show_bug.cgi?id=75112

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-24 09:11:51 +02:00
Matt Turner
76f27a6b03 i965: Silence unused variable warning. 2014-10-23 16:20:07 -07:00
Matt Turner
40492be2a4 i965/fs: Silence uninitialized variable warning.
The compiler isn't privy to the knowledge that we're doing at least one
framebuffer write.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-23 16:20:07 -07:00
Matt Turner
2695891088 util: Add assume() macro.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-23 16:20:07 -07:00
Jan Vesely
bbe93161e7 glapi: Fix compiler warning and script name
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-23 16:03:16 +01:00
Rob Clark
4f1fec6060 Revert "freedreno/a3xx: only emit dirty consts"
This reverts commit 94bb33617d.

Which somehow broke gnome-shell.. and needs more investigation.  For
now, revert..
2014-10-23 10:46:51 -04:00
Rob Clark
6eabc11936 freedreno: fix PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
fd_bo_cpu_prep() doesn't realize the bo is already referenced in
unflushed cmdstream.  It could be made to do so (but would have to be
implemented twice, ie. both for msm and kgsl).  But we still can't do
the expected thing if the caller isn't using _NOSYNC.  Because of the
way the tiling works, we need to build quite a bit of cmdstream at flush
time, which is not possible to do at the libdrm level.

So rather than trying to make fd_bo_cpu_prep() smarter than it can
possibly be, just *always* discard and reallocate if the
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE flag is set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-23 10:46:51 -04:00
Jan Vesely
ab53830b95 clover: Require libelf
v2: test for libelf once, check in both radeon and clover

CC: Tom Stellard <tom@stellard.net>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-23 15:19:00 +01:00
Emil Velikov
b4039cf15a clover: use correct typenames for compat::pair's first/second
Seems to be a typo judging from the overall declaration of the
template.

Cc: EdB <edb+mesa@sigluy.net>
Cc: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-23 15:18:12 +01:00
Emil Velikov
c63eb5dd5e auxiliary/os: get the mmap/munmap wrappers working with android
- Use macro for munmap under Android - the STATIC_ASSERT uses
a off_t which is not used under Android for mmap. As loff_t size
does not vary as does off_t just ignore the assert.

 - Wrap the long lines to improve readability.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-23 15:18:11 +01:00
Mauro Rossi
417b17378a gallium/nouveau: fully build the driver under android
Fix the trivial typo in the variable name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-10-23 15:18:11 +01:00
Alon Levy
d897e7c34a mesa/shaderimage.c: fix inconsistent sign warning
Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-23 14:45:41 +01:00
Alon Levy
501baa6bbb wgl: stw_pixelformat_get_info: correct type for index variable
Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-23 14:45:40 +01:00
Alon Levy
23080e49c4 u_math.h: fix 64 to 32 bit truncation warning
Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-23 14:45:40 +01:00
José Fonseca
75ad4fe78e gallivm: Fix build with LLVM 3.3.
The setMCJITMemoryManager method doesn't exist in LLVM 3.3.

I thought I had tested the latest version of my earlier change with LLVM
3.3, but it looks I missed it.

Trivial.
2014-10-23 10:42:12 +01:00
José Fonseca
065256dfc4 gallivm: Properly update for removal of JITMemoryManager in LLVM 3.6.
JITMemoryManager was removed in LLVM 3.6, and replaced by its base class
RTDyldMemoryManager.

This change fixes our JIT memory managers specializations to derive from
RTDyldMemoryManager in LLVM 3.6 instead of JITMemoryManager.

This enables llvmpipe to run with LLVM 3.6.

However, lp_free_generated_code is basically a no-op because there are
not enough hook points in RTDyldMemoryManager to track and free the code
of a module.  In other words, with MCJIT, code once created, stays
forever allocated until process destruction.  This is not speicfic to
LLVM 3.6 -- it will happen whenever MCJIT is used regardless of version.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-10-23 10:19:33 +01:00
José Fonseca
3fd220e2eb gallivm: Fix white-space.
Replace tabs with spaces.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-10-23 10:19:33 +01:00
José Fonseca
013ff2fae1 gallivm,llvmpipe,clover: Bump required LLVM version to 3.3.
We'll need to update gallivm for the interface changes in LLVM 3.6, and
the fewer the number of older LLVM versions we support the less hairy that
will be.

As consequence HAVE_AVX define can disappear.  (Note HAVE_AVX meant
whether LLVM version supports AVX or not.  Runtime support for AVX is
always checked and enforced independently.)

Verified llvmpipe builds and runs with with LLVM 3.3, 3.4, and 3.5.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-10-23 10:18:56 +01:00
Ilia Mirkin
9ad80d1d18 mesa: remove conditional render and rgtc from ES3 requirements
The functionality exposed by those extensions does not appear in ES3

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-23 00:45:08 -04:00
Brian Paul
c9a6ec1978 u_blitter: put a comment on util_blitter_cache_all_shaders()
Trivial.
2014-10-22 17:33:40 -06:00
Brian Paul
f82a84c097 u_blitter: use ctx->bind_fs_state(), not pipe->bind_fs_state()
Consistently use the function pointer we saved earlier.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-22 17:33:40 -06:00
Brian Paul
0bcd9f5469 u_blitter: create basic fs shaders in util_blitter_cache_all_shaders()
We need to create all fs shaders in this function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-22 17:33:40 -06:00
Brian Paul
27de89d266 u_blitter: do error checking assertions for shader caching
If the user calls util_blitter_cache_all_shaders() set a flag and assert
that we never try to create any new fragment shaders after that point.
If the assertions fails, it means we missed generating some shader in
util_blitter_cache_all_shaders().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-22 17:33:40 -06:00
Anuj Phogat
7a652c41b4 glsl: Use signed array index in update_max_array_access()
Avoids a crash in case of negative array index is used in a
shader program.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-22 16:13:37 -07:00
Anuj Phogat
6f0089e92e glsl: Fix crash due to negative array index
Currently Mesa crashes with a shader like this:

[fragmnet shader]
float[5] array;
int idx = -2;
void main()
{
   gl_FragColor = vec4(0.0, 1.0, 0.0, array[idx]);
}

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-22 16:13:37 -07:00
Marek Olšák
8ec40adf7e radeonsi: implement pipe_rasterizer_state::clip_halfz
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-22 21:05:00 +02:00
Marek Olšák
a3591da1a0 r600g: implement pipe_rasterizer_state::clip_halfz
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-22 21:04:58 +02:00
Marek Olšák
8ddd2f7aee r300g: implement pipe_rasterizer_state::clip_halfz
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-22 21:04:56 +02:00
Michel Dänzer
ae879718c4 r600g: Drop references to destroyed blend state
Fixes use-after-free when the currently bound blend state is destroyed.

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>

Cc: mesa-stable@lists.freedesktop.org
2014-10-22 17:09:43 +09:00
Kenneth Graunke
6dc6e6e0d9 i965/vec4: Generate better code for ir_triop_csel.
Previously, we generated an extra CMP instruction:

   cmp.ge.f0(8)    g6<1>D          g1<0,4,1>F      0F
   cmp.nz.f0(8)    null            g6<4,4,1>D      0D
   (+f0) sel(8)    g5<1>F          g1.4<0,4,1>F    g2<0,4,1>F

The first operand is always a boolean, and we want to predicate the SEL
on that.  Rather than producing a boolean value and comparing it against
zero, we can just produce a condition code in the flag register.

Now we generate:

   cmp.ge.f0(8)    null            g1<0,4,1>F      0F
   (+f0) sel(8)    g5<1>F          g1.4<0,4,1>F    g2<0,4,1>F

No difference in shader-db.

v2: Remember to delete the old code (thanks Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-21 21:14:03 -07:00
Kenneth Graunke
f5c3f095b9 i965/vec4: Simplify visit(ir_expression *)'s result_src/dst setup.
Using dst_reg(this, ir->type) automatically sets the writemask to the
proper size for the type; src_reg(dst_reg) preserves that.  This should
be equivalent, but less code.

Note that src_reg(dst_reg) either uses SWIZZLE_XXXX or SWIZZLE_XYZW, so
the old code did need the manual writemask adjustment, since it
constructed the registers the other way around.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-21 21:14:00 -07:00
Kenneth Graunke
cb36e79f96 i965/vec4: Delete some dead code in visit(ir_expression *).
Nothing uses the vector_elements temporary variable.

Setting this->result.file is dead because we overwrite this->result a
few lines later.

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-10-21 21:13:37 -07:00
Kenneth Graunke
4d34c4b582 i965/fs: Generate better code for ir_triop_csel.
Previously, we generated an extra CMP instruction:

   cmp.ge.f0(8)   g4<1>D          g2<0,1,0>F      0F
   cmp.nz.f0(8)   null            g4<8,8,1>D      0D
   (+f0) sel(8)   g120<1>F        g2.4<0,1,0>F    g3<0,1,0>F

The first operand is always a boolean, and we want to predicate the SEL
on that.  Rather than producing a boolean value and comparing it against
zero, we can just produce a condition code in the flag register.

Now we generate:

   cmp.ge.f0(8)    null            g2<0,1,0>F      0F
   (+f0) sel(8)    g124<1>F        g2.4<0,1,0>F    g3<0,1,0>F

total instructions in shared programs: 5473459 -> 5473253 (-0.00%)
instructions in affected programs:     6219 -> 6013 (-3.31%)

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-10-21 21:13:37 -07:00
Kenneth Graunke
32364a1fe5 glsl: Delete unused gl_uniform_driver_format enum values.
A while back, Matt made the uniform upload functions simply upload
ctx->Const.UniformBooleanTrue for boolean values instead of 0/1, which
removed the need to convert it later.  We also set UniformBooleanTrue to
1.0f for drivers which want to treat booleans as 0.0/1.0f.

Nothing ever sets these, so they are dead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-21 18:53:13 -07:00
Rob Clark
36310d9d56 freedreno/a3xx: fix depth/stencil restore format
Also fix z16 restore format which was completely wrong.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-21 20:08:49 -04:00
Rob Clark
2bc2ab66d9 freedreno/a3xx: fix viewport state during clear
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-21 20:08:49 -04:00
Rob Clark
3eb8289aa4 freedreno: mark scissor state dirty when enable bit changes
We don't have a scissor enable bit in hw, so when a raster state change
results in scissor enable bit changing, we need to also mark scissor
state as dirty.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-21 20:08:49 -04:00
Rob Clark
01b757e2b0 freedreno: clear vs scissor
The optimization of avoiding restore (mem2gmem) if there was a clear
falls down a bit if you don't have a fullscreen scissor.  We need to
make the decision logic a bit more clever to keep track of *what* was
cleared, so that we can (a) completely skip mem2gmem if entire buffer
was cleared, or (b) skip mem2gmem on a per-tile basis for tiles that
were completely cleared.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-21 20:08:49 -04:00
Vinson Lee
1ab6543431 clover: Fix build error with LLVM 3.4.
DataLayoutPass was added in LLVM 3.5 r202168, commit
57edc9d4ff1648568a5dd7e9958649065b260dca "Make DataLayout a plain
object, not a pass.".

This patch fixes this build error with LLVM 3.4.

  CXX      llvm/libclllvm_la-invocation.lo
llvm/invocation.cpp: In function 'void {anonymous}::optimize(llvm::Module*, unsigned int, const std::vector<llvm::Function*>&)':
llvm/invocation.cpp:324:18: error: expected type-specifier
       PM.add(new llvm::DataLayoutPass(mod));
                  ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85189
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-10-21 15:40:47 -07:00
Marek Olšák
43b2432368 r600g,radeonsi: convert TGSI shader type to LLVM shader type
The values are hardcoded in the LLVM backend, but the TGSI definitions are
going to be changed with tessellation, e.g. TGSI_PROCESSOR_COMPUTE will be
increased by 2.

We'll use VS for LS and HS, because there's nothing special about them
from the LLVM backend point of view, even though the hardware side is
different. We do the same for ES.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:39:50 +02:00
Marek Olšák
c5a44cf3f8 radeonsi: add some missing register definitions
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:39:50 +02:00
Marek Olšák
fc3b3354d7 radeonsi: load ring resource descriptors only once
v2: document the new functions

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:39:35 +02:00
Marek Olšák
d787608957 radeonsi: clarify shader constant load functions
I'll need indexed loads without the meta data flag for tessellation later.
Also rename load_const to buffer_load_const to distinguish it from indexed
const loads.

v2: add comments

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:35:44 +02:00
Marek Olšák
55a9b778c8 radeonsi: statically declare resource and sampler arrays
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:48 +02:00
Marek Olšák
e827bb6fe7 radeonsi: remove conversion of DX9 FACE input to GL
st/mesa and gallium expect the DX9 format, so this is useless.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:41 +02:00
Marek Olšák
a18f803a86 radeonsi: revert hack for random failures in glsl-max-varyings
This reverts commit 032e5548b3.

I've run glsl-max-varyings 30 times and it always passed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:29 +02:00
Marek Olšák
b9b0973db2 radeonsi: generate shader pm4 states right after shader compilation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:26 +02:00
Marek Olšák
c94af8f0d7 radeonsi: make pm4 state generation for shaders independent of the context
The si_pm4_delete_state calls became useless, because the pm4 state is
always generated only once.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:22 +02:00
Marek Olšák
139bde061a radeonsi: inline si_pm4_alloc_state
It seemed like the function needed a context pointer. Let's remove it
to make it less confusing.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-21 22:17:15 +02:00
Marek Olšák
22c5886f3f r300g: replace r300_get_num_samples with a util variant 2014-10-21 22:03:55 +02:00
Marek Olšák
013850a1b7 glsl_to_tgsi: use _mesa_copy_linked_program_data
This deduplicates some code.
2014-10-21 22:01:16 +02:00
Marek Olšák
9ec305ead7 glsl_to_tgsi: fix the value of gl_FrontFacing with native integers
We must convert it to boolean from the DX9 float encoding that Gallium
specifies.

Later, we should probably define that FACE should be 0 or ~0 if native
integers are supported.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-10-21 22:01:16 +02:00
Marek Olšák
e8764a4673 st/mesa: add ST_DEBUG=wf option which enables wireframe rendering
Useful for tessellation.
2014-10-21 22:01:16 +02:00
Marek Olšák
5f5b83cbba gallium: add PIPE_SHADER_CAP_MAX_OUTPUTS and use it in st/mesa
With 5 shader stages and various combinations of enabled and disabled shaders,
the maximum number of outputs in one shader doesn't have to be equal to
the maximum number of inputs in the following shader.

v2: return 32 for softpipe and llvmpipe
2014-10-21 21:59:02 +02:00
Eric Anholt
ef280c95f2 vc4: Fix SRC_ALPHA_SATURATE blending.
Fixes glean blendFunc.
2014-10-21 15:46:48 +01:00
Eric Anholt
cc298023c9 vc4: Fix stencil writemask handling.
If the writemask doesn't compress, then we want to put in the uncompressed
writemask, not the compressed writemask failure value (all-on).

Fixes glean's stencil2 and fbo-clear-formats on stencil.
2014-10-21 15:16:41 +01:00
Eric Anholt
48f6351940 vc4: Don't look at back stencil state unless two-sided stencil is enabled.
Fixes regressions in the next bugfix, because gallium util stuff leaves
the back stencil state as 0 if !back->enabled.
2014-10-21 15:16:41 +01:00
Rob Clark
4f17e026bb freedreno/ir3: add debug flag to disable cp
FD_MESA_DEBUG=nocp will disable copy propagation pass.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Ilia Mirkin
f0ca26725e freedreno: positions come out as integers, not half-integers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Rob Clark
3fcb021201 freedreno/a3xx: disable early-z when we have kill's
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Rob Clark
8a0ffedd8d freedreno/ir3: fix potential gpu lockup with kill
It seems like the hardware is unhappy if we execute a kill instruction
prior to last input (ei).  Probably the shader thread stops executing
and the end-input flag is never set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Rob Clark
ab33a24089 freedreno/ir3: comment + better fxn name
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Rob Clark
94bb33617d freedreno/a3xx: only emit dirty consts
If app only updates (for example) vertex uniforms, it would be nice to
only re-emit those and not also frag uniforms.  Means we need to mark
the first frag shader const buffer dirty after a clear.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Rob Clark
74069e324e freedreno/a3xx: more layer/level fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-20 21:42:44 -04:00
Brian Paul
aafbd89c5e mesa: fix 'feeedback' typo in comment
Trivial.
2014-10-20 11:53:34 -06:00
Brian Paul
4676c6c25b mesa: fix 'misalgned' typos in error messages
Trivial.
2014-10-20 11:50:49 -06:00
Brian Paul
14379a0644 glsl: fix several use-after-free bugs
The get_variable_being_redeclared() function can free the 'var' argument.
Thereafter, we cannot assume that 'var' is a valid  pointer.  This patch
replaces 'var->name' with 'earlier->name' in two places and calls
is_gl_identifier(var->name) before 'var' might get freed.

This fixes several piglit GLSL crashes, including:
spec/glsl-1.50/execution/geometry/clip-distance-in-param
spec/glsl-1.50/execution/geometry/clip-distance-bulk-copy
spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-global-redeclaration.geom

I'm not sure why these were not spotted sooner.
A similar bug was previously fixed by f9cecca7a.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-20 08:59:32 -06:00
Tapani Pälli
953a0af8e3 mesa: validate sampler uniforms during gluniform calls
Patch fixes 'glsl-2types-of-textures-on-same-unit' in WebGL conformance
test suite. No Piglit regressions, fixes gl-2.0-active-sampler-conflict.

To avoid adding potentially heavy check during draw (valid_to_render),
check is done during uniform updates by inspecting TexturesUsed mask.

A new boolean variable is introduced to cache validation state.

v2: take into account case where 2 uniforms use same unit (curro)
    also do the check only when SSO is not in use, SSO has own
    path for sampler validation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 11:07:12 +03:00
EdB
01d94193ac clover: Don't return CL_INVALID_VALUE if there is no header.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 10:35:10 +03:00
EdB
aa93af809f clover: Add allow_empty_tag.
To allow empty objs() list checks.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 10:35:10 +03:00
EdB
611d66fe45 clover: Add initial implementation of clCompileProgram for CL 1.2.
[ Francisco Jerez: General clean-up. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 10:34:51 +03:00
EdB
fead2b0463 clover: Add a simple compat::pair.
std::pair is not c++98/c++11 safe.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 10:33:02 +03:00
Francisco Jerez
5583459655 clover/util: Allow using key_equals with pair-like objects other than std::pair. 2014-10-20 10:33:02 +03:00
Francisco Jerez
e987fd5dc6 clover/util: Define equality operators for a couple of compat classes. 2014-10-20 10:33:01 +03:00
Francisco Jerez
1441a3c1bb clover/util: Fix construction of compat::vector with a general container as argument. 2014-10-20 10:33:01 +03:00
Tapani Pälli
73dd50acf6 glsl: implement switch flow control using a loop
Patch removes old variable based logic for handling a break inside
switch. Switch is put inside a loop so that existing infrastructure
for loop flow control can be used for the switch, now also dead code
elimination works properly.

Possible 'continue' call inside a switch needs now special handling
which is taken care of by detecting continue, breaking out and calling
continue for the outside loop.

v2: remove one unnecessary ir_expression (Curro)

Fixes following Piglit tests:

   fs-exec-after-break.shader_test
   fs-conditional-break.shader_test

No Piglit or es3conform regressions.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-20 07:55:58 +03:00
Eric Anholt
6212d2402d vc4: Translate 4-byte index buffers to 2 bytes.
Fixes assertion failures in 14 piglit tests (half of which now pass).
2014-10-19 08:44:56 +01:00
Eric Anholt
572fba95e4 vc4: Add support for rebasing texture levels so firstlevel == 0.
GLES2 doesn't have GL_TEXTURE_BASE_LEVEL, so the hardware doesn't.  Fixes
piglit levelclamp, tex-miplevel-selection, and texture-storage/2D mipmap
rendering.
2014-10-19 08:42:33 +01:00
Eric Anholt
15eb4c59f6 vc4: Apply a Newton-Raphson step to improve RSQ
Fixes all the piglit built-in-functions/*sqrt tests, among others.
2014-10-18 10:08:59 +01:00
Eric Anholt
1fc124b80f vc4: Apply a Newton-Raphson step to improve RCP.
Fixes all the piglit floating-point *-op-div tests, among others.
2014-10-18 10:08:59 +01:00
Eric Anholt
0fdc5111b4 vc4: Add a little bit more packet parsing to make dump reading easier.
Probably should have done this *before* staring at all those render lists
today.
2014-10-18 10:08:59 +01:00
Chris Forbes
81041c4a4a meta/msaa-blit: consider weird sample count case unreachable
Suppresses a bunch of warning noise about sample_map possibly being used
uninitialized.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-18 19:09:28 +13:00
Jason Ekstrand
4656c14e57 i965/fs: Change the type of booleans to UD and emit correct immediates
Before, we used the a signed d-word for booleans and the immedates we
emitted varried between signed and unsigned.  This commit changes the type
to unsigned (I think that makes more sense) and makes immediates more
consistent.  This allows copy propagation to work better cleans up some
instructions.

total instructions in shared programs: 5473519 -> 5465864 (-0.14%)
instructions in affected programs:     432849 -> 425194 (-1.77%)
GAINED:                                27
LOST:                                  0

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-17 13:36:48 -07:00
Kenneth Graunke
ffe582aa20 i965/fs: Don't pass ir_variable * to emit_sampleid_setup().
gl_SampleID is a built-in variable that always is of type "int".

Suggested by Connor Abbott.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-10-17 13:03:18 -07:00
Eric Anholt
9ebfb3014e vc4: Make some assertions about how many flushes/EOFs the simulator sees.
This caught the previous commit's bug in the kernel validator.
2014-10-17 13:13:43 +01:00
Eric Anholt
1f7048419e vc4: Fix accidental dropping of the low bits of the store tilebuffer packet.
Notably this included the EOF flag (the other bits are the full buffer
dump selection, but we don't do full dumps), which caused the kernel
checking for frame completion to trigger.
2014-10-17 13:09:29 +01:00
Eric Anholt
afc3aa373d vc4: Set the primitive list format at the start of rendering.
The other driver does this manually before calling into each tile, but we
can just let it get binned into the tiles (saving repeated kernel
validation on the packet).

Fixes simulator assertion failures on polygon-mode and non-auto texwrap.
2014-10-17 13:09:28 +01:00
Eric Anholt
895c904103 vc4: Replace the FLUSH_ALL with FLUSH.
We don't need to emit all of our current state at the end of each bin
list.  We're going to be smashing it all at the start of the next tile's
bin list, anyway.
2014-10-17 13:09:28 +01:00
Eric Anholt
000976ed99 vc4: Add some comments about state management. 2014-10-17 13:09:28 +01:00
Eric Anholt
135287db17 vc4: Make sure there's exactly 1 tile store per tile coords packet.
It's not documented that I can see, but the other driver does it (check
vg_hw_4.c), and one of the HW guys confirmed that you really do need to do
it.
2014-10-17 13:09:25 +01:00
Michel Dänzer
c4db733fac winsys/radeon: Use a single buffer cache manager again
The trick is to generate a unique buffer usage value for each possible
combination of domains and flags, with only one bit set each for the
domains and flags. This ensures pb_check_usage() only returns TRUE when
the domains and flags the cached buffer was created for exactly match
the requested ones.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-17 17:09:49 +09:00
Tom Stellard
e1d363b3ff clover: Add environment variables for dumping kernel code v2
There are two debug variables:

CLOVER_DEBUG which you can set to any combination of llvm,clc,asm
(separated by commas) to dump llvm IR, OpenCL C, and native assembly.

CLOVER_DEBUG_FILE which you can set to a file name for dumping output
instead of stderr.  If you set this variable, the output will be split
into three separate files with different suffixes: .cl for OpenCL C,
.ll for LLVM IR, and .asm for native assembly.  Note that when data
is written, it is always appended to the files.

v2:
  - Code cleanups
  - Add CLOVER_DEBUG_FILE environment variable for dumping to a file.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 19:42:52 -04:00
Tom Stellard
76136c29bb clover: Register an llvm diagnostic handler v3
This will allow us to handle internal compiler errors.

v2:
  - Code cleanups.

v3:
  - More cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 19:42:41 -04:00
Tom Stellard
8e7df519bd clover: Add support for compiling to native object code v3
v2:
  - Split build_module_native() into three separate functions.
  - Code cleanups.

v3:
  - More cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 19:42:30 -04:00
Tom Stellard
8b7cc90cef gallium: Add PIPE_SHADER_IR_NATIVE to enum pipe_shader_ir
Drivers can return this value for PIPE_COMPUTE_CAP_IR_TARGET
if they want clover to give them native object code.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 19:42:22 -04:00
Tom Stellard
dc39b32c9b clover: Factor kernel argument parsing into its own function v2
v2:
  - Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 19:42:14 -04:00
Marek Olšák
833d698ad5 st/mesa: use pipe_sampler_view_release for releasing sampler views
This fixes a crash when exiting Firefox. I have really no idea how Firefox
does it. It seems to involve multiple contexts and multithreading.

v2: added an XXX comment

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

Acked by Christian König.
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Benjamin Bellec <b.bellec@gmail.com>
2014-10-16 23:31:20 +02:00
Kenneth Graunke
63c6509ad2 mesa: Drop the "target" parameter from NewBufferObject().
NewBufferObject took a "target" parameter, which it blindly passed to
_mesa_initialize_buffer_object(), which ignored it.

Not much point in passing it around.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-16 10:56:19 -07:00
Andres Gomez
af31f930ab glsl: Update and fix typos in README. 2014-10-16 09:38:36 -07:00
Chris Forbes
2883aff3be i965: Flag BRW_ATOMIC_COUNTER_BUFFER when a possible ABO is respecified
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 22:31:44 +13:00
Chris Forbes
7bd6dfe934 mesa: Mark buffer objects that are used as atomic counter buffers
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 22:31:44 +13:00
Chris Forbes
f1261db1ee i965/disasm: Add missing message type for Gen7 DP untyped surface read
This is used to implement GLSL's atomicCounter() intrinsic. Previously
it *worked*, but the disassembly was bogus.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 22:31:43 +13:00
Chris Forbes
0dc56600aa i965: Correctly use ABO count to trigger flagging of new surfaces.
This would have *almost never* actually been an issue, since other state
tends to get flagged at the same time as new ABOs -- but still bogus.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-16 22:31:43 +13:00
Chris Forbes
25189c72ce i965: No longer reemit textures on BRW_NEW_UNIFORM_BUFFER
This didn't make any sense, but papered over the missing TexBO flagging
we've just fixed, in a bunch of cases.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
1655f6fc61 i965: Dirty state in BO reallocation based on usage history
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
c442745981 i965: Have mesa flag BRW_NEW_TEXTURE_BUFFER when a TexBO binding changes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
be5df28941 i965: Add new dirty flag for new TexBOs.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
8db38ba4d2 mesa: Mark buffer objects that are used as TexBOs
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
fe3133fe78 mesa: Mark buffer objects which are bound as UBOs
When a buffer object is bound to one of the indexed uniform buffer
binding points, assume that from that point on it may be used as
a uniform buffer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Chris Forbes
3d989467f1 mesa: Add usage history bitfield to buffer objects
In the drivers, we occasionally want to reallocate the backing
store for a buffer object; often to avoid waiting for the GPU
to be finished with the previous contents.

At the point that happens, we don't have a good way of determining
where else the buffer object may be bound, and so no good way of
determining which dirty flags need to be raised -- it's fairly
expensive to go looking at all the possible binding points.

Until now, we've considered any BO to be possibly bound as a UBO or
TexBO, and flagged all that state to be reemitted.

Instead, remember what kinds of binding point this buffer has ever
been used with, so that the drivers can flag only what they need.
I don't expect these bits to ever be reset, but that doesn't matter
for reasonable apps.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-10-16 22:31:43 +13:00
Emil Velikov
79d09a4b12 vc4: correctly include the source files
The kernel files are built into a separate static library and
all the functions that require it are already wrapped in ifdef
USE_VC4_SIMULATOR. Don't forget the header file :)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-10-16 10:00:14 +01:00
Connor Abbott
70fa53be5e i965/fs: don't make a fake ir_texture in the Mesa IR frontend
Now that we've made all the texture emit code mostly independent of GLSL
IR, this isn't necessary any more.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:25 -07:00
Kenneth Graunke
b17f571945 i965/fs: Refactor the texture emission logic into a single function.
Before, we had 3 different emit functions for various different gen's,
as well as some ancilliary work that was the same across all gen's which
was either contained in functions or duplicated across the GLSL IR and
Mesa IR backends. Now, we have a single method, emit_texture(), that
takes all the information needed to make a texture instruction and
handles all the setup, and all we have to do to emit a texture
instruction while converting from GLSL IR, Mesa IR, or any new backend
is to extract the information emit_texture() needs and then call it.

v2: Significant rebasing (by Ken).

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:22 -07:00
Connor Abbott
9e95d8ebf8 i965/fs: Make gather_channel() not use ir_texture.
Our new IR won't have ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:20 -07:00
Connor Abbott
12d9a8cd86 i965/fs: Make swizzle_result() not use ir_texture.
Our new IR won't have ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:19 -07:00
Connor Abbott
cf94dfdb96 i965/fs: fix integer textures with swizzles
This happened to work before, but it would convert the output to a float
and then back to an integer which seems bad.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:16 -07:00
Connor Abbott
7c8f0b7cd9 i965/fs: don't pass in ir_texture to emit_texture_*
At this point, the only thing it's used for is the opcode.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:14 -07:00
Connor Abbott
4bffcb7e8e i965/fs: don't use ir->type in emit_texture_gen4()
We already have the type from the original destination.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:05 -07:00
Connor Abbott
eaadc43192 i965/fs: Don't use ir->lod_info.grad.dPd<x,y> in emit_texture_*.
This drops a dependency on ir_texture objects.

v2 (Ken): Rename lod_components to grad_components, as it only has a
          meaningful value for ir_txd.  We could set it to 1 for TXL,
          but there's no real need.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:05:00 -07:00
Connor Abbott
cbde5407c9 i965/fs: Don't use ir->coordinate in emit_texture_*.
This drops a dependency on ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:58 -07:00
Connor Abbott
a8905e8c09 i965/fs: make rescale_texcoord() not use ir_texture.
Our new IR won't have ir_texture objects, but using glsl_type is fine.

v2 (Ken): Drop redundant ir->coordinate NULL check; rebase.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:56 -07:00
Connor Abbott
e599837fed i965/fs: Make emit_mcs_fetch() not use ir_texture.
Our new IR won't have ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:54 -07:00
Kenneth Graunke
465373535e i965/fs: Rename "length" to "components" in emit_mcs_fetch().
This is slightly clearer.  Based on a patch by Connor Abbott.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:52 -07:00
Connor Abbott
fa212c6b98 i965: Make brw_texture_offset() not use ir_texture.
Our new IR won't have ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:50 -07:00
Connor Abbott
a71455bc99 i965/fs: don't use ir->offset in emit_texture_gen5.
v2 (Ken): Refactor the Gen7 code separately; rebase.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:47 -07:00
Kenneth Graunke
1f76fcf231 i965/fs: Move texel offset handling to visit(ir_texture *).
This moves the handling of non-constant texel offset subexpression trees
to the place where we visit other such subtrees.  It also removes some
uses of ir->offset in emit_texture_gen7, which will be useful when we
write the backend for our new upcoming IR.

Based on a patch by Connor Abbott.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:45 -07:00
Kenneth Graunke
cee2027574 i965: Drop ir->op != ir_txf condition in offset checking.
brw_lower_unnormalized_offset sets ir->offset to NULL if it applies the
texelFetchOffset workarounds, so there's no need to special case it
here---there won't be an offset for ir_txf.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:43 -07:00
Kenneth Graunke
a2c3cfbb4d i965: Restore a lost comment about TXF offset bugs.
Eric's original code to work around TXF offset bugs contained a comment
explaining the problem, which was lost when Chris generalized it to an
IR transformation (in commit 598ca510b8).

This commit adds the original comment to the newer code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-15 17:04:27 -07:00
Rob Clark
652b8fbbbb freedreno/ir3: large const support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:49 -04:00
Rob Clark
e71a3f80fb freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Rob Clark
dd332fe641 freedreno: fix layer_stride
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Rob Clark
8233b36a17 freedreno: inline fd_draw_emit()
Manual LTO

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Rob Clark
368466b7b7 freedreno/ir3: optimize shader key comparision
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Rob Clark
d595987ea3 freedreno/a3xx: refactor/optimize emit
Because we reuse various bits of emit code (for state/vertex/prog/etc)
for both regular draws and internal draws (gmem<->mem, clear, etc), the
number of parameters getting passed around has been growing.  Refactor
to group these into fd3_emit.  This simplifies fxn signatures, avoids
passing around shader key on the stack, etc.  It also gives us a nice
place to cache shader-variant lookup to avoid looking up shader variants
multiple times per draw (without having to *also* pass them around as
fxn args everywhere).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Rob Clark
d5d80b3739 freedreno/a3xx: refactor vertex state emit
Get rid of fd3_vertex_buf and use fd_vertex_state directly for all
draws.  Removes a tiny bit of CPU overhead for munging around the vertex
state every time it is emitted, but more importantly it cleans things up
for later optimizations, so the emit paths don't have to special case
internal draws (gmem<->mem, clears, etc) with regular draws.

Instead of constructing fd3_vertex_buf array each time for internal
draws, and context init time pre-create solid_vbuf_state and
blit_vbuf_state.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-15 15:49:48 -04:00
Eric Anholt
57de9bbb63 vc4: Fix the uniform debug output.
I dropped the shader index when moving to the compiled shader struct, but
didn't update the format string here.
2014-10-15 18:12:03 +01:00
Eric Anholt
201d4c0b2a vc4: Add support for user clip plane and gl_ClipVertex.
Fixes about 15 piglit tests about interpolation and clipping.
2014-10-15 18:11:46 +01:00
Eric Anholt
6a0bf67048 vc4: Move the output semantics setup to a helper.
I want to reuse it elsewhere to set up outputs that aren't in the TGSI.
2014-10-15 18:11:46 +01:00
Kenneth Graunke
39a5a60b57 i965: Allow CSE on Gen4-5 unary math.
Due to the implicit move-from-GRF, unary math looks a lot like the Gen6+
math instruction: it's a single instruction (SEND) with a GRF source.
The difference is that it also implicitly clobbers a message register.

The only visible effect is that CSE will remove the MRF-clobbering from
later math operations.  This should be fine; compute_to_mrf and
remove_redundant_mrf_writes don't look at the values populated by
implied writes, so they can't rely on those values being present.
Less interference may actually help those passes make more progress.

Binary math is still problematic, since it involves a separate MOV
instruction to load the second operand.  We continue disallowing CSE for
binary math operations.

total instructions in shared programs: 3340303 -> 3340100 (-0.01%)
instructions in affected programs:     26927 -> 26724 (-0.75%)
Nothing hurt, gained, or lost.  ~6% reduction on a few shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-15 08:44:54 -07:00
Michel Dänzer
159f93cf39 r600g,radeonsi: Only set use_staging_texture = TRUE once
No need to check for setting the flag after we set it already.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-15 16:26:30 +09:00
Michel Dänzer
87da286755 r600g,radeonsi: Use staging texture for transfers if any miplevel is tiled
We set the NO_CPU_ACCESS flag for BO allocation in that case, so direct CPU
access may not work.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-15 16:26:14 +09:00
Michel Dänzer
3ede67a4c6 winsys/radeon: Use separate caching buffer manager for each set of flags
Otherwise the caching buffer manager may return a buffer which was created
with a different set of flags, which can cause trouble.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-15 16:11:40 +09:00
Andres Gomez
657764c21c configure.ac: check for libexpat when no pkg-config is available
Previously, when no pkg-config was available for
libexpat we would just add the needed linking
flags without any extra check.

Now, we check that the library and the headers are
also installed in the building environment.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-15 08:59:12 +02:00
Tom Stellard
8cf6482c3d clover: Fix regression in module serialization
We need to serialize semantic information for arguments, which was added
in 06139c56fa.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-14 17:58:06 -04:00
Jason Ekstrand
3435aa49f4 i965/fs: Use the correct regs_written on unspill instructions
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-14 12:39:45 -07:00
Ilia Mirkin
742158b51e st/gbm: fix order of arguments passed to is_format_supported
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: mesa-stable@lists.freedesktop.org
2014-10-14 12:33:38 -04:00
Ilia Mirkin
5524af8136 nouveau: 3d textures are unsupported, limit 3d levels to 1
Ideally there would be a swrast fallback, but the driver isn't ready for
that. This should avoid crashes if someone tries to use 3d textures
though.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: mesa-stable@lists.freedesktop.org
2014-10-14 12:33:38 -04:00
Rob Clark
abe3b3d1e0 freedreno: use tgsi_lowering
Now that the freedreno_lowering code is moved to tgsi_lowering, remove
our private copy and switch over to using the common version.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-14 12:30:08 -04:00
David Heidelberger
d2c1d9693f r300/compiler: remove useless check
This code is already in if (!variable->C->is_r500) so no need check
twice.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
2014-10-14 12:18:32 -04:00
Nick Sarnie
e5bf8d38db ilo: Build pipe-loader for ilo
Trivial patch to create the pipe loader for ilo. All the code was already there.

Signed-off-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-14 16:16:08 +01:00
Emil Velikov
af897df508 automake: explicitly set TARGET_RADEON_{WINSYS,COMMON}
Originally the variables were set only once via the ?= operator but
that causes issues when doing incremental builds. They appear to be
undefined and missing from the dependency list despite their addition
to LIBADD.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84807
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-14 16:16:08 +01:00
Eric Anholt
a2d8b6dbd5 vc4: Fix render target NPOT alignment at small miplevels.
The texturing hardware takes the POT level 0 width/height and minifies
those.  This is different from what we were doing, for example, for
273-wide's level 5: POT(273>>5) == 8, while POT(273)>>5 == 16.

Fixes piglit-depthstencil-render-miplevels 273.
2014-10-14 14:57:50 +01:00
Eric Anholt
b5fc9d5664 vc4: Add support for having 0 vertex elements used.
You have to load at least 1, according to the simulator.  Fixes 4 piglit
tests and even more ES2 conformance tests.
2014-10-14 11:29:48 +01:00
Vinson Lee
a2fd55cfb6 auxilary/os: Add DragonFly BSD support in os_get_total_physical_memory.
This patch fixes this build error on DragonFly BSD.

  CC       os/os_misc.lo
os/os_misc.c: In function 'os_get_total_physical_memory':
os/os_misc.c:132:2: error: #error Unsupported *BSD

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-13 23:40:46 -07:00
Daniel Manjarres
291be28476 glx: Fix glxUseXFont for glxWindow and glxPixmaps
The current implementation of glxUseXFont requires creating
a temporary pixmap and graphics context, which requires a real
old-school X11 Window, not a glxDrawable. This patch changes
things so that glxUseXFont will also accept a glxWindow or
glxPixmap, and lookup the underlying X11 Drawable. Without
this patch glxUseXFont generates a giant stream of Xerrors
about bad drawables and bad graphics contexts.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-10-13 22:05:58 -06:00
Chia-I Wu
4e2cf84b1f ilo: clear writer pointer after unmapping
It does not look like an issue now but it is good to be future proof.  Spotted
by Courtney Goeltzenleuchter.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-14 08:54:25 +08:00
Eric Anholt
615bbf0ca6 vc4: Write the VPM read setup multiple times to queue all the inputs.
There's a 4-element fifo, and the size (number of dwords per vertex) field
is just 4 bits.

Fixes glsl-routing on sim.
2014-10-13 17:16:05 +01:00
Eric Anholt
e1d1c39626 vc4: Add support for the TXL opcode.
There's a bit at the bottom of cube map stride (which has some formatting
bugs in the docs) which flips the bias coordinate to being an absolute
LOD.
2014-10-13 17:15:47 +01:00
Eric Anholt
5bc91b6e32 vc4: Improve the accuracy of SIN and COS.
This gets them to pass glsl-sin/cos.  There was an obvious problem that I
was using the FRC code on the scaled input value, which means that we had
a range in [0, 1], while our taylor is most accurate across [-0.5, 0.5].
We can just slide things over, but that means flipping the sign of the
coefficients.  After that, it was just a matter of stuffing more
coefficients in.
2014-10-13 17:15:47 +01:00
Kenneth Graunke
02ca66fbc3 i965: Use unsynchronized maps for the program cache on LLC platforms.
There's no reason to stall on pwrite - the CPU always appends to the
buffer and never modifies existing contents, and the GPU never writes
it.  Further, the CPU always appends new data before submitting a batch
that requires it.

This code predates the unsynchronized mapping feature, so we simply
didn't have the option when it was written.

Ideally, we would do this for non-LLC platforms too, but unsynchronized
mapping support only exists for LLC systems.

Saves a bunch of stall avoidance copies when uploading shaders.

v2: Rebase on changes to previous patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> [v1]
2014-10-13 06:55:08 -07:00
Kenneth Graunke
4c766c7959 i965: Issue performance warnings when copying the program cache BO.
We don't really want unnecessary buffer copying, so it'd be nice to know
when it's happening.

v2: Drop stall warnings when doing a read-only CPU mapping of the cache
    BO.  The GPU also uses it in a read-only fashion, so there won't be
    any stalls, even though the buffer is busy.  (Thanks to Chris Wilson
    for catching this mistake.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> [v1]
2014-10-13 06:53:54 -07:00
Kenneth Graunke
a4fe727a5d i965: Issue performance warnings on MapBufferRange stalls.
This is easy: we just need to use brw_map_bo instead of mapping it
directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-10-13 06:44:05 -07:00
Eric Anholt
5d72a1c956 vc4: Match VS outputs to FS inputs.
If the VS doesn't output a value that the FS needs, we still need to read
the right contents for the remaining FS inputs, by emitting padding.  And
if the VS outputs something the FS doesn't need, we shouldn't put it in
the VPM at all (so the code producing it can get DCEed).

Fixes 77 piglit tests.
2014-10-13 13:23:48 +01:00
Christian König
d561a42bc1 configure: use $libdir/dri as default for VA-API
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-13 12:43:59 +02:00
Christian König
966ae170b0 configure: remove superflous VA-API line from configure.ac
We don't have GALLIUM_STATE_TRACKERS_DIRS any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-13 12:43:54 +02:00
Christian König
d3004a267a configure: respect $libdir for the OMX installation dir
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-13 12:43:49 +02:00
Christian König
5ce06d12ff configure: Revert "ask vdpau.pc for the default location of the vdpau drivers"
This reverts commit bbe6f7f865.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-13 12:43:05 +02:00
Eric Anholt
83365a5b57 vc4: Add support for the CEIL opcode.
Not as big of a deal as SSG, but still +9 piglit tests.
2014-10-13 08:06:48 +01:00
Eric Anholt
926eaa9af4 vc4: Add support for the SSG opcode. 2014-10-13 08:06:48 +01:00
Emil Velikov
b86f814afd docs: add news item and link release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-13 02:14:02 +01:00
Emil Velikov
fc6345a916 docs: Add sha256 sums for the 10.3.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit fa98c74692)
2014-10-13 02:06:29 +01:00
Emil Velikov
04fae07f0e Add release notes for the 10.3.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 088d350178)
2014-10-13 02:06:20 +01:00
Emil Velikov
66ea8a581d docs: Add sha256 sums for the 10.2.9 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 52bd154980)
2014-10-13 02:05:53 +01:00
Emil Velikov
f5e61295cd Add release notes for the 10.2.9 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9f1149876f)
2014-10-13 02:05:22 +01:00
Glenn Kennard
a327fa3a06 r600g: Implement GL_ARB_sample_shading
Also fixes two sided lighting which was broken at least
on pre-evergreen by commit b1eb00.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
75e97e2e3f radeonsi: use tgsi_shader_info in si_llvm_emit_fs_epilogue
This is the last use tgsi_parse_token in radeonsi.

It looks ugly because the code was re-indented, but there is really no change
in behavior.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
558f7770a7 radeonsi: remove si_shader_output_values::index
It's redundant now.

It led to a simplification in si_llvm_emit_streamout, because outidx == reg.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
ec0d16872b radeonsi: use tgsi_shader_info in si_llvm_emit_vs_epilogue
That code was really ugly.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
8067732740 radeonsi: remove shader->input[] and output[] arrays and dependencies
They were reinventing tgsi_shader_info. They are unused now.

radeon_llvm_context::load_input can be NULL if input fetching is implemented
in some other way.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
8b057ddaea radeonsi: move param_offset out of shader->input[] and output[]
Those are going away.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:57 +02:00
Marek Olšák
02134cfaae radeonsi: use tgsi_shader_info to get a list of GS outputs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:54 +02:00
Marek Olšák
101905d3f7 radeonsi: use tgsi_shader_info in si_update_spi_map
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:54 +02:00
Marek Olšák
6f04cf7fac radeonsi: simplify dereferences in si_update_spi_map
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:54 +02:00
Marek Olšák
639f6b41d2 radeonsi: use tgsi_shader_info in si_shader_vs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:54 +02:00
Marek Olšák
fa933438a2 radeonsi: use tgsi_shader_info in si_shader_ps
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:54 +02:00
Marek Olšák
e23fec1445 radeonsi: use tgsi_shader_info in fetch_input_gs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:53:51 +02:00
Marek Olšák
7a645c5366 radeonsi: don't rely on shader->output in si_llvm_emit_fs_epilogue
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:52:16 +02:00
Marek Olšák
216cf86ec4 radeonsi: use tgsi_shader_info in si_llvm_emit_es_epilogue
tgsi_shader_info contains everything we need.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:52:13 +02:00
Marek Olšák
34e8200599 radeonsi: don't recompile shaders when changing nr_cbufs from 0 to 1
Both cases are equivalent.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:52:07 +02:00
Marek Olšák
5e0fbe1b63 radeonsi: remove vs.ucps_enabled from the shader key
Written CLIPDIST outputs are simply disabled in PA_CL_VS_OUT_CNTL.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:52:02 +02:00
Marek Olšák
a9592cd3ac radeonsi: assume ClipDistance usage mask is always 0xf
No code in Mesa sets the usage mask to any other value.
The final mask is AND'ed with enable bits from the rasterizer state anyway.

If somebody implements setting usage masks in st/mesa, we can use
tgsi_shader_info to get it more easily.

This is a prerequisite for the following commit.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-12 23:51:44 +02:00
Francisco Jerez
2286edce16 clover: Fix unintended fall-through in kernel::argument::bind. 2014-10-12 11:44:05 +03:00
Jan Vesely
5bffc5e262 clover: Append implicit arguments to the kernel argument list.
[ Francisco Jerez: Split off from a larger patch, and take a slightly
  different approach for passing the implicit arguments around. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-12 01:50:13 +03:00
Francisco Jerez
bf89a97748 clover: Pass execution dimensions and offset to the kernel as implicit arguments.
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-10-12 01:44:19 +03:00
Francisco Jerez
06139c56fa clover: Add semantic information to module::argument for implicit parameter passing.
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-10-12 01:39:21 +03:00
Francisco Jerez
27c51b5f58 clover: Use unreachable() from util/macros.h instead of assert(0).
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-11 12:44:09 +03:00
Vinson Lee
5480d6b13f gallium: Add tokens for DragonFly BSD.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Brian Paul <brianp@vmware.com>
2014-10-10 21:32:35 -07:00
Chia-I Wu
566d1889ea ilo: disassemble compacted instructions
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-11 11:55:50 +08:00
Erik Faye-Lund
326e303175 glsl: improve accuracy of atan()
Our current atan()-approximation is pretty inaccurate at 1.0, so
let's try to improve the situation by doing a direct approximation
without going through atan.

This new implementation uses an 11th degree polynomial to approximate
atan in the [-1..1] range, and the following identitiy to reduce the
entire range to [-1..1]:

atan(x) = 0.5 * pi * sign(x) - atan(1.0 / x)

This range-reduction idea is taken from the paper "Fast computation
of Arctangent Functions for Embedded Applications: A Comparative
Analysis" (Ukil et al. 2011).

The polynomial that approximates atan(x) is:

x   * 0.9999793128310355 - x^3  * 0.3326756418091246 +
x^5 * 0.1938924977115610 - x^7  * 0.1173503194786851 +
x^9 * 0.0536813784310406 - x^11 * 0.0121323213173444

This polynomial was found with the following GNU Octave script:

x = linspace(0, 1);
y = atan(x);
n = [1, 3, 5, 7, 9, 11];
format long;
polyfitc(x, y, n)

The polyfitc function is not built-in, but too long to include here.
It can be downloaded from the following URL:

http://www.mathworks.com/matlabcentral/fileexchange/47851-constraint-polynomial-fit/content/polyfitc.m

This fixes the following piglit test:
shaders/glsl-const-folding-01

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-10 20:44:27 +02:00
Eric Anholt
070b2c2efc vc4: Use the fnv1 hash function instead of gallium util's crc32.
Improves simulated norast performance on a little benchmark by 13.4012%
+/- 2.08459% (n=13).
2014-10-10 15:49:34 +02:00
Eric Anholt
d09509da2a vc4: Don't look up the compiled shaders unless state has changed.
Improves simulated norast performance on a little benchmark by 38.0965%
+/- 3.27534% (n=11).
2014-10-10 15:49:22 +02:00
Eric Anholt
c6f50c4086 vc4: Actually clear the context's dirty flags.
I was trying to skip state updates when !dirty, and suspiciously
everything was always dirty.
2014-10-10 15:03:13 +02:00
Eric Anholt
7c474f9f2e vc4: Optimize the other case of SEL_X_Y wih a 0 -> SEL_X_0(a).
Cleans up some output to be more obvious in a piglit test I'm looking at.
2014-10-10 15:03:12 +02:00
Tapani Pälli
ac557b4c12 mesa: fix error reported on gTexSubImage2D when level not valid
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-10-10 15:01:51 +03:00
Kenneth Graunke
94841b6d5d i965: Fix register write checks.
When mapping the buffer a second time, we need to use the new pointer,
not the one from the previous mapping.  Otherwise, we will most likely
crash.

Apparently, we've just been getting lucky and getting the same
bo->virtual pointer in both cases.  libdrm probably has a hand in that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-10-10 00:04:39 +02:00
Eric Anholt
7e67ea994c vc4: Optimize out adds of 0. 2014-10-09 21:47:06 +02:00
Eric Anholt
0401f55fff vc4: Optimize fmul(x, 0) and fmul(x, 1).
This was being generated frequently by matrix multiplies of 2 and
3-channel vertex attributes (which have the 0 or 1 loaded in the shader).
2014-10-09 21:47:06 +02:00
Eric Anholt
1cd8c1aab0 vc4: Factor out the turn-it-into-a-mov in opt_algebraic.
This will be used more in the next commits.
2014-10-09 21:47:06 +02:00
Eric Anholt
40748cf8d9 vc4: Eliminate unused texture instructions. 2014-10-09 21:47:06 +02:00
Eric Anholt
b73cab6826 vc4: Dead code eliminate unused SF instructions. 2014-10-09 21:47:06 +02:00
Eric Anholt
93cac2637b vc4: Prevent copy propagating out the MOVs from r4.
Copy propagating these might result in reading the r4 after some other
instruction has written r4.  Just prevent all copy propagation of this for
now.

Fixes bad rendering with upcoming indirect register access support, where
the copy propagation was consistently happening across another read.
2014-10-09 21:47:06 +02:00
Eric Anholt
c4b0dd5356 vc4: Split the coordinate shader to its own vc4_compiled_shader.
Merging VS and CS into the same struct wasn't winning us anything except
for not allocating a separate BO (but if we want to pack programs into
BOs, we should pack not just those 2 programs together).  What it was
getting us was a bunch of code duplication about hash table lookups and
propagating vc4_compile contents into a vc4_compiled_shader.

I was about to make the situation worse with indirect uniform buffer
access.
2014-10-09 21:47:06 +02:00
Eric Anholt
5c72d7706c vc4: Add #defines for the texture uniform fields.
I wanted to make another set of texture uploads for handling reladdr
constants, and duplicating all the bitshifting looked like a terrible
idea.  In the process, this fixes a swap of the s/t texture wrap modes.
2014-10-09 21:47:06 +02:00
Eric Anholt
5cfab07639 vc4: Initialize undefined temporaries to 0.
Under the simulator, reading registers before writing them triggers an
assertion failure.  c->undef gets treated as r0, which will usually be
written, but not if it's used in the first instruction.  We should
definitely not be aborting in this case, and return some sort of undefined
value instead.

Fixes glsl-user-varying-ff.
2014-10-09 21:47:06 +02:00
Kenneth Graunke
4ce11de4ae i965: Skip uploading border color when unnecessary.
The border color is only needed when using the GL_CLAMP_TO_BORDER or
(deprecated) GL_CLAMP wrap modes; all others ignore it, including the
common GL_CLAMP_TO_EDGE and GL_REPEAT wrap modes.

In those cases, we can skip uploading it entirely, saving a bit of space
in the batchbuffer.  Instead, we just point it at the start of the
batch (offset 0); we have to program something, and that address is safe
to read.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-09 15:43:18 +02:00
Kenneth Graunke
b7844d1248 i965: Use BDW_MOCS_PTE for renderbuffers.
Write-back caching cannot be used for buffers being scanned out by the
display engine; surfaces used for scan-out must be write-through or
uncached.  I originally chose WT for render targets because it works in
all cases.  However, we really want to use write-back caching where
possible, as it is more efficient.

Most renderbuffers are not used for scanout - off-screen FBOs certainly
are fine, and non-pageflipped backbuffers should be fine as well.  So
in most cases WB will work.  However, we don't know what will be used
for scan-out, so we instead simply use the PTE value specified by the
kernel, as it knows these things.

This matches our MOCS choice on Haswell.

Fixes performance regressions since commit ee4484be3d
in a microbenchmark (spotted by Eero Tamminen).  Improves performance
in GLBenchmark 2.7/EgyptHD by 7.44362% +/- 0.496939% (n=55) on a
Broadwell GT2.  Improves performance in a bunch of other microbenchmarks
by ~15% or so.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
2014-10-09 15:03:32 +02:00
Kenneth Graunke
d489a8a73d i965: Add a BRW_MOCS_PTE #define.
Like BDW_MOCS_WB and BDW_MOCS_WT, this specifies that we want to use all
three caches (L3, LLC, and eLLC where available), but leaves the LLC
caching mode up to the kernel's page table entry.

This allows the kernel to pick WB/WT/UC based on whether it's using a
buffer for scanout.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
2014-10-09 15:02:55 +02:00
Kenneth Graunke
8892a6b79c mesa: Make _mesa_print_arrays use stderr.
These days, most driver debug output happens via stderr, not stdout.
Some applications (such as Xephyr) also appear to close stdout which
makes these messages go nowhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-10-09 15:02:42 +02:00
Michel Dänzer
7b4276d7ac r600g,radeonsi: Always use GTT again for PIPE_USAGE_STREAM buffers
Putting those in VRAM can cause long pauses due to buffers being moved
into / out of VRAM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84662
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-09 18:11:44 +09:00
Eric Anholt
5a13522898 vc4: Optimize SF(ITOF(x)) -> SF(x).
This is a common production of st_glsl_to_tgsi, because CMP takes a float
argument.
2014-10-09 11:01:18 +02:00
Eric Anholt
00a9aebfe0 vc4: Add some optimization of FADD(FSUB(0, x)).
This is a common production of st_glsl_to_tgsi, which uses negate flags on
source arguments to handle subtraction.
2014-10-09 11:01:18 +02:00
Eric Anholt
67aea92964 vc4: Mostly fix offset calculation for NPOT mipmap levels.
The non-base NPOT levels are stored as POT-aligned images.  We get that
POT alignment by minifying the POT-aligned base level.

This means that level strides are also POT aligned, so we have to tell the
rendering mode config that our resource is larger than the actual
requested area.

Fixes the fbo-generatemipmap-formats NPOT cases.  Regresses
depthstencil-render-miplevels 273 * -- the texture presentation now works
(where it was completely broken before), it looks like there's some
overflow of image bounds happening at the lower miplevels.
2014-10-09 11:01:09 +02:00
Eric Anholt
0b96a086cb vc4: Move the mirrored kernel code to a kernel/ directory.
Now this whole setup matches the kernel's file layout much more closely.
2014-10-09 09:46:39 +02:00
Eric Anholt
ef9914aa74 vc4: Enable LIT lowering in TGSI instead of our own code.
This brings us the -128/128 clamping on the w component.
2014-10-08 22:47:39 +02:00
Eric Anholt
9773d45908 vc4: Fix scalar math opcodes to replicate their result from the X channel.
Thanks to robclark for pointing out that I was probably failing to do this
when I reported a "bug" in his lowering code.
2014-10-08 22:47:39 +02:00
Chia-I Wu
4e50a32be6 ilo: fix rectlist on GEN7+
It was broken by 343b014b57.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-09 03:37:04 +08:00
Eric Anholt
581418585e vc4: Add support for two-sided color.
It's fairly easy, thanks to Rob Clark's lowering code.  Fixes
two-sided-lighting and 4 vertex-program-two-side testcases, while
regressing 8 testcases that involve enabling two-sided color while only
initializing one of the two colors in the VS.  If you're enabling two
sided color, it's of course expected that you really do set up both
colors, so this is still an improvement (and when we set up a linker for
TGSI, we'll hopefully fix those 8 fails).
2014-10-08 17:45:16 +02:00
Eric Anholt
4dccdbf5cb vc4: Enable POW lowering in TGSI instead of our own code. 2014-10-08 17:42:59 +02:00
Eric Anholt
1aef5a337f vc4: Enable DP lowering in TGSI instead of our own code. 2014-10-08 17:42:59 +02:00
Eric Anholt
4f6e4c7370 vc4: Start using tgsi_lowering for opcodes we haven't supported before. 2014-10-08 17:42:59 +02:00
Eric Anholt
f9854e169f gallium: Rename freedreno parts of tgsi_lowering.[ch].
Acked-by: Rob Clark <robclark@freedesktop.org>
2014-10-08 17:42:59 +02:00
Eric Anholt
19df602b39 gallium: Reformat tgsi_lowering.c for the normal style.
Acked-by: Rob Clark <robclark@freedesktop.org>
2014-10-08 17:42:59 +02:00
Eric Anholt
3141dc8e87 gallium: Copy fd_lowering.[ch] to tgsi_lowering.[ch] for code sharing.
Lots of drivers need to transform the weird instructions in TGSI into
reasonable scalar ops, and this code can make those translations
canonical.

Acked-by: Rob Clark <robclark@freedesktop.org>
2014-10-08 17:42:59 +02:00
Eric Anholt
84caf5a861 vc4: Set unused raddr fields to QPU_R_NOP.
The simulator assertion fails if you have a write to a reg and then a read
(for example, in the NOP side of an instruction), even if the read isn't
used for anything.  By setting unused raddrs to NOP, we avoid the problem
(since only the phsyical registers are tracked).
2014-10-08 17:42:59 +02:00
Eric Anholt
48af7426f2 vc4: Abstract out the field-merging logic for instructions.
I'm going to be doing the same logic for some more fields next.
2014-10-08 17:42:59 +02:00
Niels Ole Salscheider
acdcef6788 r600: Use DMA transfers in r600_copy_global_buffer
v2: Do not demote items that are already in the pool

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2014-10-07 15:59:43 -04:00
Iago Toral Quiroga
fd31628c49 glsl: Optimize min/max expression trees
Original patch by Petri Latvala <petri.latvala@intel.com>:

Add an optimization pass that drops min/max expression operands that
can be proven to not contribute to the final result. The algorithm is
similar to alpha-beta pruning on a minmax search, from the field of
AI.

This optimization pass can optimize min/max expressions where operands
are min/max expressions. Such code can appear in shaders by itself, or
as the result of clamp() or AMD_shader_trinary_minmax functions.

This optimization pass improves the generated code for piglit's
AMD_shader_trinary_minmax tests as follows:

total instructions in shared programs: 75 -> 67 (-10.67%)
instructions in affected programs:     60 -> 52 (-13.33%)
GAINED:                                0
LOST:                                  0

All tests (max3, min3, mid3) improved.

A full shader-db run:

total instructions in shared programs: 4293603 -> 4293575 (-0.00%)
instructions in affected programs:     1188 -> 1160 (-2.36%)
GAINED:                                0
LOST:                                  0

Improvements happen in Guacamelee and Serious Sam 3. One shader from
Dungeon Defenders is hurt by shader-db metrics (26 -> 28), because of
dropping of a (constant float (0.00000)) operand, which was
compiled to a saturate modifier.

Version 2 by Iago Toral Quiroga <itoral@igalia.com>:

Changes from review feedback:
- Squashed various cosmetic changes sent by Matt Turner.
- Make less_all_components return an enum rather than setting a class member.
  (Suggested by Mat Turner). Also, renamed it to compare_components.
- Make less_all_components, smaller_constant and larger_constant static.
  (Suggested by Mat Turner)
- Change mixmax_range to call its limits "low" and "high" instead of
  "range[0]" and "range[1]". (Suggested by Connor Abbot).
- Use ir_builder swizzle helpers in swizzle_if_required(). (Suggested by
  Connor Abbot).
- Make the logic more clearer by rearrenging the code and commenting.
  (Suggested by Connor Abbot).
- Added comment to explain why we need to recurse twice. (Suggested by
  Connor Abbot).
- If we cannot prune an expression, do not return early. Instead, attempt
  to prune its children. (Suggested by Connor Abbot).

Other changes:
- Instead of having a global "valid" visitor member, let the various functions
  that can determine this status return a boolean and check for its value
  to decide what to do in each case. This is more flexible and allows to
  recurse into children of parents that could not be prunned due to invalid
  ranges (so related to the last bullet in the review feedback).
- Make sure we always check if a range is valid before working with it. Since
  any use of get_range, combine_range or range_intersection can invalidate
  a range we should check for this situation every time we use any of these
  functions.

Version 3 by Iago Toral Quiroga <itoral@igalia.com>:

Changes from review feedback:
- Now we can make get_range, combine_range and range_intersection static too
  (suggested by Connor Abbot).
- Do not return NULL when looking for the larger or greater constant into
  mixed vector constants. Instead, produce a new constant by doing a
  component-wise minmax. With this we can also remove of the validations when
  we call into these functions (suggested by Connor Abbot).
- Add a comment explaining the meaning of the baserange argument in
  prune_expression (suggested by Connor Abbot).

Other changes:
- Eliminate minmax expressions operating on constant vectors with mixed values
  by resolving them.

No piglit regressions observed with Version 3.

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

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-10-07 12:37:51 +02:00
Tapani Pälli
16b53005a7 glsl: do not emit error for non written varyings on OpenGL ES
Patch fixes following test case from 'shaders-with-varyings' WebGL
conformance suite: "vertex shader with unused varying and fragment
shader with used varying must succeed"

v2: emit still a warning if the condition happens (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-07 08:28:51 +03:00
Michel Dänzer
be0a994fb8 radeonsi: Use dummy pixel shader if compilation of the real shader failed
Instead of crashing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79155#c5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-07 12:07:13 +09:00
Chia-I Wu
f358462640 ilo: let shaders determine surface counts
When a shader needs N surfaces, we should upload N surfaces and not depend on
how many are bound.  This commit is larger than it should be because we did
not export how many surfaces a surface uses before.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-06 15:10:30 +08:00
Chia-I Wu
ca824e6940 ilo: let shaders determine sampler counts
When a shader needs N samplers, we should upload N samplers and not depend on
how many are bound.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-10-04 23:18:51 +08:00
Marek Olšák
0c4bc1e292 tgsi: change tgsi_shader_info::properties to a one-dimensional array
Reviewed-by: Roland Scheidegger <sroland@vmware.com>

v2: fix svga too
2014-10-04 15:36:39 +02:00
Marek Olšák
1f6c0b55df radeonsi: set number of userdata SGPRs of GS copy shader to 4
It only needs the constant buffer with clip planes and read-write resources
for the GS->VS ring and streamout. That's 2 pointers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:15 +02:00
Marek Olšák
68d36c0bb5 radeonsi: pass the GS shader directly to si_generate_gs_copy_shader
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:15 +02:00
Marek Olšák
aeb05f011e radeonsi: set LLVMByValAttribute for all descriptor arrays
I hope this is correct.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:15 +02:00
Marek Olšák
91f1a79f78 radeonsi: make the vertex shader key smaller
We only support 16 vertex attribs, not 32.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
90611297fa radeonsi: don't flush shader caches when building PM4 shader states
This is a wrong place to flush caches to say the least.

I don't think we need to flush the instruction caches if we don't patch
shaders with DMA.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
10e386f4aa radeonsi: remove interp_at_sample from the key, use TGSI_INTERPOLATE_LOC_SAMPLE
st/mesa has the same flag in its shader key, we don't need to do it
in the driver anymore.

Instead, use TGSI_INTERPOLATE_LOC_SAMPLE, which is what st/mesa sets.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
0a2d6f0c4e radeonsi: move geometry shader properties from si_shader to si_shader_selector
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
54de709911 radeonsi: always compile shaders on demand
The first compiled shader is sometimes useless, because the key doesn't match
the key for the draw call where it's used.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
6c9f61c97e radeonsi: remove unused variable si_shader::gs_input_prim
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
7dc0164192 tgsi: remove some not so useful variables from tgsi_shader_info 2014-10-04 15:16:14 +02:00
Marek Olšák
8860584045 radeonsi: get fs_write_all from tgsi_shader_info directly
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
8908fae243 tgsi: simplify shader properties in tgsi_shader_info
Use an array of properties indexed by TGSI_PROPERTY_* definitions.
2014-10-04 15:16:14 +02:00
Marek Olšák
5233568861 radeonsi: get tgsi_shader_info only once before compilation
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
af4f5a7c97 gallium/util: add util_bitcount64
I'll need this in radeonsi.

v2: use __builtin_popcountll if available

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-10-04 15:16:14 +02:00
Marek Olšák
837907b8b3 radeonsi: fix CS tracing and remove excessive CS dumping 2014-10-04 15:16:14 +02:00
Ilia Mirkin
c74be01e80 gk110/ir: add dnz flag emission for fmul/fmad
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-10-03 20:37:59 -04:00
Ilia Mirkin
d58037ccf5 gm107/ir: add dnz emission for fmul
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-10-03 20:37:59 -04:00
Brian Paul
90dc71b454 st/wgl: add WINAPI qualifiers on wgl function typedefs
Fixes a release build segfault when wglCreateContextAttribsARB()
calls the wglCreateContext() function.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-10-03 13:45:52 -06:00
Rob Clark
7297bdbd50 freedreno: query fixes
Fixes a few issues, including a potential empty-IB (which triggers gpu
hangs in piglit occlusion_query_meta_no_fragments)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-03 14:19:52 -04:00
Rob Clark
a262c601d3 freedreno/a3xx: handle VS only outputting BCOLOR
Possibly we should map the front color to black (zeroes).  But not sure
there is a way to do that without generating a shader variant.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-03 14:19:52 -04:00
Rob Clark
af4d088395 freedreno/ir3: fix lockups with lame FRAG shaders
Shaders like:

  FRAG
  PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
  DCL IN[0], GENERIC[0], PERSPECTIVE
  DCL OUT[0], COLOR
  DCL SAMP[0]
  DCL TEMP[0], LOCAL
  IMM[0] FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
    0: TEX TEMP[0], IN[0].xyyy, SAMP[0], 2D
    1: MOV OUT[0], IMM[0].xyxx
    2: END

cause unhappyness.  They have an IN[], but once this is compiled the
useless TEX instruction goes away.  Leaving a varying that is never
fetched, which makes the hw unhappy.

In the process fix a signed vs unsigned compare.  If the vertex shader
has max_reg=-1, MAX2() vs an unsigned would not give the desired result.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-03 14:19:52 -04:00
Matt Turner
cabc93c5ad i965/compaction: Disable compaction on SNB temporarily.
Will investigate after XDC.
2014-10-03 10:41:57 -07:00
Matt Turner
0d5c9bf1e4 Revert "i965: Emit ELSE/ENDIF JIP with type D on Gen 7."
This reverts commit 54e30dbf4d.

Will investigate after XDC.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84557
2014-10-03 10:02:24 -07:00
Matt Turner
b59db8e0f0 i965/fs: Remove dead generate_rep_fb_write prototype.
Added in commit f9dc7aab.
2014-10-03 10:02:24 -07:00
Brian Paul
c7f0755caa mesa: fix spurious wglGetProcAddress / GL_INVALID_OPERATION error
On Windows, the Piglit primitive-restart test was failing a
glGetError()==0 assertion when it was run w/out any command line
arguments.  Piglit's all.py script only runs primitive-restart
with arguments so this case isn't normally hit during a full
piglit run.

The basic problem is Microsoft's opengl32.dll calls glFlush
from wglGetProcAddress() and Piglit uses wglGetProcAddress() to
resolve glPrimitiveRestartNV() which is called inside glBegin/End.
See comments in the code for more info.

Plus, improve the comments for _mesa_alloc_dispatch_table().

Cc: <mesa-stable@lists.freedesktop.org>
Acked-by: Sinclair Yeh <syeh@vmware.com>
2014-10-03 10:04:48 -06:00
Ilia Mirkin
33c9ad97bf freedreno/ir3: add TXF support
Still failing a bunch of the fairly picky texelFetch tests, but the
1D(Array) ones are full passes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
e6acf3ac24 freedreno/ir3: add TXD support and expose ARB_shader_texture_lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
c49107c889 freedreno/ir3: add texture offset support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
5bba74c64b freedreno/ir3: shadow comes before array
Experimentally, this makes *ArrayShadow tex-miplevel-selection tests
pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
81b34e4461 freedreno/ir3: make TXQ return integers, not floats
We're still doing something wrong for array textures.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
c4e2a196c3 freedreno/ir3: add UMAD support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
347bc197a6 freedreno/ir3: add ISSG support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
ad5db64e7e freedreno/ir3: add MOD support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
cab3cb1d71 freedreno/ir3: add UMOD support, based on UDIV
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Ilia Mirkin
8f7d01c2cb freedreno/ir3: add IDIV/UDIV support
Logic shamelessly copied from nv50 lowering pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 23:30:47 -04:00
Michel Dänzer
ed03747e6a radeonsi: Clear sampler view flags when binding a buffer
Fixes assertion failure while running the Unreal Engine 4 Elemental demo:

.../si_blit.c:322:si_decompress_color_textures: Assertion `tex->cmask.size || tex->fmask.size' failed.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-03 11:15:38 +09:00
Eric Anholt
ca00070259 vc4: Add support for framebuffer sRGB encoding. 2014-10-02 18:29:18 -07:00
Eric Anholt
24d9980562 vc4: Add support for sampling from sRGB.
This isn't perfect -- the filtering is happening on the srgb values, and
we're decoding afterwards, which is not what you want.  I think that's the
cause of some additional texwrap(GL_CLAMP, LINEAR) failures, though many
other texwrap tests on srgb start to pass since unfiltered values come out
correct.
2014-10-02 18:28:45 -07:00
Ilia Mirkin
3dd9a0d6fd freedreno/ir3: avoid fan-in sources referring to same instruction
Since the RA has to be done s.t. each one gets its own (adjacent)
register, it would complicate matters if instructions were allowed to be
repeated. This enables copy-propagation use in situations where
previously that might have happened.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 21:05:50 -04:00
Rob Clark
f5eeb8a6dc freedreno/a3xx: emit all immediates in one shot
Makes the command stream a bit tighter when there are lots of
immediates.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 21:05:50 -04:00
Ilia Mirkin
be00852bae freedreno: instanced drawing/compute not yet supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 21:05:50 -04:00
Dave Airlie
8df3c02cdc mesa: fix GetTexImage for 1D array depth textures
While running piglit in virgl, I hit an assert in intel driver.

"qemu-system-x86_64: intel_tex.c:219: intel_map_texture_image: Assertion `tex_image->TexObject->Target != 0x8C18 || h == 1' failed."

Thanks to Eric and Ken for pointing me in the right direction,

Fix the get_tex_depth to do the same fixup as get_tex_rgba does
for 1D array textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-10-03 10:37:55 +10:00
Tomasz Figa
b4ffd19e6c st/mesa: Fix paths used in Android builds
With current makefiles the build fails because source and build paths
are generated incorrectly. With Android build system the top_srcdir and
top_builddir variables are undefined and all paths are relative to where
Android.mk is located. This ends up with path likes
external/mesa/src/mesa/src/mesa/ for both source and build paths, which
are obviously wrong.

This patch fixes this by overriding resulting SRCDIR and BUILDDIR
variables with empty string, so that paths end up being relative to
Android.mk file again. Appending correct build path to generated files
is already done in Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-03 01:25:35 +01:00
Tomasz Figa
98445fd25e st/mesa: Generate format_info.c in Android builds
Current Android makefiles lack generation of format_info.c, which is
a dependency of main/format.c. This patch adds necessary code to
Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-03 01:25:32 +01:00
Tomasz Figa
d703abf735 util: Include in Android builds
This patch fixes Android build failures by including src/util directory
in compilation. Files inside of this directory are compiled into
libmesa_util static library and linked with resulting libGLES_mesa.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-03 01:25:28 +01:00
Jason Ekstrand
493bfa54a5 i965/fs: Use the correct base_mrf for spilling pairs in SIMD8
Before, we were hard-coding the base_mrf based on dispatch width not number
of registers spilled at a time.  This caused us to emit instructions with a
base_mrf or 14 and a mlen of 3 so we used the magical non-existant m16
register.  This fixes the problem.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-02 16:38:25 -07:00
Jason Ekstrand
50d0e2e118 i965/fs: Add a MAX_GRF_SIZE define and use it various places
Previously, we had a MAX_SAMPLER_MESSAGE_SIZE which we used instead.
However, some FB write messages can validly be longer than this so we need
something different.  Since MAX_SAMPLER_MESSAGE_SIZE is validly useful on
its own, we leave it alone and add a new MAX_GRF_SIZE that's big enough for
FB writes.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84539
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-02 14:14:25 -07:00
Jason Ekstrand
b33e5465a7 i965/fs: Use the actual regsister width in brw_reg_from_fs_reg
This fixes a bug where 1-wide operations don't properly translate down to
1-wide instructions.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-02 13:17:03 -07:00
Jason Ekstrand
75986830b4 i965/fs_fp: Use null_reg from fs_visitor instead of rolling our own
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84529
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-10-02 13:17:03 -07:00
Rob Clark
7309c6126f freedreno/a3xx: handle large shader program sizes
Above a certain limit use CACHE mode instead of BUFFER mode.  This
should solve gpu hangs with large shader programs.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 13:57:07 -04:00
Rob Clark
d01ee5923d freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 13:57:07 -04:00
Ilia Mirkin
3dc47c5960 freedreno: dual-source render targets are not supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-02 13:57:07 -04:00
Ilia Mirkin
786f01c492 gallium/hud: use u_sampler_view_default_template helper
The existing code was not setting several fields, most importantly the
target, which is required on nv50/nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-10-02 12:18:21 -04:00
Iago Toral Quiroga
db8cd4d519 glsl: Fix memory leak in builtin_builder::_image_prototype.
in_var calls the ir_variable constructor, which dups the variable name.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-10-02 15:39:05 +02:00
Tapani Pälli
f4b4ae8c24 mesa: relax draw api validation on ES2
Patch fixes failing test in WebGL conformance test
'point-no-attributes' when running Chrome on OpenGL ES.
(Shader program may draw points using constant data in shader.)

No Piglit regressions.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-02 11:55:13 +03:00
Ilia Mirkin
3914dc579e glsl: make consistent use of DECLARE_RALLOC_CXX_OPERATORS
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-02 00:59:35 -04:00
Eric Anholt
4111b1d54b vc4: Fix the mapping of the minification filter to HW values.
They're actually as documented in the HW specs and the GL mipmapping enums
order.  Fixes fbo-generatemipmap-filtering , and some other tests where we
were off by a few bits due to unexpected linear filtering.
2014-10-01 17:03:36 -07:00
Eric Anholt
75f8e0bc2a vc4: Make the last static array in vc4_program.c dynamically sized. 2014-10-01 17:03:35 -07:00
Eric Anholt
ebff93ac19 vc4: Fix some broken indentation. 2014-10-01 17:03:35 -07:00
Eric Anholt
d7a0502a54 vc4: Add support for the FACE semantic.
Fixes glsl-fs-frontfacing.
2014-10-01 17:03:35 -07:00
Eric Anholt
1bf2d17a60 vc4: Add support for TGSI_OPCODE_CLAMP.
This will be used by the shared LIT lowering code.
2014-10-01 17:03:35 -07:00
Eric Anholt
0c8c7d32f0 vc4: Fix compiler warning 2014-10-01 17:03:35 -07:00
Anuj Phogat
25266b2c11 meta: Fix make check failures in setup_glsl_msaa_blit_scaled_shader()
introduced by commit 68ee950.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reported-by: Mark Janes <mark.a.janes@intel.com>
2014-10-01 15:27:31 -07:00
Brian Paul
44b500f5f2 mesa: fix _mesa_alloc_dispatch_table() declaration
Insert 'void' parameter to match declaration in api_exec.h.  Trivial.
2014-10-01 15:17:47 -06:00
Roland Scheidegger
dea0fcf4e6 meta: (trivial) remove accidental double semicolon 2014-10-01 23:14:46 +02:00
Anuj Phogat
4330fa970b i965: Enable EXT_framebuffer_multisample_blit_scaled for gen8
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-10-01 12:04:15 -07:00
Anuj Phogat
68ee950c78 meta: Implement ext_framebuffer_multisample_blit_scaled extension
Extension enables doing a multisample buffer resolve and buffer
scaling using a single glBlitFrameBuffer() call. Currently, we
have this extension implemented in BLORP which is only used by
SNB and IVB. This patch implements the extension in meta path
which makes it available to Broadwell.

Implementation features:
 - Supports scaled resolves of 2X, 4X and 8X multisample buffers.

 - Avoids unnecessary shader compilations by storing the pre compiled
   shaders for each supported sample count.

 - Uses bilinear filtering for both GL_SCALED_RESOLVE_FASTEST_EXT and
   GL_SCALED_RESOLVE_NICEST_EXT filter options. This is an allowed
   behavior in the extension's spec.

 - I tried doing bicubic filtering for GL_SCALED_RESOLVE_NICEST_EXT
   filter. It made the edges in the image look little smoother but
   the image gets blurred causing no overall quality improvement.
   For now I have dropped the idea of doing different filtering for
   nicest filter.

V2:
 - Minor changes to simplify the fragment shader.
 - Refactor the code to move i965 specific sample_map computation out
   of Meta. We now use ctx->Const.SampleMap{2,4,8}x variables initialized
   by the driver.
 - Use a simple msaa resolve shader for scaled resolves with scaling
   factor = 1.0.

V3:
 - Make changes to create a string out of ctx->Const.SampleMap{2,4,8}x
   variables and use it in fragment shader.

V4:
 - Make changes to use uint8_t type ctx->Const.SampleMap{2,4,8}x
   variables.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-10-01 12:04:15 -07:00
Anuj Phogat
7a4790148c i965: Initialize the SampleMap{2,4,8}x variables
with values specific to Intel hardware.

V2: Define and use gen6_get_sample_map() function to initialize
    the variables.

V3: Change the function name to gen6_set_sample_maps() and use
    memcpy() to fill in the data.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-10-01 12:04:15 -07:00
Anuj Phogat
38cd40faab mesa: Add new variables in gl_context to store sample layout
SampleMap{2,4,8}x variables are used in later patches to implement
EXT_framebuffer_multisample_blit_scaled extension.

V2: Use integer array instead of a string.
    Bump up the comment.

V3: Use uint8_t type array.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-10-01 12:04:15 -07:00
Leo Liu
4f7916ab4f st/va: implement vlVa(Query|Create|Get|Put|Destroy)Image
This patch implements functions for images support,
which basically supports copy data between video
surface and user buffers, in this case supports
SW decode, and other video output

v2: fix buffer size for odd-sized image case
    expose I420 format as well
v3: fix YUV 4:2:2 format data buffer size
    cleanup I420 format  exposure

Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-10-01 13:21:36 -04:00
Christian König
7913c8943a st/va: implement Picture functions for mpeg2 h264 and vc1
This patch implements codec for mpeg2 h264 and vc1,
populates codec parameters and pass them to HW driver.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-10-01 13:21:36 -04:00
Christian König
1be5515838 st/va: implement Context Surface and Buffer
This patch implements context managements, relate it HW driver,
functions for video surface managements, and functions for
application data memory buffer managements.

implemented functions:
vlVa(Create|Destroy)Context
vlVa(Create|Destroy|Put)Surfaces
vlVa(Create|Destroy)Buffer

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-10-01 13:21:36 -04:00
Christian König
2825ef3abf st/va: implement vlVa(Create|Destroy|Query|Get)Config
This patch is for application to query configuration,
such as profiles, entrypoints, and attributes

v2: fix missing profile with query

Signed-off-by: Michael Varga <michael.varga@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-10-01 13:21:36 -04:00
Christian König
3867933ecb st/va: skeleton VAAPI state tracker
This patch adds a skeleton VA-API state tracker,
which is filled with live in the subsequent patches.

v2: fixes in configure.ac and va state_tracker Makefile.am
v3: do not link against libva.
    detect libva version, and correctly set driver entrypoint name.
    rebase(cleanup) targets/va/Makefile.am
v4: cleanup va version auto detection
    add back targets/va/va.sym

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-01 13:21:36 -04:00
Leo Liu
0eb8f89981 st/vdpau: move common functions to util
Break out these functions so that they can be shared with a other
state trackers.  They will be used in subsequent patches for the new
VA-API state tracker.

Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-10-01 13:21:36 -04:00
Rob Clark
204dd73c99 freedreno: max-texture-lod-bias should be 15.0f
Fixes piglit lodbias test.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-10-01 07:28:06 -04:00
Kenneth Graunke
95073a2dca mesa: Avoid flagging _NEW_VIEWPORT on redundant viewport updates.
Cuts the number of i965 color calculator viewport uploads by 100x
(11017983 -> 113385) in 'x11perf -gc' with Glamor in Xephyr.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-01 01:08:26 -07:00
Kenneth Graunke
0a1730200e i965: Drop CACHE_NEW_VS_PROG from the gen7_sf_state atom.
I believe when I wrote this code, gen6_sf_state used CACHE_NEW_VS_PROG,
which has since been replaced by BRW_NEW_VUE_MAP_GEOM_OUT.  It's not
needed here anyway - only SBE needs it.  Just a copy and paste mistake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-01 01:08:07 -07:00
Kenneth Graunke
106e0db769 i965: Drop brwBindProgram driver hook.
This function flagged BRW_NEW_*_PROGRAM

When ctx->{Vertex,Geometry,Fragment}Program._Current changes, core Mesa
calls the BindProgram driver hook, which flagged BRW_NEW_*_PROGRAM.

However, brw_upload_state also checks for that changing, sets the same
flags, and also updates brw->fragment_program and so on.  So, this looks
to be entirely redundant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:41 -07:00
Kenneth Graunke
e25a453b7f i965: Add missing /* BRW_NEW_FRAGMENT_PROGRAM */ comments.
I had to dig a bit to figure out why this was necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:39 -07:00
Kenneth Graunke
3d31ed0d93 i965: Use "1ull" instead of "1" in BRW_NEW_* defines.
Now that the bitfield is a uint64_t, we should use 1ull.  Currently, we
only have 32 entries, so 1 works fine, but it's not future-proof.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:38 -07:00
Kenneth Graunke
a114f452ae i965: Use ~0ull when flagging all BRW_NEW_* dirty flags.
~0 is 0xFFFFFFFF, which only covers the first 32 bits.  We need all 64.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:36 -07:00
Kenneth Graunke
5105f9a7ae i965: Fix INTEL_DEBUG=state to work with 64-bit dirty bits.
This will keep INTEL_DEBUG=state working when we add BRW_NEW_* bits
beyond 1 << 31.  We missed doing this when widening the driver flags
from uint32_t to uint64_t.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:35 -07:00
Kenneth Graunke
fbebd5e4a5 i965: Delete CACHE_NEW_BLORP_CONST_COLOR_PROG.
Unused since krh rewrote fast clears to use meta.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 01:05:24 -07:00
Chris Forbes
e4e3b0fc0d i965: Fix typo in comment
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 18:37:06 +13:00
Chris Forbes
d8c5c4f3e4 i965: Fix spelling of GEN7_SAMPLER_EWA_ANISOTROPIC_ALGORITHM
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-10-01 18:37:06 +13:00
Vinson Lee
6a238ac0b7 llvmpipe: Add missing LLVMGetGlobalContext() arg in lp_test_format.c.
Fix build error introduced with commit
eedbce9c63.

lp_test_format.c: In function ‘test_format_unorm8’:
lp_test_format.c:226:4: error: too few arguments to function ‘gallivm_create’
    gallivm = gallivm_create("test_module_unorm8");
    ^
In file included from ../../../../src/gallium/auxiliary/gallivm/lp_bld_format.h:38:0,
                 from lp_test_format.c:42:
../../../../src/gallium/auxiliary/gallivm/lp_bld_init.h:58:1: note: declared here
 gallivm_create(const char *name, LLVMContextRef context);
 ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84538
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-09-30 21:52:13 -07:00
Keith Packard
3202926746 glx/dri3: Provide error diagnostics when DRI3 allocation fails
Instead of just segfaulting in the driver when a buffer allocation fails,
report error messages indicating what went wrong so that we can debug things.

As a simple example, chromium wraps Mesa in a sandbox which doesn't allow
access to most syscalls, including the ability to create shared memory
segments for fences. Before, you'd get a simple segfault in mesa and your 3D
acceleration would fail. Now you get:

$ chromium --disable-gpu-blacklist
[10618:10643:0930/200525:ERROR:nss_util.cc(856)] After loading Root Certs, loaded==false: NSS error code: -8018
libGL: pci id for fd 12: 8086:0a16, driver i965
libGL: OpenDriver: trying /local-miki/src/mesa/mesa/lib/i965_dri.so
libGL: Can't open configuration file /home/keithp/.drirc: Operation not permitted.
libGL: Can't open configuration file /home/keithp/.drirc: Operation not permitted.
libGL error: DRI3 Fence object allocation failure Operation not permitted
[10618:10618:0930/200525:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[10618:10618:0930/200525:ERROR:webgraphicscontext3d_command_buffer_impl.cc(236)] CommandBufferProxy::Initialize failed.
[10618:10618:0930/200525:ERROR:webgraphicscontext3d_command_buffer_impl.cc(256)] Failed to initialize command buffer.

This made it pretty easy to diagnose the problem in the referenced bug report.

Bugzilla: https://code.google.com/p/chromium/issues/detail?id=415681
Signed-off-by: Keith Packard <keithp@keithp.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 21:23:04 -07:00
Keith Packard
f7a355556e glx/dri3: Use four buffers until X driver supports async flips
A driver which doesn't have async flip support will queue up flips without any
way to replace them afterwards. This means we've got a scanout buffer pinned
as soon as we schedule a flip and so we need another buffer to keep from
stalling.

When vblank_mode=0, if there are only three buffers we do:

        current scanout buffer = 0 at MSC 0

        Render frame 1 to buffer 1
        PresentPixmap for buffer 1 at MSC 1

                This is sitting down in the kernel waiting for vblank to
                become the next scanout buffer

        Render frame 2 to buffer 2
        PresentPixmap for buffer 2 at MSC 1

                This cannot be displayed at MSC 1 because the
                kernel doesn't have any way to replace buffer 1 as the pending
                scanout buffer. So, best case this will get displayed at MSC 2.

Now we block after this, waiting for one of the three buffers to become idle.
We can't use buffer 0 because it is the scanout buffer. We can't use buffer 1
because it's sitting in the kernel waiting to become the next scanout buffer
and we can't use buffer 2 because that's the most recent frame which will
become the next scanout buffer if the application doesn't manage to generate
another complete frame by MSC 2.

With four buffers, we get:

        current scanout buffer = 0 at MSC 0

        Render frame 1 to buffer 1
        PresentPixmap for buffer 1 at MSC 1

                This is sitting down in the kernel waiting for vblank to
                become the next scanout buffer

        Render frame 2 to buffer 2
        PresentPixmap for buffer 2 at MSC 1

                This cannot be displayed at MSC 1 because the
                kernel doesn't have any way to replace buffer 1 as the pending
                scanout buffer. So, best case this will get displayed at MSC
                2. The X server will queue this swap until buffer 1 becomes
                the scanout buffer.

        Render frame 3 to buffer 3
        PresentPixmap for buffer 3 at MSC 1

                As soon as the X server sees this, it will replace the pending
                buffer 2 swap with this swap and release buffer 2 back to the
                application

        Render frame 4 to buffer 2
        PresentPixmap for buffer 2 at MSC 1

                Now we're in a steady state, flipping between buffer 2 and 3
                waiting for one of them to be queued to the kernel.

        ...

        current scanout buffer = 1 at MSC 1

                Now buffer 0 is free and (e.g.) buffer 2 is queued in
                the kernel to be the scanout buffer at MSC 2

        Render frames, flipping between buffer 0 and 3

When the system can replace a queued buffer, and we update Present to take
advantage of that, we can use three buffers and get:

        current scanout buffer = 0 at MSC 0

        Render frame 1 to buffer 1
        PresentPixmap for buffer 1 at MSC 1

                This is sitting waiting for vblank to become the next scanout
                buffer

        Render frame 2 to buffer 2
        PresentPixmap for buffer 2 at MSC 1

                Queue this for display at MSC 1
                1. There are three possible results:

                  1) We're still before MSC 1. Buffer 1 is released,
                     buffer 2 is queued waiting for MSC 1.

                  2) We're now after MSC 1. Buffer 0 was released at MSC 1.
                     Buffer 1 is the current scanout buffer.

                     a) If the user asked for a tearing update, we swap
                        scanout from buffer 1 to buffer 2 and release buffer
                        1.

                     b) If the user asked for non-tearing update, we
                        queue buffer 2 for the MSC 2.

                In all three cases, we have a buffer released (call it 'n'),
                ready to receive the next frame.

        Render frame 3 to buffer n
        PresentPixmap for buffer n

                If we're still before MSC 1, then we'll ask to present at MSC
                1. Otherwise, we'll ask to present at MSC 2.

Present already does this if the driver offers async flips, however it does
this by waiting for the right vblank event and sending an async flip right at
that point.

I've hacked the intel driver to offer this, but I get tearing at the top of
the screen. I think this is because flips are always done from within the
ring, and so the latency between the vblank event and the async flip happening
can cause tearing at the top of the screen.

That's why I'm keying the need for the extra buffer on the lack of 2D
driver support for async flips.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-09-30 20:08:28 -07:00
Jason Ekstrand
eedbce9c63 i965/fs: Fix the build 2014-09-30 17:27:33 -07:00
Jason Ekstrand
83669fac9d i965/fs: Fix an uninitialized value warnings
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 17:26:05 -07:00
Roland Scheidegger
9750ae8ca9 galahad: fix indirect draw
Need to unwrap the indirect resource otherwise bad things will happen.

Fixes random crashes and timeouts with piglit's arb_indirect_draw tests.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-10-01 02:17:24 +02:00
Roland Scheidegger
e3da8c110c galahad: (trivial) handle cubemap arrays
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-10-01 02:16:57 +02:00
Matt Turner
3e7f8005db i965/fs: Emit compressed BFI2 instructions on Gen > 7.
IVB had a restriction that prevented us from emitting compressed
three-source instructions, and although that was lifted on Haswell,
Haswell had a new restriction that said BFI instructions specifically
couldn't be compressed.
2014-09-30 17:09:34 -07:00
Matt Turner
9f5e5bd34d i965/fs: Allow SIMD16 borrow/carry/64-bit multiply on Gen > 7.
These checks were intended for Gen 7 only. None of these restrictions
apply to Gen 8.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Matt Turner
05586f9bc1 i965/fs: Set MUL source type to W/UW in 64-bit mul macro on Gen8.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Matt Turner
94b68109fb i965/fs: Optimize sqrt+inv into rsq.
Transform

   sqrt a, b
   rcp  c, a

into

   sqrt a, b
   rsq  c, b

The improvement here is that we've broken a dependency between these
instructions. Leads to 330 fewer INV instructions and 330 more RSQ.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Matt Turner
b52126b44f i965/vec4: Optimize sqrt+inv into rsq.
Transform

   sqrt a, b
   rcp  c, a

into

   sqrt a, b
   rsq  c, b

In most cases the sqrt's result is still used, so the improvement here
is that we've broken a dependency between these instructions. Leads to
80 fewer INV instructions and 80 more RSQ.

Occasionally the sqrt's result is no longer used, leading to:

instructions in affected programs:     5005 -> 4949 (-1.12%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Matt Turner
189ac07764 i965/vec4: Call opt_algebraic after opt_cse.
The next patch adds an algebraic optimization for the pattern

   sqrt a, b
   rcp  c, a

and turns it into

   sqrt a, b
   rsq  c, b

but many vertex shaders do

   a = sqrt(b);
   var1 /= a;
   var2 /= a;

which generates

   sqrt a, b
   rcp  c, a
   rcp  d, a

If we apply the algebraic optimization before CSE, we'll end up with

   sqrt a, b
   rsq  c, b
   rcp  d, a

Applying CSE combines the RCP instructions, preventing this from
happening.

No shader-db changes.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Matt Turner
d13bcdb3a9 i965/fs: Extend predicated break pass to predicate WHILE.
Helps a handful of programs in Serious Sam 3 that use do-while loops.

instructions in affected programs:     16114 -> 16075 (-0.24%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-30 17:09:34 -07:00
Mathias Fröhlich
6e7d36fd2c gallivm: Fix build for LLVM 3.2
Do not rely on LLVMMCJITMemoryManagerRef being available.
The c binding to the memory manager objects only appeared
on llvm-3.4.
The change is based on an initial patch of Brian Paul.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-01 00:29:31 +02:00
Rob Clark
cc355f1c06 freedreno: destroy transfer pool after blitter
Blitter can still have transfers hanging around which it frees in
util_blitter_destroy().  So let it clean up before we yank the
transfer_pool from under it.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-30 16:56:15 -04:00
Rob Clark
01ff0b28b3 freedreno/lowering: fix token calculation for lowering
Indirect registers consume an additional token.  Try to clean up the
token calculation math a bit, and fix it at the same time.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-30 16:56:15 -04:00
Ian Romanick
408aa46ca8 i965/fs: Don't make a name for a vector splitting temporary
If the name is just going to get dropped, don't bother making it.  If
the name is made, release it sooner (rather than later).

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:43 -07:00
Ian Romanick
0b47252999 glsl: Don't make a name for the function return variable
If the name is just going to get dropped, don't bother making it.  If
the name is made, release it sooner (rather than later).

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:43 -07:00
Ian Romanick
c87d09d7f0 glsl: Don't allocate a name for ir_var_temporary variables
Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 74 40,578,719,715       67,762,208       62,263,404     5,498,804            0
After  (32-bit): 52 40,565,579,466       66,359,800       61,187,818     5,171,982            0

Before (64-bit): 74 37,129,541,061       95,195,160       87,369,671     7,825,489            0
After  (64-bit): 76 37,134,691,404       93,271,352       85,900,223     7,371,129            0

A real savings of 1.0MiB on 32-bit and 1.4MiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:43 -07:00
Ian Romanick
eaa0c74142 glsl: Use ir_var_temporary for compiler generated temporaries
These few places were using ir_var_auto for seemingly no reason.  The
names were not added to the symbol table.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:43 -07:00
Ian Romanick
04e1357d97 glsl: Add context-level controls for whether temporaries have real names
No change Valgrind massif results for a trimmed apitrace of dota2.

v2: Minor rebase on _mesa_init_constants changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
a99482482d glsl: Never put ir_var_temporary variables in the symbol table
Later patches will give every ir_var_temporary the same name in release
builds.  Adding a bunch of variables named "compiler_temp" to the symbol
table can only cause problems.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
7625babfae glsl: Add the possibility for ir_variable to have a non-ralloced name
Specifically, ir_var_temporary variables constructed with a NULL name
will all have the name "compiler_temp" in static storage.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
0e654ab1b9 glsl: Store ir_variable_data::_num_state_slots and ::binding in 16-bits each
Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 44 40,577,049,140       68,118,608       62,441,063     5,677,545            0
After  (32-bit): 71 40,583,408,411       67,761,528       62,263,519     5,498,009            0

Before (64-bit): 63 37,122,829,194       95,153,008       87,333,600     7,819,408            0
After  (64-bit): 67 37,123,303,706       95,150,544       87,333,600     7,816,944            0

A real savings of 173KiB on 32-bit and no change on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
a32ac726ee glsl: Squish ir_variable::max_ifc_array_access and ::state_slots together
At least one of these pointers must be NULL, and we can determine which
will be NULL by looking at other fields.  Use this information to store
both pointers in the same location.

If anyone can think of a better name for the union than "u", I'm all
ears.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 63 40,574,239,515       68,117,280       62,618,607     5,498,673            0
After  (32-bit): 44 40,577,049,140       68,118,608       62,441,063     5,677,545            0

Before (64-bit): 53 37,126,451,468       95,150,256       87,711,304     7,438,952            0
After  (64-bit): 63 37,122,829,194       95,153,008       87,333,600     7,819,408            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
5aa8d8194c glsl: Make ir_variable::num_state_slots and ir_variable::state_slots private
Also move num_state_slots inside ir_variable_data for better packing.

The payoff for this will come in a few more patches.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
21df016902 glsl: Make ir_variable::max_ifc_array_access private
The payoff for this will come in a few more patches.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:42 -07:00
Ian Romanick
8afe6efa21 glsl: Store ir_variable::depth_layout using 3 bits
warn_extension_index was moved to improve packing.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 73 40,580,476,304       68,488,400       62,796,151     5,692,249            0
After  (32-bit): 73 40,575,751,558       68,116,528       62,618,607     5,497,921            0

Before (64-bit): 71 37,124,890,613       95,889,584       88,089,008     7,800,576            0
After  (64-bit): 62 37,123,578,526       95,150,784       87,711,304     7,439,480            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

v2: Use the enum name with the bit-field and remove the extra casts.
Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> [v1]
2014-09-30 13:34:42 -07:00
Ian Romanick
ab51179f1f glsl: Replace ir_variable::warn_extension pointer with an 8-bit index
Also move the new warn_extension_index into ir_variable::data.  This
enables slightly better packing.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 82 40,580,040,531       68,488,992       62,973,695     5,515,297            0
After  (32-bit): 73 40,580,476,304       68,488,400       62,796,151     5,692,249            0

Before (64-bit): 65 37,124,013,542       95,892,768       88,466,712     7,426,056            0
After  (64-bit): 71 37,124,890,613       95,889,584       88,089,008     7,800,576            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:41 -07:00
Ian Romanick
baf5a75664 glsl: Use accessors for ir_variable::warn_extension
The payoff for this will come in the next patch.

No change Valgrind massif results for a trimmed apitrace of dota2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-30 13:34:41 -07:00
Ian Romanick
1012e95a40 glsl: Eliminate unused built-in variables after compilation
After compilation (and before linking) we can eliminate quite a few
built-in variables.  Basically, any uniform or constant (e.g.,
gl_MaxVertexTextureImageUnits) that isn't used (with one exception) can
be eliminated.  System values, vertex shader inputs (with one
exception), and fragment shader outputs that are not used and not
re-declared in the shader text can also be removed.

gl_ModelViewProjectMatrix and gl_Vertex are used by the built-in
function ftransform.  There are some complications with eliminating
these variables (see the comment in the patch), so they are not
eliminated.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 46 40,661,487,174       75,116,800       68,854,065     6,262,735            0
After  (32-bit): 50 40,564,927,443       69,185,408       63,683,871     5,501,537            0

Before (64-bit): 64 37,200,329,700      104,872,672       96,514,546     8,358,126            0
After  (64-bit): 59 36,822,048,449       96,526,888       89,113,000     7,413,888            0

A real savings of 4.9MiB on 32-bit and 7.0MiB on 64-bit.

v2: Don't remove any built-in with Transpose in the name.

v3: Fix comment typo noticed by Anuj.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
2014-09-30 13:34:41 -07:00
Ian Romanick
77005cfabd glsl: Validate that built-in uniforms have backing state
All built-in uniforms are supposed to be backed by some GL state.  The
state_slots field describes this backing state.

This helped me track down a bug in a later patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-30 13:34:41 -07:00
Eric Anholt
8786544b3e vc4: Don't forget to store stencil along with depth when storing either.
Otherwise, we'd replace the stencil in our packed depth/stencil with 0s.
Fixes about 50 piglit tests.
2014-09-30 12:55:28 -07:00
Mathias Fröhlich
43e2109326 llvmpipe: Reuse llvmpipes LLVMContext in the draw context.
Reuse the LLVMContext already allocated in llvmpipe_context
for draw_llvm if ppossible. This should decrease the memory
footprint of an llvmpipe context.

v2: Fix compile with llvm disabled.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-09-30 20:51:02 +02:00
Mathias Fröhlich
d90ff351f3 llvmpipe: Make a llvmpipe OpenGL context thread safe.
This fixes the remaining problem with the recently introduced
global jit memory manager. This change again uses a memory manager
that is local to gallivm_state. This implementation still frees
the majority of the memory immediately after compilation.
Only the generated code is deferred until this code is no longer used.

This change and the previous one using private LLVMContext instances
I can now safely run several independent OpenGL contexts driven
by llvmpipe from different threads.

v3: Rebase on llvm-3.6 compile fixes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-09-30 20:51:02 +02:00
Mathias Fröhlich
83c62597fc llvmpipe: Use two LLVMContexts per OpenGL context instead of a global one.
This is one step to make llvmpipe thread safe as mandated by the OpenGL
standard. Using the global LLVMContext is obviously a problem for
that kind of use pattern. The patch introduces two LLVMContext
instances that are private to an OpenGL context and used for all
compiles. One is put into struct draw_llvm and the other
one into struct llvmpipe_context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-09-30 20:45:19 +02:00
Jason Ekstrand
98d00d6640 i965/brw_reg: Make the accumulator register take an explicit width.
The big pile of patches I just pushed regresses about 25 piglit tests on
SNB.  This fixes the regressions.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-30 11:42:34 -07:00
Brian Paul
6b65847835 llvmpipe: move lp_jit_screen_init() call after allocation of screen object
The screen argument isn't actually used by lp_jit_screen_init() at this
time, but let's move the call so that we pass a valid pointer.

v2: don't leak screen if lp_jit_screen_init() fails.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-30 12:09:14 -06:00
Brian Paul
b12899d752 tgsi: fix Semantic.Name assignment in tgsi_transform_input_decl()
Assign the sem_name parameter, not TGSI_SEMANTIC_GENERIC.
Fixes polygon stipple regression.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-30 12:08:49 -06:00
Brian Paul
0fb1e6b7b4 util: simplify PIPE_TEXTURE_CUBE case in util_max_layer()
For cube resources, the array_size value should be 6.  So handle
that case as we do for array texture resources.  But assert that
array_size==6 just to be safe.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-30 12:08:49 -06:00
Brian Paul
59562e9ba5 softpipe: don't special case PIPE_TEXTURE_CUBE in softpipe_resource_layout()
As with the previous patch for llvmpipe.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-30 12:08:49 -06:00
Brian Paul
3d77b80d80 llvmpipe: remove special case for PIPE_TEXTURE_CUBE in llvmpipe_texture_layout()
layers (aka array_size) should be 6 for cube textures so we don't need
to special-case it.  But add an assertion just to be safe.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-30 12:08:49 -06:00
Brian Paul
8269bfdb83 gallium: add doc note about cube textures and can_create_resource()
Just to be clear, and echo the description for resource_create().

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-30 12:08:49 -06:00
Brian Paul
3bfc9a73ad st/mesa: remove unneded PIPE_TEXTURE_CUBE check in st_texture_create()
Earlier in the function we assert layers==6 for PIPE_TEXTURE_CUBE so
there's no reason to special-case the pt.array_size = layers assignment.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-30 12:08:49 -06:00
Eric Anholt
2b76ee9031 mesa: Drop the always-software-primitive-restart paths.
The core sw primitive restart code is still around, because i965 uses it
in some cases, but there are no drivers that want it on all the time.

Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-09-30 11:00:52 -07:00
Eric Anholt
bcb722d830 gallium: Drop software-only primitive restart support.
The drivers not flagging primitive restart support are r300 swtcl, svga,
nv30, and vc4.

The point of primitive restart is to slightly reduce draw call overhead
for apps by batching multiple draws.  If we do an extra pass to read the
index buffer and split back into multiple draws, we've entirely missed the
point.  This is particularly bad for drivers that otherwise have hardware
IB reads, where the readback is probably uncached.

Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-09-30 10:59:58 -07:00
Jason Ekstrand
4ddc25a8d4 i965/fs: Properly calculate the number of instructions in calculate_register_pressure
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
514fd1c55e i965/fs: Use the GRF for FB writes on gen >= 7
On gen 7, the MRF was removed and we gained the ability to do send
   instructions directly from the GRF.  This commit enables that
   functinoality for FB writes.

   v2: Make handling of components more sane.

i965/fs: Force a high register for the final FB write

   v2: Renamed the array for the range mappings and added a comment

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
1dd9b90ecd i965/fs: Handle COMPR4 in LOAD_PAYLOAD
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
29f4c5b5d5 i965/fs: Constant propagate into LOAD_PAYLOAD
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
6d770ce93a i965/fs: Add split_virtual_grfs and compute_to_mrf after lower_load_payload
If we are going to use LOAD_PAYLOAD operations to fill MRF registers, then
we will need this.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
8b0e4b387a i965/fs: Add a an optional source to the FS_OPCODE_FB_WRITE instruction
Previously, we were use the base_mrf parameter of fs_inst to store the MRF
location.  In preparation for doing FB writes from the GRF, we now also
allow you to set inst->base_mrf to -1 and provide a source register.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
9e1f52a6e2 i965/fs: Use the GRF for UNTYPED_SURFACE_READ instructions
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
d25aaf1cb1 i965/fs: Use the GRF for UNTYPED_ATOMIC instructions
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
65ddf6f404 i965/fs: Add a function for getting a component of a 8 or 16-wide register
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
30d718c2fb i965/fs: Use the instruction execution size directly for texture generation
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
48ddd2889e i965/fs: Use exec_size instead of force_uncompressed in dump_instruction
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
b18fd234da i965/fs: Use instruction execution sizes instead of heuristics
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:15 -07:00
Jason Ekstrand
894ec5a1d8 i965/fs: Use instruction execution sizes to set compression state
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
8f1adb5965 i965/fs: Remove unneeded uses of force_uncompressed
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
2999f83bd9 i965/fs: Derive force_uncompressed from instruction exec_size
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
5f41d052bf i965/fs: Make fs_reg::effective_width take fs_inst* instead of fs_visitor*
Now that we have execution sizes, we can use that instead of the
   dispatch width.  This way it also works for 8-wide instructions in
   SIMD16.

i965/fs: Make effective_width a variable instead of a function

i965/fs: Preserve effective width in constant propagation

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
6ba31cc000 i965/fs: Better guess the width of LOAD_PAYLOAD
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
071ac3a467 i965/fs: Add an exec_size field to fs_inst
This will, eventually, allow us to manage execution sizes of
   instructions in a much more natural way from the fs_visitor level.

i965/fs: Explicitly set instruction execute size a couple of places

i965/blorp: Explicitly set instruction execute sizes

   Since blorp is all 16-wide and nothing isn't, in general, very careful
   about register width, we'll just set it all explicitly.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
fbc0a798ee i965/fs: Determine partial writes based on the destination width
Now that we track both halves of a 16-wide vgrf, we no longer need to worry
about force_sechalf or force_uncompressed.  The only real issue is if the
destination is too small.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
27d7ef094a i965/fs: Fix a bug in register coalesce
This commit fixes a bug in register coalesce that happens when one register
is moved to another the proper number of times but the channels are
re-arranged.  When this happens, the previous code would happily coalesce
the registers regardless of the fact that the channel mappins were wrong.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
16819b48ab i965/fs: Rework GEN5 texturing code to use fs_reg and offset()
Now that offset() can properly handle MRF registers, we can use an MRF
fs_reg and let offset() handle incrementing it correctly for different
dispatch widths.  While this doesn't have any noticeable effect currently,
it does ensure that the destination register is 16-wide which will be
necessary later when we start detecting execution sizes based on source and
destination registers.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
7210583eb8 i965/fs_reg: Allocate double the number of vgrfs in SIMD16 mode
This is actually the squash of a bunch of different changes.  Individual
commit titles follow:

i965/fs: Always 2-align registers SIMD16 for gen <= 5

i965/fs: Use the register width when applying offsets

   This reworks both byte_offset() and offset() to be more intelligent.
   The byte_offset() function now supports offsets bigger than 32. The
   offset() function uses the byte_offset() function together with the
   register width and the type size to offset the register by the correct
   amount.

i965/fs: Change regs_read to be in hardware registers

i965/fs: Change regs_written to be actual hardware registers

i965/fs: Properly handle register widths in LOAD_PAYLOAD

   The LOAD_PAYLOAD instruction is a bit special because it collects a
   bunch of registers (with possibly different widths) into a single
   payload block.  Once the payload is constructed, it's treated as a
   single block of data and most of the information such as register widths
   doesn't matter anymore.  In particular, the offset of any particular
   source register is the accumulation of the sizes of the previous source
   registers.

i965/fs: Properly set writemasks in LOAD_PAYLOAD

i965/fs: Handle register widths in demote_pull_constants

i965/fs: Get rid of implicit register doubling in the allocator

i965/fs: Reserve enough registers for PLN instructions

i965/fs: Make sources and destinations interfere in 16-wide

i965/fs: Properly handle register widths in CSE

i965/fs: Properly handle register widths in register_coalesce

i965/fs: Properly handle widths in copy propagation

i965/fs: Properly handle register widths in VARYING_PULL_CONSTANT_LOAD

i965/fs: Properly handle register widths and odd register sizes in spilling

i965/fs: Don't waste a register on texture lookups for gen >= 7

   Previously, we were waisting a register in SIMD16 mode because we could
   only allocate registers in pairs.  Now that we can allocate and address
   odd-sized registers, let's get rid of this special-case.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
4232a776a6 i965/fs: Handle printing of registers better.
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
5390ca8ce9 i965: Explicitly set widths on gen5 math instruction destinations.
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
004fbd5375 i965/fs: Make half() divide the register width by 2 and use it more
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
24d023b9fe i965/fs: Add a concept of a width to fs_reg
Every register in i965 assembly implicitly has a concept of a "width".
Usually, this is derived from the execution size of the instruction.
However, when writing a compiler it turns out that it is frequently a
useful to have the width explicitly in the register and derive the
execution size of the instruction from the widths of the registers used in
it.

This commit adds a width field to fs_reg along with an effective_width()
helper function.  The effective_width() function tells you how wide the
register effectively is when used in an instruction.  For example, uniform
values have width 1 since the data is not actually repeated, but when used
in an instruction they take on the width of the instruction.  However, for
some instructions (LOAD_PAYLOAD being the notable exception), the width is
not the same.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
1030ee6e9b i965/fs: A little harmless refactoring of register_coalesce
Just pass the visitor into is_copy_payload() and is_coalesce_candidate()
instead of a register size and the virtual_grf_sizes array.  Among other
things, this makes the code more obvious because you don't have to figure
out where src_size came from.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
f91b566f55 i965/brw_reg: Add a firsthalf function and use it in the generator
Right now, this function is a no-op but it indicates that we intend to only
use the first half of the 16-wide register.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
1728e74957 i965/fs: Copy propagate partial reads.
This commit reworks copy propagation a bit to support propagating the
copying of partial registers.  This comes up every time we have pull
constants because we do a pull constant read immediately followed by a move
to splat the one component of the out to 8 or 16-wide.  This allows us to
eliminate the copy and simply use the one component of the register.

Shader DB results:

total instructions in shared programs: 5044937 -> 5044428 (-0.01%)
instructions in affected programs:     66112 -> 65603 (-0.77%)
GAINED:                                0
LOST:                                  0

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
4d5f0eb048 i965/fs: Refactor fs_inst::is_send_from_grf()
A switch statement is much easier to read/edit than a big giant or
statement.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
54688cd03b i965/fs: Clean up emit_fb_writes
This splits emit_fb_writes into two functions: emit_fb_writes and
emit_single_fb_write.  This reduces the amount of duplicated code in
emit_fb_writes and makes the register number fiddling less arcane.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
72a3780f26 i965/fs: Print BAD_FILE registers in dump_instruction
Sometimes these show up in LOAD_PAYLOAD instructions and it's nice to be
able to see them.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:14 -07:00
Jason Ekstrand
2af4b0aeaf i965/fs: Make compact_virtual_grfs an optimization pass
Previously we disabled compact_virtual_grfs when dumping optimizations.
The idea here was to make it easier to diff the dumped shader because you
didn't have a sudden renaming.  However, sometimes a bug is affected by
compact_virtual_grfs and, when this happens, you want to keep dumping
instructions with compact_virtual_grfs enabled.  By turning it into an
optimization pass and dumping it along with the others, we retain the
ability to diff because you can just diff against the compact_virtual_grf
output.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
a25db10c12 i964/fs: Make immediate fs_reg constructors explicit
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
1c89e098e8 i965/fs: Make null_reg_* const members of fs_visitor instead of globals
We also set the register width equal to the dispatch width.  Right now,
this is effectively a no-op since we don't do anything with it.  However,
it will be important once we add an actual width field to fs_reg.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
ab7234c852 i965/fs: Use the var_from_vgrf helper function instead of doing it manually
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
c24dd54f97 i965/fs: Fix a bug with dead_code_eliminate on large writes
Previously, if an instruction wrote to more than one register, we
implicitly assumed that it filled the entire register.  We never hit this
before because the only time we did multi-register writes was things like
texturing which always wrote to all of the registers.  However, with the
upcoming ability to do 16-wide instructions in SIMD8 and things of that
nature, we can have multi-register writes at offsets and we'll hit this.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
1385a4b706 i965/fs: Use the UW type for the destination of VARYING_PULL_CONSTANT_LOAD instructions
Using a floating-point type doesn't usually cause hangs on my HSW, but the
simulator complains about it quite a bit.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
f0d43c09b2 i965/fs: Use offset a lot more places
We have this wonderful offset() function for advancing registers, but we're
not using it.  Using offset() allows us to do some sanity checking and
avoid manually touching fs_reg::reg_offset.  In a few commits, we will make
offset do even more nifty things for us.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
0089d025aa i965/fs: fix a comment in compact_virtual_grfs
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
3dc3fccb75 i965/fs: Rewrite fs_visitor::split_virtual_grfs
The original vgrf splitting code was written with the assumption that vgrfs
came in two types: those that can be split into single registers and those
that can't be split at all It was very conservative and bailed as soon as
more than one element of a register was read or written.  This won't work
once we start allowing a regular MOV or ADD operation to operate on
multiple registers.  This rewrite allows for the case where a vgrf of size
5 may appropriately be split in to one register of size 1 and two registers
of size 2.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
f9da0740e2 i965/fs_live_variables: Use var_from_vgrf insead of repeating the calculation
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-30 10:29:13 -07:00
Jason Ekstrand
75afe17b79 i965/fs: Manually generate the meta fast-clear shader
Previously, we were generating the fast-clear shader from GLSL.  The
problem is that fast clears require that we use a replicated write rather
than a regular write instruction.  In order to get this we had a
complicated and somewhat fragile optimization pass that looked for places
where we can use a replicated write and used it.  Since replicated writes
have a lot of restrictions, we only ever use them for fast-clear
operations.

This commit replaces the optimization pass with a function that just
generates the shader we want.  This is a) less code, b) less fragile than
the optimization pass, and c) generates a more efficient shader.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-30 10:29:13 -07:00
Michel Dänzer
61128d7507 radeonsi: Pass the slice size to si_dma_copy_buffer
Otherwise some parts of tiled slices can be missed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-30 18:55:48 +09:00
Michel Dänzer
74aeccd701 radeonsi: Catch more cases that can't be handled by si_dma_copy_buffer/tile
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-30 18:55:48 +09:00
Michel Dänzer
d17b85524d radeonsi: Fix si_dma_copy(_tile) for compressed formats
Fixes GPUVM faults when running the piglit test "getteximage-formats
init-by-rendering" with R600_DEBUG=forcedma on SI.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-30 18:55:48 +09:00
Michel Dänzer
761d80ddab radeonsi: Fix tiling mode index for stencil resources
We are currently only dealing with depth-only or stencil-only resources
here, not with resources having both depth and stencil[0]. In both cases,
the tiling mode index is in the tile_mode field, not in the
stencil_tile_mode field.

[0] Add an assertion for that.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-30 18:55:48 +09:00
Chia-I Wu
594e1a2f4b ilo: fix format of edge flag pointer
The VE format of edge flag pointers was changed in
780ce576bb.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-30 16:41:32 +08:00
Chia-I Wu
2d13b5ac81 ilo: add a pass to finalize ilo_ve_state
Add finalize_vertex_elements() to finalize ilo_ve_state.  This fixes a
potential issue with URB entry allocation for VS and move the complexity of
gen6_3DSTATE_VERTEX_ELEMENTS() to the new function.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-30 16:41:32 +08:00
Chia-I Wu
2b4c8ffc30 ilo: precalculate aligned depth buffer size
To replace the hacky zs_align_surface().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-30 16:41:31 +08:00
Chia-I Wu
343b014b57 ilo: use dynamic bo for rectlist vertices
The size is always 24 bytes.  We can upload them to the dynamic buffer.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-30 16:41:31 +08:00
Thomas Hellstrom
46537f1d03 st/xa: Fix regression in xa_yuv_planar_blit()
Commit "st/xa: scissor to help tilers" broke xa_yuv_planar_blit() and vmwgfx
textured video. Fix this by implementing scissors also in the yuv draw path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-30 08:31:33 +02:00
Kenneth Graunke
68627235f2 i965: Delete intel_chipset.h.
Unused; it was replaced by include/pci_ids/i965_pci_ids.h long ago.

Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-29 20:10:00 -07:00
Alex Henrie
3bea907797 driconf: Correct and update Catalan translation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-29 17:45:41 -07:00
Alex Henrie
33a7d0d040 driconf: Update Spanish translation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-29 17:45:26 -07:00
Alex Henrie
3b34b876f4 driconf: Synchronize po files
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-09-29 17:45:10 -07:00
Eric Anholt
4ceaad14ff vc4: Don't try to do stores to buffers that aren't bound.
The code was kind of mixed up what buffers were getting stored in the case
that a resolve bit was unset (which are set based on the GL state at draw
time) and the buffer wasn't actually bound.  In particular, depth-only
rendering would store the color buffer contents, which happen to be
pointing at the depth buffer.

Thanks to clearing out the resolve bits for things we really can't
resolve, now I can drop the safety checks for buffer presence around the
actual stores.

Fixes 42 piglit tests.
2014-09-29 17:44:15 -07:00
Eric Anholt
1d42aa8358 vc4: Shove some depth comparison bits down to where they're used. 2014-09-29 17:44:15 -07:00
Matt Turner
66ab9c22fe i965: Use BRW_MATH_DATA_SCALAR when source regioning is scalar.
Notice the mistaken (but harmless) argument swapping in brw_math_invert().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-29 15:59:19 -07:00
Matt Turner
a0df258f89 i965/compaction: Move variable declarations to their uses.
Tested-by: Mark Janes <mark.a.janes@intel.com>
2014-09-29 15:59:16 -07:00
Matt Turner
a36631b74c i965/compaction: Simplify jump target code.
My attempts to clarify the code with _compacted/_uncompacted prefixed
variables apparently failed. Hopefully this is clearer.

In any case, the previous code wasn't clear enough to gcc to let it
optimize division by a power of two into a shift. No problems now.

Also, the previous code (in the ADD case) didn't work on 32-bit x86, due
to complicated set of interactions best summed up as unsigned division
and compiler optimizations.

Tested-by: Mark Janes <mark.a.janes@intel.com>
2014-09-29 15:58:57 -07:00
Rob Clark
dce96f6da2 freedreno/a3xx: re-emit shaders on variant change
We need to keep track if a state change other than frag/vert shader
state will trigger us to need a different shader variant, and if
necessary mark the appropriate shader state as dirty.  Otherwise we will
forget to re-emit the shader state.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:43 -04:00
Rob Clark
3aaab87563 freedreno/ir3: add some cmdline args
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:43 -04:00
Rob Clark
7cdd467994 freedreno/a3xx: add support to emulate GL_CLAMP
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:43 -04:00
Rob Clark
3541705816 freedreno: add texcoord clamp support to lowering
This is for hw that needs to emulate some texture wrap modes (like
CLAMP) with some help from the shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:43 -04:00
Rob Clark
a6746d1124 freedreno: move bind_sampler_states to per-generation
Keep the existing function as a common helper.  But this lets us move an
a2xx specific hack out of common code.  And the PIPE_TEX_WRAP_CLAMP
emulation will require an a3xx specific hack.  So rather than piling on
hacks, split this out.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:42 -04:00
Rob Clark
7e20c09d4a freedreno/a3xx: fix border color order
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:42 -04:00
Rob Clark
c61133046e freedreno/a3xx: add 32bit integer vtx formats
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-29 18:30:42 -04:00
Eric Anholt
fc4b5b85ce vc4: Add support for GL 1.1's stupid CLAMP mode.
We just clamp the incoming texture coordinates.  This breaks the lambda
calculation, but it gets the piglit tests to pass.  This is the same
behavior as in i965.
2014-09-29 14:12:33 -07:00
Eric Anholt
ae22f5aa14 vc4: Add support for texture border color.
One spot in the docs says that it's stored at a miplevel just beyond the
last miplevel, which was scary.  But really, you just load it as the R
coordinate (which conflicts with cubemaps, but you don't do border
clamping on cubes).
2014-09-29 13:48:08 -07:00
Eric Anholt
b65761f764 vc4: Add the necessary stubs for occlusion queries.
We have to expose them for GL 2.0, but we just always return a value of 0.
We should be advertising 0 query bits instead of 64, but gallium doesn't
have plumbing for that yet.  At least this stops the segfaults.
2014-09-29 11:51:09 -07:00
Eric Anholt
76cd9955d9 vc4: Optimize out silly SUBs of 0.
Drops instructions on vs-temp-array-mat4-index-col-row-wr.shader_test,
which I was looking at because it's failing to register allocate.
2014-09-29 11:33:34 -07:00
Eric Anholt
64122b16ce vc4: Dump constant uniform values in VC4_DEBUG=qir.
Definitely helps when trying to understand and optimize a program.
2014-09-29 11:33:34 -07:00
Eric Anholt
3311513041 vc4: Turn a SEL_X_Y(x, 0) into SEL_X_0(x).
This may reduce register pressure and uniform counts.  Drops a bunch of 0
uniform loads on vs-temp-array-mat4-index-col-row-wr.shader_test, which is
failing to register allocate.
2014-09-29 11:33:34 -07:00
Eric Anholt
730267eb23 vc4: Add support for texture cube maps.
It's not passing some of the piglit tests, because it looks like at small
miplevels some contents from surrounding faces are getting filtered in at
the corners.  It does get 7 new tests passing.
2014-09-29 11:29:28 -07:00
Eric Anholt
c4245d8b2e vc4: Rename the slice's size0.
In the other related fields, "0" refers to the size of the first miplevel,
while this is a field in a slice.  The other implicit slices we have
(cubemap layers) don't vary in size compared to the first one.
2014-09-29 11:26:43 -07:00
Eric Anholt
7a85ebf6e2 vc4: Stop trying to reuse temporaries that store uniform values.
Almost always, the MOV will get copy propagated out.  Even if it doesn't,
it's probably better to just reload the uniform at next use (to reduce
register pressure) rather than try to save instruction count.

I was looking at this because in the presence of texturing (which calls
add_uniform() directly to get the uniform load forced into the
instruction) the c->uniform_contents indices don't match 1:1 with the
temporary qregs.
2014-09-29 10:07:24 -07:00
Tapani Pälli
3386e95994 egl: setup screen iterator before using it
commit 4ed23fd broke creation of pbuffer surfaces, patch fixes
the failure, noticed when running chrome with '--use-gl=egl'.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-09-29 15:12:11 +03:00
Chia-I Wu
8c7c0f7114 ilo: fix a missing 'else'
An 'else' is missing in the disassembler.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-29 16:58:36 +08:00
Kalyan Kondapally
66a2fe4cf9 glsl: Allow texture2DProjLod and textureCubeLod in GL ES
According to GLES (i.e. 1.0 and above) spec textureCubeLod and
texture2DProjLod are built in functions. We seem to disable support
for these functions with GLES. This patch enables the support.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84355
2014-09-29 11:10:38 +03:00
Rob Clark
40aabc0e80 configure.ac: bump libdrm_freedreno requirement
We need 2.4.57 for fd_bo_dmabuf() / fd_bo_from_dmabuf().

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-28 12:46:17 -04:00
Matt Turner
5ccdc23a86 glsl: Recognize open-coded pow(x, y).
pow(x, y) is equivalent to exp(log(x) * y).

instructions in affected programs:     578 -> 458 (-20.76%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-27 12:18:37 -07:00
Matt Turner
e9aee2572a i965/fs: Don't invalidate live intervals in saturate propagation.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-27 12:18:37 -07:00
Matt Turner
b9689c6bda i965/fs: Ignore mov.sat instructions in interference check in sat prop.
When an instruction's result was consumed by multiple mov.sat
instructions, we would decide that we couldn't move the saturate
modifier because something else was using the result, even though it was
just another mov.sat!

total instructions in shared programs: 4275598 -> 4274842 (-0.02%)
instructions in affected programs:     75634 -> 74878 (-1.00%)

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-27 12:18:37 -07:00
Matt Turner
82bdb559a1 i965/fs: Walk instructions in reverse in saturate propagation.
When we find a mov.sat, we search backwards. We might as well search
everything else backwards as well and potentially look at fewer
instructions.

This change enables the next patch.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-27 12:18:37 -07:00
Rob Clark
ed48f91275 freedreno/a3xx: add flat interpolation mode
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
df2f0c6d55 freedreno/a3xx: add LOD_BIAS
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
f7259949da freedreno: turn missing caps into compile warnings
Get rid of the 'default' case (as suggestied by imirkin) so compiler
warns us about missing caps.  Also add some caps that were missing until
now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
546d6c8dc9 freedreno: we have more than 0 viewports!
4155d1c7 'st/mesa: drop dependence on API profile in st_init_extensions'
broke freedreno because somehow 'PIPE_CAP_MAX_VIEWPORTS' fell through
the cracks.  Resulting that we reported zero viewports.  So the state
tracker never bothered to give us any valid viewport!

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
24cd746e4b freedreno: update generated headers
Among other things, fixes a bug for fixed point registers/bitfields.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
5c72672cdc freedreno: don't advertise mirror-clamp support
At least on a3xx, we cannot do it without some emulation in shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Rob Clark
e4c678c164 freedreno: fix compiler warning
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-27 13:34:07 -04:00
Tom Stellard
ec566e0f16 configure.ac: Compute LLVM_VERSION_PATCH using llvm-config
This is the only guaranteed way get the patch level for llvm,
since the define cannot always be found in config.h depending
on the version of llvm or the build system used.

CC: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
2014-09-27 17:46:39 +01:00
Emil Velikov
5ef6eb4654 Remove Bluegene/L wrappers
Added back in 2009, with osmesa/GLU in mind. Unlikely to be working
any more since the removal of the static makefiles.

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-27 15:21:22 +01:00
Emil Velikov
343795e445 mesa: remove last DJGPP remains
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-27 15:20:49 +01:00
Emil Velikov
a662fa94c1 configure: use explicit enabled/disabled in config switch description
Rather than having double negatives -> disable-opencl, default=no
simply use enabled/disabled. It makes things a bit easier for the
reader and consistent throughout the file.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-27 15:20:42 +01:00
Emil Velikov
bbe6f7f865 configure: ask vdpau.pc for the default location of the vdpau drivers
Rather than using hardcoded values honor the value set at libvdpau
build time - i.e. the moduledir variable from vdpau.pc

Update the omx description to match reality while we're here.

Cc: Christian König <deathsimple@vodafone.de>
Cc: Alexandre Demers <alexandre.f.demers@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-27 15:20:26 +01:00
Emil Velikov
407450eb84 configure: drop --with-egl-driver-dir switch
The location of the egl driver(s) is matter that we should have
never exposed to the user. Currently the dri2 driver is built
into the libEGL loader, with the gallium based one soon to follow.

v2: Fold EGL_DRIVER_INSTALL_DIR within the makefiles. Suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80615
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-27 15:20:14 +01:00
Emil Velikov
2e6fc0647a configure: remove non-functional --with-opencl-libdir
The parameter used to control where the gallium pipe-drivers
were installed, but was broken since

commit 45270fb0fd
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 13 10:45:01 2012 -0700

    targets/pipe-loader: Convert to automake

Considering that nowadays the pipe-drivers can be used by
more than just the opencl target, even fixing this up will
not be the best idea.

Cc: Matt Turner <mattst88@gmail.com>
Cc: Francisco Jerez <currojerez@riseup.net>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61415
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-27 15:15:58 +01:00
Ian Romanick
c3f17bb18f glsl: Strip arrayness from ir_type_dereference_variable too
If the thing being dereferenced is a record or an array of records, it
should be treated as row-major.  The ir_type_derference_record path
already does this, and I think I intended to do the same for this path
in b17a4d5d.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83741
Cc: mesa-stable@lists.freedesktop.org
2014-09-26 07:59:53 -07:00
Ian Romanick
2ab71e1486 glsl: Round struct size up to at least 16 bytes
Per rule #9, the size of the structure is vec4 aligned.  The MAX2 in the
loop ensures that sizes >= 16 bytes are vec4 aligned.  The new MAX2
after the loop ensures that sizes < 16 bytes are vec4 aligned.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Cc: mesa-stable@lists.freedesktop.org
2014-09-26 07:59:50 -07:00
Ian Romanick
5c75270c34 glsl: Make sure row-major array-of-structure get correct layout
Whether or not the field is row-major (because it might be a bvec2 or
something) does not affect the array itself.  We need to know whether an
array element in its entirety is row-major.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506
Cc: mesa-stable@lists.freedesktop.org
2014-09-26 07:59:47 -07:00
Ian Romanick
8e01c66da6 glsl: Make sure fields after small structs have correct padding
Previously the linker would correctly calculate the layout, but the
lower_ubo_reference pass would not apply correct alignment to fields
following small (less than 16-byte) nested structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83533
Cc: mesa-stable@lists.freedesktop.org
2014-09-26 07:59:25 -07:00
Chia-I Wu
24653bcd7d ilo: give gen6_draw_session a better prefix
gen6_draw_session is not GEN dependent.  Rename it to ilo_render_draw_session.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
4be7b7ee85 ilo: make ilo_render opaque
It is not used outside the render code.  There are also too many details in it
that we do not want other components to access directly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
8f284343e0 ilo: make ilo_render_emit_draw() direct
Remove emit_draw() and ILO_RENDER_DRAW indirections.  With all emit functions
being direct now, ilo_render_estimate_size() and more can also be removed.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
a05ce904aa ilo: make ilo_render_emit_rectlist() direct
Remove emit_rectlist() and ILO_RENDER_RECTLIST indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
362d2fb982 ilo: clean up draw and rectlist state emission
Add these new high-level functions

  ilo_render_get_draw_dynamic_states_len()
  ilo_render_emit_draw_dynamic_states()
  ilo_render_get_rectlist_dynamic_states_len()
  ilo_render_emit_rectlist_dynamic_states()
  ilo_render_get_draw_surface_states_len()
  ilo_render_emit_draw_surface_states()

for draw and rectlist state emission.  They are implemented in the new
ilo_render_dynamic.c and ilo_render_surface.c.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
f1662e3670 ilo: sanity check ilo_render_get_*_len()
Assert that we never write more than what ilo_render_get_*_len() returns.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
7fc7415316 ilo: simplify ilo_render_get_query_len()
For all supported query types, we always emit a PIPE_CONTROL.  Call
ilo_render_get_flush_len() for simplicity and clarity.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
0afc17ea49 ilo: make ilo_render_emit_query() direct
Remove emit_query() and ILO_RENDER_QUERY indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
18cbd3cc34 ilo: make ilo_render_emit_flush() direct
Remove emit_flush() and ILO_RENDER_FLUSH indirections.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
e3451552d2 ilo: simplify ilo_render invalidation
ilo_render is based on ilo_builder.  We should only care if the builder
buffers are invalidated, or if the hardware context is invalidated.  Replace
ilo_render_invalidate() with flags by ilo_render_invalidate_builder() and
ilo_render_invalidate_hw().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
ce2bda300d ilo: add ilo_builder_{dynamic,surface}_used()
Return how many DWords are used in dynamic and surface buffers respectively.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
2df2f60e8d ilo: rename state buffer to dynamic buffer
Both dynamic buffer and surface buffer are state buffers.  We should not use
state buffer to refer to the former.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
a7f2ab668c ilo: constify ilo_render in ilo_render_get_sample_position()
It is a getter and is not supposed to modify ilo_render.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
23d66a42a3 ilo: rename 3d_pipeline to render
Follow the file renaming.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
3afe30e64b ilo: remove struct ilo_3d
Move members of ilo_3d that still make sense to ilo_context.  With ilo_3d
gone, rename functions whose names begin with ilo_3d to something more
appropriate.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
b6443ae969 ilo: rename ilo_3d_pipeline*.[ch] to ilo_render*.[ch]
They are used to build render engine commands, which can be more than 3D.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Chia-I Wu
392890d5de ilo: rename ilo_3d.[ch] to ilo_draw.[ch]
There is not much left in struct ilo_3d.  We want to kill it and ilo_3d.[ch]
will be bad names.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-26 21:15:55 +08:00
Michel Dänzer
7e55c3b352 st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers
Such buffers can only be useful by reading from them with the CPU, so we
need to make sure CPU reads are fast.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-26 16:53:13 +09:00
Tapani Pälli
9caa5c3b13 glsl: remove unused link_assign_uniform_block_offsets
ubo offsets are assigned by link_uniform_blocks since 514f8c7e

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-26 08:29:10 +03:00
Kalyan Kondapally
e018ea81bf glsl: Structures must have same name to be considered same type.
According to GLSL(4.2) and GLSL-ES (1.0, 3.0) spec, Structures must
have the same name to be considered same type. We currently ignore
the name check while checking if two records are same. This patch
fixes this.

Patch fixes failing tests in WebGL conformance test
'shaders-with-uniform-structs' when running Chrome on OpenGL ES.

v2: Do not force name comparison with unnamed types (Tapani)
v3: Cleanups (Matt)

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83934
2014-09-26 08:29:10 +03:00
Tapani Pälli
1cb81d3a9b glsl: fix uniform location count used for glsl types
Patch fixes the slot count used by vector types and adds 1 slot
to be used by image and sampler types.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82921
2014-09-26 08:29:10 +03:00
Ilia Mirkin
a5bbfeda97 gm107/ir: take relative pfetch offset into account
There is no dedicated instruction for this, so just combine it with the
constant offset.

Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-26 01:13:06 -04:00
Michel Dänzer
4a38b154fd gallivm: More fallout from disabling with LLVM 3.6
The draw module would still try to use gallivm, causing many piglit tests
to fail with an assertion failure. llvmpipe might have been similarly
affected.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-26 11:35:52 +09:00
Ilia Mirkin
cdc4de1215 gm107/ir: add support for indirect const buffer selection
This was missed in the commit that enabled it for fermi/kepler as part
of ARB_gpu_shader5

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-25 22:15:50 -04:00
Ilia Mirkin
0532a5fd00 gm107/ir: fix texture argument order
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-25 22:15:50 -04:00
Ilia Mirkin
d3c3bba6d0 gm107/ir: fix manual TXD for array targets
This parallels the fixes in commit afea9bae.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
d78b533c29 nouveau: fix glCompressedTexImage
mesa_texstore expects pixel data, not compressed data. For compressed
textures, we want to just copy the bits in without any conversion.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
0147c10c5f nv50/ir: avoid deleting pseudo instructions too early
What happens is that a SPLIT operation is part of the spill node, and as
a pseudo op, the instruction gets erased after processing its first def.
However the later defs still need to refer to it, so instead delay
deleting until after that whole RA node is done processing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79462
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
9d2e298dd4 mesa/st: NumLayers is only valid for array textures
For 3d textures, NumLayers is set to 1, which is not what we want. This
fixes the newly added gl-layer-render-storage test (which constructs
immutable 3d textures). Fixes regression introduced in d82bd7eb06.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84145
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
fca2216ced nv50/ir: add some comments on edge classification
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
1ae32e24ca nv50,nvc0: fix 3d blit logic for odd depth/stencil formats
Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-25 22:15:49 -04:00
Ilia Mirkin
b49dfb68ed nv50,nvc0: add missing depth/stencil formats to tile flag selection
Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-25 22:15:49 -04:00
Eric Anholt
db11eb92cf vc4: Switch from errx() to fprintf() and abort().
These are pretty catastrophic, "should never happen" failure paths (though
4 tests in piglit hit them currently, due to a single bug).  An abort()
that you can gdb on easily is probably more useful than a clean exit,
particularly since a bug in piglit framework right now is causing early
exit(1)s to simply not be recorded in the results at all.
2014-09-25 16:41:25 -07:00
Eric Anholt
45962fbeee vc4: Fix miplevel validation for raster textures.
We were using the un-minified value, meaning we'd reject correctly laid
out textures.
2014-09-25 16:41:25 -07:00
Matt Turner
43267a325f mesa: Replace IS_NEGATIVE(x) with x < 0.0f.
I only made IS_NEGATIVE(x) use signbit in commit 0f3ba405 in an attempt
to fix 54805, but it didn't help. We didn't use signbit on some
platforms and instead defined it to x < 0.0f.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-25 13:57:29 -07:00
Matt Turner
50e2f70093 radeon: Use PRINTLIKE macro. 2014-09-25 13:57:29 -07:00
Matt Turner
b66791d47f configure.ac: Replace gallium_check_st with gallium_require_drm. 2014-09-25 13:57:29 -07:00
Matt Turner
28e84c93bb configure.ac: Drop gallium directory tracking.
Was only tracked to be printed at the end of configure, but configure
quits if it can't build something we requested, rather than silently
dropping it, so printing these directories has little use.
2014-09-25 13:57:29 -07:00
Matt Turner
691bd9b9df configure.ac: Use autoconf macro for GNU make. 2014-09-25 13:57:28 -07:00
Matt Turner
e4be17fd04 ralloc: Mark ralloc functions with gcc's malloc attribute.
Cuts a few hundred bytes from the DRI drivers, so it must give gcc some
extra information.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 13:52:55 -07:00
Matt Turner
976464c210 mesa: Replace a priori knowledge of gcc attributes with configure tests.
Note that I had to add support for testing the packed attribute to
m4/ax_gcc_func_attribute.m4.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [C bits]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 13:52:55 -07:00
Matt Turner
4a96df73e7 mesa: Replace a priori knowledge of gcc builtins with configure tests.
Presumbly this will let clang and other compilers use the built-ins as
well.

Notice two changes specifically:
   - in _mesa_next_pow_two_64(), always use __builtin_clzll and add a
     static assertion that this is safe.
   - in macros.h, remove the clang-specific definition since it should
     be able to detect __builtin_unreachable in configure.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> [C bits]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 13:52:55 -07:00
Matt Turner
3e00822619 i965/compaction: Document instruction compaction capabilities.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:37 -07:00
Matt Turner
54e30dbf4d i965: Emit ELSE/ENDIF JIP with type D on Gen 7.
The spec says the type must be W (JIP is 16-bits after all), but we've
been emitting it with a UD type all along and have experienced no
adverse effects. Changing the type to D allows ELSE and ENDIF
instructions to be compacted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
6a4e84edfa i965/compaction: Support compaction of control flow instructions.
We're currently emitting compactable control flow instruction the wrong
types, preventing their compaction. The next patch will fix this and
actually enable compaction.

On chips that cannot compact control flow instructions, attempts to find
a match in the datatype table will fail.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
14e44f896f i965/compaction: Add support for G45.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
5a559557e6 i965: Add BRW_OPCODE_NENOP for G45.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
64c0f62018 i965/compaction: Add support for Gen5.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
bb05b530ab i965/compaction: Reduce size of compacted_counts[] array.
The array was previously indexed in units of brw_compact_inst (8-bytes),
but before compaction all instructions are uncompacted, so every odd
element was unused.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
90c982a8a8 i965/compaction: Use sizeof brw_inst/brw_compact_inst.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
b92a1e2174 i965/compaction: Increment offset in for loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
eebf1f5441 i965/compaction: Make src_offset local to the for loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
cde887ccb1 i965/compaction: Remove unnecessary is-compacted? check.
Used to pass over previously compacted instructions in this loop, but no
longer. No point in checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
118021f929 i965/compaction: Don't set UIP on ELSE on Gen < 8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
45c3ece266 i965/compaction: Rework 3-src compaction logic.
It may be possible to create a contrived example in which a 3-src
instruction would have been compacted on Gen < 8. I'd rather not
discover it in the wild.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
1fce6fcac1 i965/sf: Disable instruction compaction.
Currently a no-op, since instruction compaction isn't implemented for the
generations that have a programmable strips-and-fans unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Matt Turner
b5466707d6 i965: Set JumpCount, not JIP, on ENDIF on Gen 6.
Despite what the Sandybridge PRM says, ENDIF has Jump Count in <dst>,
not JIP in <src1>. (The same mistake appears about WHILE as well).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-25 11:02:36 -07:00
Kenneth Graunke
23247e8059 mesa: Use VertexArray, not _VertexArray, in array size expressions.
Both sizes are VERT_ATTRIB_MAX, so this has no effect.  But it drops a
few trivial uses of the derived state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 23:14:26 -07:00
Kenneth Graunke
f81052dc9b mesa: Set correct array element in vbo_exec_vtx_init.
I'm not familiar with this code, but this sure appears to be a typo.
It looks like the intent is to set each array element, not arrays[0]
each time.  Notably, the loop just below uses "array", not "arrays".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-24 23:14:23 -07:00
Kenneth Graunke
d0ec6e8509 mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).
The code in get.c that handles this uses ctx->Array.VAO->VertexAttrib,
which is a gl_vertex_attrib_array structure, not a gl_client_array.

The offsets of all fields happened to be the same in both structures, at
least on x86_64.  "Size," "Type," and "Stride" are obviously the same:
both structures start with the same fields, in the same order.

"Enabled" is dicier: there are different fields before it in both
structures, including pointer sized values which might need special
alignment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-24 23:14:16 -07:00
Kenneth Graunke
8c16a0d7ba mesa: Remove some dead helper functions.
Dead since the _MaxElement removal, but these functions seemed generally
applicable, so I decided to remove them in a separate patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 23:13:56 -07:00
Eric Anholt
a04605a8ca vc4: Compute max_index instead of trusting the rest of userspace.
max_index was coming from either the user telling us as part of
glDrawRangeElements, or from an incidental calculation as part of some
sort of primitive conversion fallback.  Sometimes, it was just set to the
default "I don't know" ~0 value.

If it wasn't set to the actual max index, then the kernel would reject the
draw call for allowing out-of-bounds VBO reads.  So, compute the max index
from the sizes of the VBOs, which isn't too expensive (unlike mapping and
reading the index buffer) and is reliable.

Fixes piglit vao-element-array-buffer.
2014-09-24 20:51:15 -07:00
Eric Anholt
61cb08ab4f vc4: Move shader record setup before the draw call.
The flush only happens after both are written, so we can do them in either
order.  This will let me compute max_index during the shader record setup.
2014-09-24 20:49:08 -07:00
Matt Turner
ba0c0a186d i965/vec4: Call calculate_cfg() in test programs to avoid crashing.
Reported-by: Mark Janes <mark.a.janes@intel.com>
2014-09-24 16:06:41 -07:00
Eric Anholt
52476b35c1 vc4: Add support for gl_PointCoord.
Fixes piglit glsl-fs-pointcoord, point-sprite, and fbo-gl_pointcoord.
2014-09-24 15:59:03 -07:00
Eric Anholt
66b7bd60e0 vc4: Add support for point size setting.
This is the support for both the global and per-vertex modes.
2014-09-24 15:56:39 -07:00
Eric Anholt
f24588d64e vc4: Add support for line width setting.
I don't see piglit tests for it, but this should be better than not
emitting it at all.
2014-09-24 15:56:39 -07:00
Eric Anholt
7fa399f93a vc4: Actually add support for polygon offset.
Setting the bit without setting the offset values is kind of useless.
Fixes piglit polygon-offset (but not polygon-mode-offset).
2014-09-24 15:56:39 -07:00
Eric Anholt
6abbdfe3db vc4: Fix swapped 565 dithering versus no-dithering render configs.
Fixes many 565 piglit tests (like fbo-generatemipmap-formats) that weren't
expecting dithering.
2014-09-24 15:56:39 -07:00
Eric Anholt
8cd165051b vc4: Add support for alpha test.
Fixes most of piglit fbo-alphatest-formats (but not RGB565/332).
2014-09-24 15:56:39 -07:00
Rob Clark
a87e44da3a freedreno/a3xx: initial texture border-color
Still some open questions.. and at any rate, no additional piglit passes
due to various wrap modes that we need to emulate in at least some
cases :-(

But it does fix some mystery page-faults.. So add some comments in the
code where there are things that we need to emulate or do more r/e, and
push as-is.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-24 18:52:58 -04:00
Brian Paul
9f47220450 util: use linear formats in util_blit_pixels()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-24 15:35:11 -06:00
Brian Paul
b6947e02de util: simplify writemask parameters for util_blit_pixels()
Instead of separate color and Z/S writemasks, just have one writemask
parameter that takes a mask of the PIPE_MASK_[RGBAZS] flags.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-24 15:35:11 -06:00
Brian Paul
b32f05e153 util: s/PIPE_TEX_MIPFILTER/PIPE_TEX_FILTER/ in u_blit code
PIPE_TEX_MIPFILTER_x is not legal for the pipe_sampler_state::
min/mag_img_filter fields.  But PIPE_TEX_MIPFILTER_x == PIPE_TEX_FILTER_x
so we were getting lucky.

This also makes the code consistent with u_blitter.c.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-24 15:35:10 -06:00
Brian Paul
f5e8b30472 mesa: remove EXT suffix from FBO error messages
And use pass caller="" for _mesa_FramebufferTexture().

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-24 15:35:10 -06:00
Matt Turner
5980fc35c9 mesa: Drop _mesa_getenv() wrapper.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
209eba42eb mesa: Drop _mesa_bsearch() wrapper.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
9499d6e358 mesa: Unifdef _WIN32_WCE.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
d20015a576 mesa: Unifdef _XBOX.
Inexplicably added in commit 36940429.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
b133b84733 configure.ac: Remove duplicate -DHAVE_PTHREAD.
It's also defined by the AX_PTHREAD macro.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
d1022529fe configure.ac: Stop checking for perl.
Added by commit a75c6163, but no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
585e250dd2 configure.ac: Use test -a, rather than another test.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 09:58:43 -07:00
Matt Turner
452926a5ec mesa: Use realloc() instead of _mesa_realloc() and remove the latter.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-24 09:58:42 -07:00
Matt Turner
e5162defc8 mesa: Remove duplicate _mesa_{init,free}_shader_state prototypes.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-24 09:58:42 -07:00
Tom Stellard
180b152b24 gallivm: Wrap deleted inlcude in if HAVE_LLVM < 0x0306
This was missed in 8f4ee56.
2014-09-24 11:54:44 -04:00
Matt Turner
ef75f60822 i965: Add and use functions to get next/prev blocks.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
444fc0b4a8 i965: Call insert and remove functions from exec_node directly.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
49374fab5d i965: Make instruction lists local to the bblocks.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
3fe1a84bbe i965/cfg: Add note about double-loop macros and break behavior.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
153d148e9e i965: Replace initialization loops with memset().
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
72bb3f81c6 i965/vec4: Don't iterate between blocks with inst->next/prev.
The register coalescing portion of this patch hurts three shaders in
Guacamelee by one instruction each, but examining the diff makes me
believe that what we were generating was (perhaps harmlessly) incorrect.
2014-09-24 09:42:46 -07:00
Matt Turner
f0598d413b i965/fs: Don't iterate between blocks with inst->next/prev.
When instruction lists are per-basic block, this won't work.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
7119712f45 i965/cfg: Add macros to iterate through a block given a starting point.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
235f451f7a i965/fs: Make count_to_loop_end() use basic blocks.
When the instructions aren't in a flat list, this wouldn't have worked.
Also, this should be faster.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
90bfeb2244 i965/vec4: Don't use instruction list after calculating the cfg.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
2ff0ff880c i965/fs: Don't use instruction list after calculating the cfg.
The only trick is changing a break into a return true in register
coalescing, since the macro is actually a double loop, and break will do
something different than you expect. (Wish I'd realized that earlier!)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
a4fb8897a2 i965: Remove now unneeded calls to calculate_cfg().
Now that nothing invalidates the CFG, we can calculate_cfg() immediately
after emit_fb_writes()/emit_thread_end() and never again.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
072ea414d0 i965: Remove cfg-invalidating parameter from invalidate_live_intervals.
Everything has been converted to preserve the CFG.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
9e28bb863c i965: Preserve the CFG in instruction scheduling.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
269b6e24d6 i965/vec4: Preserve CFG in spill_reg().
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
b0b64c85e4 i965/vec4: Preserve the CFG in a few more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Matt Turner
a9f8296dbb i965/fs: Preserve the CFG in a few more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-24 09:42:46 -07:00
Kristian Høgsberg
9b75663866 i965: Restructure debug flags
This cleans up the debug flags to be consistently indented, use bit
shifting instead of hex-values and fixes a bug where the new DEBUG_NO8 flag
used the same value as the DEBUG_VUE flag.  This was hidden by the numbers not
being aligned.  Also removes gaps in the range where DEBUG_IOCTL (0x4) and
DEBUG_REGION (0x400) used to be.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-09-24 09:15:09 -07:00
Tom Stellard
8f4ee56e49 gallivm: Disable gallivm to fix build with LLVM 3.6
LLVM commit r218316 removes the JITMemoryManager class, which is
the parent for a seemingly important class in gallivm.  In order to
fix the build, I've wrapped most of lp_bld_misc.cpp in
if HAVE_LLVM < 0x0306 and modifyed the
lp_build_create_jit_compiler_for_module() function to return false
for 3.6 and newer which effectively disables the gallivm functionality.

I realize this is overkill, but I could not come up with a simple
solution to fix the build.  Also, since 3.6 will be the first release
without the old JIT, it would be really great if we could
move gallivm to use the C API only for accessing MCJIT.  There
is still time before the 3.6 release to extend the C API in
case it is missing some functionality that is required by gallivm.
2014-09-24 10:34:19 -04:00
Marek Olšák
2f7714e071 gallium/rbug: correctly unreference a sampler view
This fixes heap corruption. The sampler view can be bound in the context,
so we cannot call destroy directly.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
91ddf49c87 gallium/rbug: unlock a mutex in rbug_create_query
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
c944866708 radeonsi: remove old cache flushing code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
dd53d53dc6 radeonsi/compute: do CS partial flush with si_emit_cache_flush
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
604b58b554 radeonsi/compute: flush caches with si_emit_cache_flush
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
628f8ee1d9 radeonsi/compute: directly emit CONTEXT_CONTROL
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
dc05a9e4e0 radeonsi: properly destroy the GS copy shader and scratch_bo for compute
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
711623f7c8 radeonsi: release GS rings at context destruction
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
2833dc4e45 radeonsi: don't use pipe_constant_buffer for GS rings
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
1abb1a97b0 radeonsi: don't pass the context to the shader translator
This should prevent accessing context state there.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
e29353ff20 radeonsi: don't snoop currently-bound GS shader when compiling ES
Instead, pass the layout of GS inputs in memory to the ES using the shader
key. Only 64 bits are needed to represent the layout in the key.

Mixing and matching different VS and GS shaders should now always work.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
2774abd4ce radeonsi: shorten si_pipe_* prefixes to si_*
This was the original naming convention in r600g and it somehow crept
into radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
8c37c16cbc radeonsi: merge si_pipe_shader into si_shader
One is part of the other anyway.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
07c0b4d9b7 radeonsi: disable gl_SampleMask fragment shader output if MSAA is disabled
This fixes piglit: arb_sample_shading-builtin-gl-sample-mask 0

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
b53b1ceb3e radeonsi: only update MSAA-specific framebuffer state if nr_samples is changed
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
dba4c5baf4 radeonsi: move DB_SHADER_CONTROL into db_render_state
I will need this for fixing sample shading with 1 sample.

The good news is that all shader pm4 states no longer use the current context
state, so we can generate the pm4 states outside of draw_vbo if needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
adc5797f54 radeonsi: set KILL_ENABLE during shader compilation, remove uses_kill flag
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
a34c9f70b1 radeonsi: remove shader.ps_conservative_z, set db_shader_control instead
Also set the field on SI too. It's not just specific to CIK.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
884f1654e2 radeonsi: move DB registers from draw_vbo into new db_render_state
It's called db_misc_state in r600g.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
a768b43bc3 radeonsi: remove unused variable si_pipe_shader::sprite_coord_enable
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
fd076259ff radeonsi: document what si_descriptors.c does
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
4ace4190ac r300g: implement MSAA copies by resolving and upsampling
There's no other way. It will use hw resolve + blit.
2014-09-24 14:48:02 +02:00
Marek Olšák
6cfedf8797 st/mesa: redefine mapping from VARYING_SLOT_TEXi/PNTC/VARi to TGSI GENERIC[i]
Generic varyings in TGSI were based on the value of VARYING_SLOT_TEX0, so VAR0
was always GENERIC[22] (with tessellation patches). Some drivers might not
be able to cope with that.

This commit defines a proper mapping, so that PNTC is GENERIC[8] and VAR0 is
GENERIC[9].

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
77038cd35a st/mesa: don't set coord_enable for gl_PointCoord if using TGSI_SEMANTIC_PCOORD
This was missed when Christoph Bumiller added PIPE_CAP_TGSI_TEXCOORD.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
ffbcee8a57 st/mesa: use UniformBooleanTrue in glsl_to_tgsi
Just for consistency. This doesn't fix anything as the original code was
already pretty good.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
4155d1c7b0 st/mesa: drop dependence on API profile in st_init_extensions
The extensions and limits being set in the conditional block are core-only
anyway and don't have any effect on other profiles.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:02 +02:00
Marek Olšák
2599b92eb9 mesa: allow forcing >=3.1 compatibility contexts with MESA_GL_VERSION_OVERRIDE
E.g. the 4.0 compatibility profile can be forced with:

MESA_GL_VERSION_OVERRIDE=4.0COMPAT

Some tests that I have require 4.0 compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:01 +02:00
Marek Olšák
10ffd98c34 mesa: don't set ES versions to GLSLVersion in _mesa_init_constants
No place in Mesa expects an ES version there.
Drivers don't even set it like this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-24 14:48:01 +02:00
Emil Velikov
a3e9582f09 targets/vl: don't forget to set GALLIUM_STATIC_TARGETS
git rebase failure while dropping out a patch that reworks
the way we build aux/vl.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-24 11:54:28 +01:00
Emil Velikov
5a68432f04 targets/egl: fold in target LDFLAGS variables
Both variables are identical thus we can fold them into AM_LDFLAGS.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
a37b9bb555 targets: drop the old MEGADRIVERS & STATIC_TARGET... variables
No longer used/needed as of last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
0f3c0ff17b gallium/softpipe,llvmpipe: add automake target 'templates'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
29c4ae0ebf configure: remove NEED_{SOFT,LLVM}PIPE_DRIVER variables
The respective HAVE_{SOFT,LLVM}PIPE are already descriptive
enough. Additionally the svga modules does not really use either
one, but the auxiliary draw & gallivm modules.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
3d909864c8 gallium/vc4: add automake target 'templates'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
c2b5d7024e gallium/r300,r600,radeonsi: add automake target 'templates'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:01 +01:00
Emil Velikov
fd4cd8e20a gallium/svga: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:00 +01:00
Emil Velikov
ca32ce40b1 gallium/ilo: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:00 +01:00
Emil Velikov
defd48c6c5 gallium/i915: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:00 +01:00
Emil Velikov
97bec98ac9 gallium/freedreno: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:00 +01:00
Emil Velikov
0e59153229 gallium/nouveau: add automake target 'template'
Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:44:00 +01:00
Emil Velikov
6e1f846ce0 targets/pipe-loader: drop unused authentication
The dri, vdpau, omx, xvmc and gbm targets don't need any authentication
even the VL ones never used it. Either the respective loader or the
library itself (vl) is doing its auth prior to calling create_screen()

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:43:44 +01:00
Emil Velikov
18137c5fe0 targets/vl: fix hard-links when building shared pipe-drivers
Make sure that MEGADRIVERS is set in order to create the hardlinks.
The variable name is not the most appropriate and will be sorted
out in upcoming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:38:43 +01:00
Emil Velikov
1cb8bba499 configure: remove unused variable OSMESA_MESA_DEPS
Leftover from the static Makefiles

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:38:43 +01:00
Emil Velikov
523fa2f1ce gallium/freedreno: remove unused draw header
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:38:43 +01:00
Emil Velikov
e8053bb65e gallium/r300: remove obsolete declaration
The definition of rc_pair_regalloc_inputs_only() is no longer
around so drop the declaration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-24 10:38:43 +01:00
Eric Anholt
bf4aecfb2a vc4: Drop maximum number of varyings down to 8.
There are only 32 bits in the flatshade flags (which are 1 bit per
component), the simulator crashes when you use more than about this many
varyings, and the original Broadcom code drop only exposed 8 as well.

Fixes 26 piglit tests in the varying-packing group, and makes many others
go from crash to fail (due to not checking their varying counts and
treating link failures as failures).  Regresses ARB_fp/minmax (due to 8
varyings instead of 10).
2014-09-24 00:25:07 -07:00
Eric Anholt
45b104e0a2 vc4: Add support for flat shading.
This is just the GL 1.1 flat shading of colors -- we don't need to support
TGSI constant interpolation bits, because we don't do GLSL 1.30.

Fixes 7 piglit tests.
2014-09-23 17:23:29 -07:00
Eric Anholt
0e7bc3088b vc4: Drop stale comment.
This should have been in 001247d230.
2014-09-23 17:23:29 -07:00
Brian Paul
e8ea783d79 util: fix SCons build
after register_allocate.c was moved to util/ directory.
2014-09-23 16:33:17 -06:00
Eric Anholt
9dbfca10a3 vc4: Put dead writes into the NOP register when generating code.
They still provide register pressure since I haven't made a special class
for them, but since they're only live for one instruction it probably
doesn't matter.

This improves the readability of QPU assembly.
2014-09-23 13:51:42 -07:00
Eric Anholt
d2b58240b4 vc4: When possible, resolve raddr conflicts by swapping files on specials.
Cleans up a bunch of ugliness in perspective interpolation.
2014-09-23 13:51:41 -07:00
Eric Anholt
3e5325e8c9 vc4: Fix overzealous raddr conflict resolution.
We only need to do the fixup when both args are in the same file, not just
when both are in physical registers.
2014-09-23 13:51:29 -07:00
Eric Anholt
2e48b286bf vc4: Add support for 8-bit unorm/snorm vertex inputs. 2014-09-23 13:40:10 -07:00
Eric Anholt
b7edf30191 vc4: Add disasm for A-file unpack operations.
The A-file unpack is just like R4 unpack, except that if you don't do a
floating-point operation it won't do float conversion (so int16 gets
scaled up to int32).
2014-09-23 13:40:10 -07:00
Eric Anholt
71e5ba9c01 vc4: Switch to using Mesa's register allocator.
This will let me more reliably allocate a-file registers, which are going
to be even more in demand when I start using a-file unpacks.

Also fixes a bug where the reservation of payload registers (FRAG_Z/W) was
off by one but just caused failure to register allocate at all if the
off-by-one was fixed.
2014-09-23 13:40:10 -07:00
Eric Anholt
0148690ac7 vc4: Make a static list of all the registers. 2014-09-23 13:40:10 -07:00
Eric Anholt
e157837282 vc4: Switch the context struct to use ralloc.
I wanted to hang the ra_regs off it so I didn't have to free, but it
turned out it wasn't ralloced yet.
2014-09-23 13:40:10 -07:00
Eric Anholt
517e01b5c3 mesa: Move register_allocate.c to util.
The r300 gallium driver is using it outside of the Mesa tree, and I wanted
to do so for vc4 as well.  Rather than make the multiple-definitions
problem even more complicated, just move it to more-shared code.

v2: Don't forget to delete the symlink in r300 (review by Matt).
    Delete more r300-helper references (review by Emil)
    Don't prefix util/ header inclusion with "util/" (review by Emil)

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v1)
2014-09-23 13:40:10 -07:00
Roland Scheidegger
5e1fcc6258 gallivm: fix idiv
ffeb77c7b0 had a typo which turned all signed
integer divisions into unsigned ones. Oops.
This gets us back the 51 little piglits
(all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar).

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-23 21:46:00 +02:00
Juha-Pekka Heikkila
4ed23fd590 egl: extra null checks for get_xcb_screen() return values
verify get_xcb_screen() returned pointer before using it.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
b9463813ee meta: Fix error paths in meta_copy_image.c
If _mesa_get_tex_image() return NULL there is already error
set in context. Other error pats free allocated texture.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
e13a8dc37d meta: Avoid null access on setup_glsl_msaa_blit_shader()
On default fallback path there was null access on src_rb

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
ba089cfa82 i965: Add extra null check in intel_bufferobj_alloc()
Check calloc returned requested memory.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
51aa221480 mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
a3d6146e3a glsl: Check realloc return value in ir_function::matching_signature()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
261120daef loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
d2f0442bf6 glsl: Check calloc return value in link_intrastage_shaders()
Check calloc return value while adding build-in functions.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
808b8e59c0 i965: Avoid null access in intelMakeCurrent()
separate two null checks connected with && to their own if branches.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
36f8042e8c mesa: add null checks in symbol_table.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
6e56eaf7b7 glsl: add missing null check in tfeedback_decl::init()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
a82b29d526 i965: in set_read_rb_tex_image() check _mesa_meta_bind_rb_as_tex_image() did succeed
Check if _mesa_meta_bind_rb_as_tex_image() did give the texture.
If no texture was given there is already either
GL_INVALID_VALUE or GL_OUT_OF_MEMORY error set in context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-23 10:25:02 +03:00
Juha-Pekka Heikkila
5a6ec26aec glsl: Fix memory leak in glsl_lexer.ll
Running fast clear glClear with SNB caused Valgrind to
complain about this.

v2: line 237 fixed glClear from leaking memory, other
strdups are also now changed to ralloc_strdups but I
don't know what effect those have. At least no changes in
my Piglit quick run.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-23 10:25:02 +03:00
Chia-I Wu
6c9d67118a ilo: rework pipeline workarounds
Add current_pipe_control_dw1 and deferred_pipe_control_dw1 to track what have
been done since lsat 3DPRIMITIVE and what need to be done before next
3DPRIMITIVE.  Based on them, we can emit WAs more smartly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-23 10:08:05 +08:00
Chia-I Wu
34e807817f ilo: remove handle_invalid_batch_bo()
It was used to set has_gen6_wa_pipe_control to false when the batch buffer
changed.  When called from emit_flush() and others, it also unset
ILO_3D_PIPELINE_INVALIDATE_BATCH_BO so that the following emit_draw() will not
set has_gen6_wa_pipe_control to false again.  It sounded error-prone and was
just ugly.

We should be able to achieve the same goal by reset has_gen6_wa_pipe_control
in ilo_3d_pipeline_invalidate().  With handle_invalid_batch_bo() gone, the
emit functions can also be inlined.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-23 10:08:05 +08:00
Chia-I Wu
2c1f978d6c ilo: make gen6_pipeline_update_max_svbi() static
We do not need to call it from GEN7 pipeline anymore since software
PIPE_QUERY_PRIMITIVES_EMITTED is gone.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-23 10:08:05 +08:00
Ilia Mirkin
f6ff4cd517 freedreno/ir3: add TXB2 support
Handles texture(samplerCubeShadow, bias), part of GLES3 and GL3

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-22 22:06:34 -04:00
Ilia Mirkin
9b7961f9a3 freedreno/ir3: add TXQ support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-22 22:06:34 -04:00
Ilia Mirkin
9a3dcf21d7 freedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument
Previously we would get a potentially computed post-swizzle coord based
on the texture target info, which would not include the bias/lod in the
last argument.

The second argument does not have to be adjacent, so adjusting the order
array did not make sense.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-22 22:06:34 -04:00
Ilia Mirkin
53678f5e6b freedreno/ir3: make texture instruction construction more dynamic
This will make life a lot easier as we add support for additional
instructions.

v2: shadow reference value is always .z or .w

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-22 22:06:34 -04:00
Andreas Pokorny
df341320c9 i915: Fix black buffers when importing prime fds
Width and Height of the imported image was never initialized from the
imported bo.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2014-09-23 00:26:17 +01:00
Andreas Pokorny
53b614bfd3 egl/drm: expose KHR_image_pixmap extension
This changes enables EGL_KHR_image_pixmap in the egl drm platform, which is implemented
there but has not been advertised yet.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2014-09-23 00:25:45 +01:00
Brian Paul
6addb7f42b gallium: update comment for enum pipe_format
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-22 16:59:48 -06:00
Brian Paul
e7a614c60c gallium: replace pipe_type enum with tgsi_return_type enum
The only place the enum pipe_type was used is for the TGSI sampler
view return type.  So make it a TGSI type.  Note: it appears this
part of TGSI isn't used by anyone so it may be removed in the future.

v2: the new name is tgsi_return_type, not tgsi_type.  This means we
can drop the previously posted tgsi_type -> tgsi_opcode_type patch.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
9ce72ac1fa draw: use new tgsi_transform inst/decl helpers in pstipple code
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
493ab77551 draw: use new tgsi_transform inst/decl helpers in aapoint code
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
d7e5b7138a draw: use new tgsi_transform inst/decl helpers in aaline code
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
e9d076e6d0 tgsi: add inst/decl helpers for tgsi_transform utility
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
16ff2fdd70 draw: use tgsi transform prolog callback in polygon stipple code
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
6581aa441e draw: use tgsi transform prolog/epilog callbacks in AA line code
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
d77c0a2b52 draw: use tgsi transform prolog/epilog callbacks in AA point code
This simplifies the code and makes it a little easier to understand.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:24 -06:00
Brian Paul
9e0160fc58 tgsi: fix tgsi transform's epilog callback
We want to call the caller's epilog callback when we find the TGSI
END instruction, not after it.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:23 -06:00
Brian Paul
b16bb3f50f tgsi: add prolog() method to tgsi_transform_context
Called when the user can insert new decls, instructions.
This could be used in a few places in the 'draw' module.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-22 16:56:23 -06:00
Brian Paul
2826212dc7 glsl: use ptrdiff_t cast to silence g++ sign warning
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-22 16:56:23 -06:00
Jordan Justen
19b08e1bb3 i965/fs: Remove direct fs_visitor brw_wm_prog_key dependence
Instead we store a void pointer to the key, and cast it to
brw_wm_prog_key for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-22 11:11:33 -07:00
Jordan Justen
e9be6a7833 i965/fs: Use brw_sampler_prog_key_data instead of brw_wm_prog_key::tex
This helps:
1. Reduce the need to have fs_visitor::key's type be brw_wm_prog_key*
2. Align the code to allow brw_sampler_prog_key_data to be pulled out of other
   prog_key types for different stages.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-22 11:11:33 -07:00
Jordan Justen
49e5f76a65 i965/fs: Remove direct fs_visitor brw_wm_prog_data dependence
Instead we store a brw_stage_prog_data pointer, and cast it to
brw_wm_prog_data for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-22 11:11:33 -07:00
Tom Stellard
c6d9801409 clover: Add support to mem objects for multiple destructor callbacks v2
The spec says that mem objects should maintain a stack of callbacks
not just one.

v2:
  - Remove stray printf.

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

CC: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-22 12:32:34 -04:00
Brian Paul
cc71457b48 st/xa: silence unused variable warning
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-22 08:04:34 -06:00
Brian Paul
0100d45b7e target-helpers: add inline qualifier on configuration_query()
To silence unused function warnings.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-22 08:04:34 -06:00
Chia-I Wu
a68f421d73 ilo: clean up fallback path for primitive restart
We should be able to draw with the index buffer mapped.  That simplifies
things a lot.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-22 14:22:37 +08:00
Chia-I Wu
d69faf851f ilo: handle conditional rendering in the context
Conditional rendering is not limited to draw_vbo().  Move the support to
ilo_context, and replace ilo_3d_pass_render_condition() by
ilo_skip_rendering().
2014-09-22 12:51:42 +08:00
Chia-I Wu
295a3a3ff0 ilo: create the pipeline from the builder
The pipeline needs just the builder to build commands.  It does not need CP.
2014-09-22 11:47:33 +08:00
Chia-I Wu
61c6a294dd ilo: move aperture checks out of pipeline
They can be done outside of the pipeline.  Move them and let the pipeline
focus on building commands.
2014-09-22 11:45:38 +08:00
Chia-I Wu
672592de7e ilo: flush before setting SOL_RESET
SOL_RESET happens before bo execution.  It should not be observed by the
commands that are already in the bo.

Move the code out of the pipeline now that it submits.
2014-09-22 10:41:13 +08:00
Chia-I Wu
17e7582465 ilo: move size estimation check out of pipeline
It can be done outside of the pipeline.  Let's move it.
2014-09-22 10:36:27 +08:00
Rob Clark
49b8fb937f freedreno/a3xx: more texture array fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-21 15:36:26 -04:00
Rob Clark
18291ee17a freedreno: add DRM_CONF_SHARE_FD
And config query and DRM_CONF_SHARE_FD to both mega-driver and
traditional build configs, so that EGL_EXT_image_dma_buf_import
works.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-21 15:35:53 -04:00
Chia-I Wu
41f072a4f8 ilo: use a single list for queries
We used different lists for different types of queries because we wanted to
update software queries quickly.  Now that there is no software queries, we
are fine with a single list.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:36:00 +08:00
Chia-I Wu
6b79d894d7 ilo: replace software queries by hardware ones
Read PIPE_QUERY_PRIMITIVES_GENERATED and PIPE_QUERY_PRIMITIVES_EMITTED from
hardware registers.  Because all queries now have a bo, remove unnecessary
checks for q->bo.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:31:41 +08:00
Chia-I Wu
154972700d ilo: support prim queries in ilo_3d_pipeline_emit_query()
Add support for PIPE_QUERY_PRIMITIVES_GENERATED and
PIPE_QUERY_PRIMITIVES_EMITTED in ilo_3d_pipeline_emit_query().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:31:31 +08:00
Chia-I Wu
900d8136e1 ilo: add ilo_3d_pipeline_emit_query()
It replaces

  ilo_3d_pipeline_emit_write_timestamp(),
  ilo_3d_pipeline_emit_write_depth_count(), and
  ilo_3d_pipeline_emit_write_statistics().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:31:20 +08:00
Chia-I Wu
9c873816a8 ilo: rework query support
This fixes some corner cases, but more importantly, the new code should be
easier to reason about.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:31:10 +08:00
Chia-I Wu
26fefae9a7 ilo: clarify cp owning/releasing
Make it own()'s responsibility to make room for release() and itself.  To be
able to do that, allow ilo_cp_submit() in own().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-21 23:30:51 +08:00
Chia-I Wu
4eb2bbefd2 ilo: add a pointer to builder in ilo_3d_pipeline
It saves quite some typings.
2014-09-20 11:45:31 +08:00
Chia-I Wu
8b4726d32e ilo: add a helper for RECTLIST blitter
Add ilo_3d_draw_rectlist() for use by RECTLIST blitter.
2014-09-20 11:29:40 +08:00
Chia-I Wu
bca549691e ilo: no direct ilo_context access in BLT blitter
We need ilo_builder for command building and ilo_cp for size check.
ilo_context is not used.
2014-09-20 11:06:08 +08:00
Chia-I Wu
c1165c8ea0 ilo: fix headers in Makefile.sources 2014-09-20 11:01:35 +08:00
Chia-I Wu
6c0de4b979 ilo: add a new struct for context states
Move pipe states in ilo_context to the new ilo_state_vector.  The motivation
is that ilo_context consists of several loosely related things.  When we need
an ilo_context somewhere, we usually need only one or two of the things in it.
This change makes ilo_state_vector one such thing.

An immediate result is that we no longer need ilo_context in 3D pipelines,
something we have planned for since early days.
2014-09-20 10:13:53 +08:00
Chia-I Wu
284d767be0 ilo: merge ilo_gpe.h to ilo_state*.h
Move the #define's and struct's to ilo_state.h.  Move the inline functions and
function declarations to ilo_state_gen.h.
2014-09-20 10:13:53 +08:00
Chia-I Wu
4a8a6ce154 ilo: rename ilo_gpe_gen*.[ch]
Rename them to ilo_state_gen*.[ch].
2014-09-20 10:13:53 +08:00
Chia-I Wu
3cb383c1c9 ilo: make ilo_fence opaque
It is manipulated only in ilo_screen.c.
2014-09-20 10:13:53 +08:00
Chris Forbes
c4ed6c730f i965/gen6: Enable GL 3.3 and GLSL 3.30
Tested on my snb-gt2:

4 tests skip->pass in spec/EXT_texture_array
51 tests skip->pass in spec.glsl-3.30
4 tests skip->pass in spec/!OpenGL 3.3
No regressions; no skip->fail changes.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-20 13:59:36 +12:00
Roland Scheidegger
7ede5a1a7b gallivm: add information about different sampler/view units if analyzing shader
Useful to know in some cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-20 02:19:02 +02:00
Emil Velikov
4824eecc0c docs: Add 10.3 sha256 sums, news item and link release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 18571edea8)

Conflicts:
	docs/index.html
	docs/relnotes.html
2014-09-19 20:18:43 +01:00
Emil Velikov
991242ece1 docs: Update 10.3 release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1b12af300d)
2014-09-19 20:16:37 +01:00
Emil Velikov
878e8a89f4 docs: Add sha256 sums for the 10.2.8 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit f95fcb1716)
2014-09-19 20:16:25 +01:00
Emil Velikov
4e8d1c7899 Add release notes for the 10.2.8 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1e2b4120f7)
2014-09-19 20:16:14 +01:00
Marek Olšák
8449121971 st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables
Some users don't understand that these variables can break OpenGL.
The general is rule is that if an app supports MSAA, you mustn't use
GALLIUM_MSAA.

For example, if an app has an 8xMSAA FBO and GALLIUM_MSAA=4
is set, resolving the FBO to the back buffer will be rejected which will look
like this on all gallium drivers:

http://www.phoronix.com/scan.php?page=article&item=amd_radeonsi_msaa

The environment variables also have no effect on modern apps like TF2, but
there is still a performance hit due to wasted bandwidth and VRAM.

In a nutshell, it does more harm than good.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-19 20:38:06 +02:00
Eric Anholt
001247d230 vc4: Fix perspective interpolation.
Fixes the mesa reflect demo and 6 tests under interpolation/
2014-09-19 11:25:02 -07:00
Eric Anholt
dcd03e7476 vc4: Use the same method as for FRAG_Z to handle fragcoord W.
I need to get the non-reciprocal version of W for interpolation, anyway.
2014-09-19 11:09:04 -07:00
Roland Scheidegger
f2c39dd0e1 util: don't try to emit half-float intrinsics if avx isn't available
These instructions only have vex encodings, thus they can't be used without
avx. (Technically, one can still use avx-128 if avx isn't available because
the environment doesn't store the ymm registers, however I don't think llvm
can.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-19 16:58:28 +02:00
Samuel Iglesias Gonsalvez
74d7ff2efd i965/gen6: enable GLSL 1.50, OpenGL 3.2 and GL_AMD_vertex_shader_layered
Geometry shaders was the only thing we needed to enable GLSL 1.50 and
OpenGL 3.2 in gen6.

v2: Layered clears do not work properly in gen6 with OpenGL 3.2. Kenneth
and Jordan realized that for this to work we also need
GL_AMD_vertex_shader_layered (which requires OpenGL 3.2, so it could not be
enabled before this patch), so we agreed to enable this together with
OpenGL 3.2 in this patch.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
d2c2ca9ee8 i965/gen6/gs: Use a specific implementation of geometry shaders for gen6.
In gen6 we will use the geometry shader implementation from gen6_gs_visitor.cpp
and keep the implementation in brw_vec4_gs_visitor.cpp for gen7+. Notice that
gen6_gs_visitor inherits from brw_vec4_gs_visitor so it is not a completely
seprate implementation of geometry shaders.

Also, gen6 does not support multiple dispatch modes, its default operation mode
is equivalent to gen7's SINGLE mode, so select that in gen6 for consistency.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
3a4aee34a2 i965/gen6/gs: upload ubo and pull constants surfaces.
Uniforms declared as uniform blocks are stored in ubo surfaces and need to
be pulled from the geometry shader program so make sure we upload them first
and do the same for pull constants.

This fixes all piglit tests that use uniform blocks:
bin/shader_runner tests/spec/glsl-1.50/uniform_buffer/gs-*

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
6947a8a593 i965/gen6/gs: Enable transform feedback support in geometry shaders
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
c66165ab2b i965/gen6/gs: Fix binding table clash between TF surfaces and textures.
For gen6 geometry shaders we use the first BRW_MAX_SOL_BINDINGS entries of the
binding table for transform feedback surfaces. However, vec4_visitor will
setup the binding table so that textures use the same space in the binding
table. This is done when calling assign_common_binding_table_offsets(0) as
part if its run() method.

To fix this clash we add a virtual method to the vec4_visitor hierarchy to
assign the binding table offsets, so that we can change this behavior
specifically for gen6 geometry shaders by mapping textures right after the
first BRW_MAX_SOL_BINDINGS entries.

Also, when there is no user-provided geometry shader, we only need to upload
the binding table if we have transform feedback, however, in the case of a
user-provided geometry shader, we can't only look into transform feedback
to make that decision.

This fixes multiple piglit tests for textureSize() and texelFetch() when these
functions are called from a geometry shader in gen6, like these:

bin/textureSize gs sampler2D -fbo -auto
bin/texelFetch gs usampler2D -fbo -auto

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
2614cde998 i965/gen6/gs: Avoid buffering transform feedback varyings twice.
Currently we buffer transform feedack varyings separately. This patch makes
it so that we reuse the values we have already buffered for all the output
varyings of the geometry shader instead.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
2120443484 i965/gen6/gs: Buffer PSIZ/flags vertex data in gen6_gs_visitor
Since geometry shaders can alter the value of varyings packed in the first
output VUE slot (PSIZ), we need to buffer it together with all the other
vertex data so we can emit the right value for each vertex when we do the
URB writes.

This fixes the following piglit test in gen6:
tests/spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs.shader_test

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
28a7da612b i965/gen6/gs: Setup SOL surfaces for user-provided geometry shaders
Update gen6_gs_binding_table and gen6_sol_surface to use user-provided
geometry program information when present. This is necessary to implement
transform feedback support.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
fda4470944 i965/gen6/gs: implement transform feedback support in gen6_gs_visitor
This takes care of generating code required to handle transform feedback.
Notice that transform feedback isn't enabled yet, since that requires
additional setups in other parts of the code that will come in later patches.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
1f77bfce7d i965/gen6/gs: Add an additional parameter to the FF_SYNC opcode.
We will use this parameter in later patches to provide information relevant
to transform feedback that needs to be set as part of the FF_SYNC message.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
3ea410972a i965/gen6/gs: implement GS_OPCODE_FF_SYNC_SET_PRIMITIVES opcode
This opcode will be used when filling FF_SYNC header before
emitting vertices and their data.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
5933a08bd9 i965/gen6/gs: implement GS_OPCODE_SVB_SET_DST_INDEX opcode
This opcode generates code to copy the specified destination index
into subregister 5 of the MRF message header.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Samuel Iglesias Gonsalvez
e86ae1b0a3 i965/gen6/gs: implement GS_OPCODE_SVB_WRITE opcode
This opcode will be used when sending SVB WRITE messages to save
transform feedback outputs into Streamed Vertex Buffers.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
66ec61c49f i965/gen6/gs: Enable texture units and upload sampler state.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:16 +02:00
Iago Toral Quiroga
6669fd0818 i965/gen6/gs: Assign geometry shader VUE map properly.
So far in gen6 we only used geometry shaders to implement transform feedback
in vertex shaders, so we assumed that the VUE map for the geometry shader
stage was always the same as for the vertex shader stage. This is no longer
true now that we support user provided geometry shaders in gen6 too.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
524ad6b901 i965/gen6/gs: Implement support for gl_PrimitiveIdIn.
For this we will need to move PrimitiveID information, delivered in the thread
payload in r0.1, to a separate register (we use GS_OPCODE_SET_PRIMITIVE_ID
for this), then map the corresponding varying slot to that register in the
setup_payload() method.

Notice that we cannot use a virtual register as the destination for the
PrimitiveID because we need to map all input attributes to hardware registers
in setup_payload(), which happens before virtual registers are mapped to
hardware registers. We could work around that issue if we were able to compute
the first non-payload register in emit_prolog() and move the PrimitiveID
information to that register, but we can't because at that point we still
don't know the final number uniforms that will be included in the payload.

So, what we do is to place PrimitiveID information in r1, which is always
delivered as part of the payload but its only populated with data
relevant for transform feedback when we set GEN6_GS_SVBI_PAYLOAD_ENABLE
in the 3DSTATE_GS state packet.

When we implement transform feedback, we wil make sure to move the value of r1
to another register before we overwrite it with the PrimitiveID.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
024b7c0f33 i965/gen6/gs: Implement GS_OPCODE_SET_PRIMITIVE_ID.
In gen6 the geometry shader payload includes the PrimitiveID information in
r0.1. When the shader code uses glPimitiveIdIn we will have to move this to
a separate hardware register where we can map this attribute. This opcode
takes the selected destination register and moves r0.1 there.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
c091804f4c i965/gen6/gs: Handle the case where a geometry shader emits no output.
In gen6 we need to end the thread differently depending on whether we have
emitted at least one vertex or not. In case we did, the EOT message must
always include the COMPLETE flag or else the GPU hangs. If we have not
produced any output, however, we can't use the COMPLETE flag.

This would lead us to end the program with an ENDIF opcode, which we want
to avoid (and actually is not permitted since it hits an assertion), so
instead what we do is that we always request a new VUE handle every time we do
an URB WRITE, even for the last vertex we emit. With this we make sure that
whether we have emitted at least one vertex or none at all we have to finish the
thread without writing to the URB, which works for both cases by setting the
COMPLETE and UNUSED flags in the EOT message.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
c1b8a5155b i965/gen6/gs: Make sure we complete the last primitive.
Just in case the GS algorithm does not call EndPrimitive() for the last
primitive produced. This is relevant only for non point outputs, since for
this we are already setting the PrimEnd flag on each vertex we emit.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
d93ca68666 i965/gen6/gs: Implement geometry shaders for outputs other than points.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
8411bf2c69 i965/gen6/gs: Add initial implementation for a gen6 geometry shader visitor.
Geometry shaders in gen6 are significantly different from gen7+ so it is better
to have them implemented in a different file rather than adding gen6 branching
paths all over brw_vec4_gs_visitor.cpp.

This commit adds an initial implementation that only handles point output, which
is the simplest case.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
5c30da1845 i965: Generalize emit_urb_slot() to emit to any dst_reg.
In gen7+ we emit vertices as they come, however in gen6 geometry shaders we
have to buffer vertex data for all vertices and then emit it all in one go
at the end. To achieve this we need to generalize emit_urb_slot() to store
vertex data in general purpose registers and not only MRF registers.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
9b32fd0f70 i965: Provide means to create registers of a given size.
Implemented by Ilia Mirkin <imirkin@alum.mit.edu>.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
f373b7ed82 i965/gen6/gs: Implement GS_OPCODE_SET_DWORD_2.
We had GS_OPCODE_SET_DWORD_2_IMMED but this required its source argument to be
an immediate. In gen6 we need to set dword 2 of the URB write message header
from values stored in separate register, so we need something more flexible.
This change replaces GS_OPCODE_SET_DWORD_2_IMMED with GS_OPCODE_SET_DWORD_2.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
7ccd47d644 i965/gen6/gs: Upload binding table for user-provided geometry shaders.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
5ac8294f9b i965/gen6/gs: Enable URB space for user-provided geometry shaders.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
c09ddf82ff i965/gen6/gs: Compute URB entry size for user-provided geometry shaders.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
621685ad4c i965/gen6/gs: Add instruction URB flags to geometry shaders EOT message.
Gen6 seems to require that EOT messages include the complete flag too or else
the GPU hangs. We add will this flag to the instruction when we emit the
thread end opcode.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
2c85132e51 i965/gen6/gs: Implement GS_OPCODE_URB_WRITE_ALLOCATE.
Gen6 geometry shaders need to allocate URB handles for each new vertex they
emit after the first (the URB handle for the first vertex is obtained via the
FF_SYNC message).

This opcode adds the URB allocation mechanism to regular URB writes.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
d0bdd4ce98 i965/gen6/gs: Implement GS_OPCODE_FF_SYNC.
This implements the FF_SYNC message required in gen6  geometry shaders to
get the initial URB handle.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-19 15:01:15 +02:00
Samuel Iglesias Gonsalvez
406e04113f i965/gs: Reuse gen6 constant push buffers setup code in gen7+.
The code required for gen6 and gen7+ is almost the same, so reuse it.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:15 +02:00
Iago Toral Quiroga
96012dfe80 i965/gen6/gs: Setup constant push buffers for gen6 geometry shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:15 +02:00
Samuel Iglesias Gonsalvez
cf06136b63 i965/gen6/gs: Set brw->gs.enabled to FALSE in gen6_blorp_emit_gs_disable()
See 7dfb4b2d00 for more details.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:14 +02:00
Samuel Iglesias Gonsalvez
bc383cb55b i965/gen6/gs: use brw_gs_prog atom instead of brw_ff_gs_prog
This is needed to support user-provided geometry shaders, since the
brw_ff_gs_prog atom in gen6 only takes care of implementing transform feedback
for vertex shaders.

If there is no user-provided geometry shader the implementation falls back to
the original code.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:14 +02:00
Samuel Iglesias Gonsalvez
dd376bdb25 i965/gen6/gs: Skeleton for user GS program support
Currently, gen6 only uses geometry shaders for transform feedback so the state
we emit is not suitable to accomodate general purpose, user-provided geometry
shaders. This patch paves the way to add these support and the needed
3DSTATE_GS packet modifications for it.

Previous code that emitted state to implement transform feedback in gen6 goes
to upload_gs_state_adhoc_tf().

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:14 +02:00
Iago Toral Quiroga
03164f6285 i965/gs: Use single dispatch mode as fallback to dual object mode when possible.
Currently, when a geometry shader can't use dual object mode we fall back to
dual instance mode, however, when invocations == 1, single dispatch mode is
more performant and equally efficient in terms of register pressure.

Single dispatch mode requires that the driver can handle interleaving of
input registers, but this is already supported (dual instance mode has
the same requirement). However, to take full advantage of single dispatch mode
to reduce register pressure we would also need the ability to store two
separate vec4 output values into vec8 registers, which would approximately
double our capacity to store temporary values, but currently the vec4 visitor
and generator classes do not support this, so at the moment register pressure
in single and dual instance modes is the same.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-19 15:01:14 +02:00
Chia-I Wu
45cbc9267e ilo: rename ILO_DEBUG=3d
It has been a bad name since we added the builder.  Rename it to
ILO_DEBUG=batch to match i965, and call ilo_builder_decode() from
ilo_cp_submit_internal().
2014-09-19 16:02:11 +08:00
Chia-I Wu
8a2352262e ilo: rename ilo_cp_flush()
"Flush" is used for too many things already: pipe resource flush, pipe context
flush, pipe transfer region flush, and hardware pipeline flush.  Rename it to
ilo_cp_submit().  As such, ILO_DEBUG=flush is renamed to ILO_DEBUG=submit.
2014-09-19 16:02:11 +08:00
Chia-I Wu
1887d15eed ilo: remove ilo_cp_empty()
Call ilo_builder_batch_used() directly.
2014-09-19 16:02:11 +08:00
Chia-I Wu
270667472f ilo: simplify ilo_cp_set_owner()
The simplification allows us to get rid of ilo_cp_set_ring() and
ilo_cp_implicit_flush().  The 3D query code is refactored for the
simplification.
2014-09-19 16:02:11 +08:00
Kenneth Graunke
26ee6f23a9 mesa: Delete VAO _MaxElement code and index buffer bounds checking.
Fredrik's implementation of ARB_vertex_attrib_binding introduced new
gl_vertex_attrib_array and gl_vertex_buffer_binding structures, and
converted Mesa's older gl_client_array to be derived state.  Ultimately,
we'd like to drop gl_client_array and use those structures directly.

One hitch is that gl_client_array::_MaxElement doesn't correspond to
either structure (unlike every other field), so we'd have to figure out
where to store it.  The _MaxElement computation uses values from both
structures, so it doesn't really belong in either place.  We could put
it in the VAO, but we'd have to pass it around everywhere.

It turns out that it's only used when ctx->Const.CheckArrayBounds is
set, which is only set by the (rarely used) classic swrast driver.
It appears that drivers/x11 used to set it as well, which was intended
to avoid segmentation faults on out-of-bounds memory access in the X
server (probably for indirect GLX clients).  However, ajax deleted that
code in 2010 (commit 1ccef926be).

The bounds checking apparently doesn't actually work, either.  Non-VBO
attributes arbitrarily set _MaxElement to 2 * 1000 * 1000 * 1000.
vbo_save_draw and vbo_exec_draw remark /* ??? */ when setting it, and
the i965 code contains a comment noting that _MaxElement is often bogus.

Given that the code is complex, rarely used, and dubiously functional,
it doesn't seem worth maintaining going forward.  This patch drops it.

This will probably mean the classic swrast driver may begin crashing on
out of bounds vertex buffer access in some cases, but I believe that is
allowed by OpenGL (and probably happened for non-VBO accesses anyway).
There do not appear to be any Piglit regressions, either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Roland Scheidegger <sroland@vmware.com>
2014-09-19 00:43:01 -07:00
Eric Anholt
19589147ef vc4: Add support for stencil operations.
While depth test state is passed through the fragment shader as sideband,
data, the stencil test state has to be set by the fragment shader itself.

Many tests are still failing, but this gets most of hiz/ passing.
2014-09-18 17:46:43 -07:00
Eric Anholt
6e39854e23 vc4: Actually implement VC4_DEBUG=cl. 2014-09-18 11:46:50 -07:00
Roland Scheidegger
019ca99bee draw: (trivial) remove duplicated lines 2014-09-18 16:13:24 +02:00
Brian Paul
7b2c703244 mesa: fix prog_optimize.c assertions triggered by SWZ opcode
The SWZ instruction can have swizzle terms >4 (SWIZZLE_ZERO, SWIZZLE_ONE).
These swizzle terms caused a few assertions to fail.
This started happening after the commit "mesa: Actually use the Mesa IR
optimizer for ARB programs." when replaying some apitrace files.

A new piglit test (tests/asmparsertest/shaders/ARBfp1.0/swz-08.txt)
exercises this.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-09-18 07:28:36 -06:00
Eric Anholt
71d4fc88d6 vc4: Allow copy propagation of uniforms.
Fixes 12 piglit tests (and 8 more crash -> fail) from reducing register
pressure.
2014-09-17 14:21:24 -07:00
Eric Anholt
79be2cc383 vc4: Make sure thread end doesn't have a uniform read.
Prevents regression when I start doing copy propagation on uniforms.
2014-09-17 14:21:24 -07:00
Eric Anholt
44b8eb743d vc4: Allow dead code elimination of instructions that read uniforms. 2014-09-17 14:21:24 -07:00
Eric Anholt
5e90ed79f6 vc4: Add support for reordering the uniform stream after optimization.
This allows for introducing dead code eliminating of uniforms, copy
propagation of uniforms, and instruction rescheduling between instructions
that both read uniforms.
2014-09-17 14:21:24 -07:00
Eric Anholt
b0256fb75f vc4: Initialize the various qreg arrays when allocating them.
This is particularly important for outputs, where we try to MOV the whole
vec4 to the VPM, even if only 1-3 components had been set up.  It might
also be important for temporaries, if the shader reads components before
writing them.
2014-09-17 14:21:24 -07:00
Eric Anholt
b44a7a3223 vc4: Fix stray disable of the CSE pass.
Somehow I slipped this in with the original commit of CSE.
2014-09-17 14:21:24 -07:00
rconde
ffeb77c7b0 gallivm,tgsi: fix idiv by zero crash
While the result of signed integer division by zero is undefined by glsl
(and doesn't exist with d3d10), we must not crash, so need to make sure we
don't get sigfpe much like udiv already does.
Unlike udiv where we return 0xffffffff (as required by d3d10) there is
no requirement right now to return anything specific so we use zero.
2014-09-17 18:31:54 +02:00
Roland Scheidegger
4d996877ca gallivm: add texture target information for sample opcodes to tgsi info
sample opcodes don't have valid texture target information (and I don't think
this should be changed), however it would be nice if we had that information
ready elsewhere, so stuff that information into the tgsi info when analyzing
a shader.

v2: Ilja Mirkin spotted some bugs wrt not handling msaa resources. So add them
and while there also add them to the tex opcode analysis this was cloned from
as well (plus get rid of some bug not detecting indirect textures there in some
cases too).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-17 18:31:54 +02:00
Richard Sandiford
2e49559c77 st/mesa: Fix handling of 8888 SNORM and SRGB formats for big-endian
MESA_FORMAT_x8y8z8w8 puts the x channel in the least significant part of
the containing 32-bit integer, which is equivalent to PIPE_FORMAT_xyzw8888.
PIPE_FORMAT_x8y8z8w8 puts the x channel first in memory.

This patch fixes up the mesa<->gallium mapping accordingly.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:20:08 +10:00
Richard Sandiford
ccdbcd9586 st/mesa: Fix handling of LA and RG formats for big-endian
MESA_FORMAT_LnAn puts the luminance in the least significant part of
the containing integer, which is equivalent to PIPE_FORMAT_LAnn.
PIPE_FORMAT_LnAn puts the luminance first in memory.

This patch fixes up the mesa<->gallium mapping accordingly.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:20:08 +10:00
Richard Sandiford
be6ef203aa mesa: Add MESA_FORMAT_{A8R8G8B8, X8R8G8B8, X8B8G8R8}_SRGB (v2)
This means that each 8888 SRGB format has a reversed counterpart,
which is necessary for handling big-endian mesa<->gallium mappings.

v2: fix missing i965 additions. (Jason)
fix 127->255 max alpha for SRGB formats. (Jason)

v1: Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:19:45 +10:00
Richard Sandiford
df14091c58 mesa: Add MESA_FORMAT_A8L8_{SNORM,SRGB}
The associated UNORM format already existed.

This means that each LnAn format has a reversed counterpart,
which is necessary for handling big-endian mesa<->gallium mappings.

[airlied: rebased onto current master]

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:17:47 +10:00
Richard Sandiford
234d194b49 gallium: Define PIPE_FORMAT_xyzw8888_{SNORM, SRGB} aliases
...i.e. formats in which the first listed component is in the least
significant byte of the integer.  The corresponding UNORM aliases already exist.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:17:46 +10:00
Richard Sandiford
f9d8574b5e gallium: Add PIPE_FORMAT_x8B8G8R8_SNORM formats
This means that each RnGnBnxn format has a reversed counterpart,
which is necessary for handling big-endian mesa<->gallium mappings.
The associated UNORM and SRGB formats already exist.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:17:46 +10:00
Richard Sandiford
9b4c13995c gallium: Define PIPE_FORMAT_{LA, AL, RG, GR}nn aliases
...i.e. formats in which the first listed component is in the least
significant half of the integer.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:17:46 +10:00
Richard Sandiford
f14b40ab32 gallium: Add PIPE_FORMAT_AnLn and PIPE_FORMAT_GnRn formats
...i.e. formats in which the alpha or green channel is first in memory.

This means that each LnAn and RnGn format has a reversed counterpart,
which is necessary for handling big-endian mesa<->gallium mappings.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:17:46 +10:00
Dave Airlie
9ea045e85e mesa: fix SRGB alpha channel value in pack_float_R8G8B8X8_SRGB
Jason pointed out the bug on review adding new formats,
but the existing format also appears to have the bug, so
use 255 as the max, these are SRGB no SNORM.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 13:28:18 +10:00
Richard Sandiford
ecc48f83c8 swrast: Fix handling of MESA_FORMAT_L8A8_SRGB for big-endian
Luminance is the least-significant byte of the uint16, rather than the
lowest byte in memory.  Other parts of mesa already handle this correctly
for big-endian, and swrast already handles other MESA_FORMAT_x8y8 formats
correctly.  This case was just an odd-one-out.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 12:07:13 +10:00
Richard Sandiford
3e3b1db5f7 mesa: Tweak unpack name for MESA_FORMAT_R8G8B8X8_SNORM
MESA_FORMAT_R8G8B8X8_SNORM used a function called unpack_X8B8G8R8_SNORM
while MESA_FORMAT_R8G8B8X8_SRGB used a function called unpack_R8G8B8X8_SRGB.
This patch renames the SNORM function to have the same order as the
MESA_FORMAT name, like the SRGB function does.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 12:05:08 +10:00
Richard Sandiford
3ff5c6a6c4 mesa: Fix alpha component in unpack_R8G8B8X8_SRGB.
The function was using the "X" component as the alpha channel,
rather than setting alpha to 1.0.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 11:56:23 +10:00
Dave Airlie
ebcb2ee989 util: move shared rgtc code to util (v2)
This was being shared using a ../../ get out of gallium into
mesa, and I swore when I did it I'd fix things when we got a util
dir, we did, so I have.

v2: move RGTC_DEBUG define

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-17 11:27:25 +10:00
Eric Anholt
2b6711cc5f vc4: Claim ARB_fbo.
This gets a ton of piglit working that crashes in waffle context
management stuff otherwise.  Actually supporting mismatched FB sizes is at
best going to require some more load/store generals for color buffers, but
if I can't manage to do that I'll want to just have state_tracker reject
those FBOs as unsupported, rather than deny GL 2.1.
2014-09-16 15:14:52 -07:00
Eric Anholt
3c6d85e725 vc4: Fix memory leaks in register allocation. 2014-09-16 15:14:52 -07:00
Eric Anholt
ad02ba42f0 vc4: Move register allocation to a separate file.
I'm going to be rewriting it all, and having it mixed up with the
QIR-to-QPU opcode translation was messy.
2014-09-16 15:14:52 -07:00
Chris Forbes
b84c02f9cd glsl: fix error message for redeclaring gl_PerVertex as output
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-17 08:33:16 +12:00
Chris Forbes
667f758788 i965/vec4: slightly improve insn dumping with no srcs
Previously, we would get a trailing ', ' which looked strange.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-17 08:32:46 +12:00
Eric Anholt
2264925f85 vc4: Add support for computed depth writes.
Fixes piglit glsl-1.10-fragdepth and early-z.
2014-09-16 13:03:41 -07:00
Eric Anholt
aae4223fbd vc4: Restructure depth input/output in fragment shaders.
The goal here is to have an argument for the depth write opcode so that I
can do computed depth.  In the process, this makes the calculations that
will be emitted more obvious in the QIR.
2014-09-16 13:03:32 -07:00
Ilia Mirkin
a420aa1b41 freedreno: add a standalone ir3_compiler binary for building TGSI
Compiler taken from the combo old/new compiler comparer + simulator.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-16 12:13:22 -04:00
Ilia Mirkin
5b1d316c51 freedreno: add default .dir-locals.el for emacs settings
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-16 12:13:22 -04:00
Gwenole Beauchesne
e1c50abf8a i965: add support for RGBA dma_buf imports.
This allows for importing foreign buffers in RGB32 native endian
byte order, i.e. DRM_FORMAT_XBGR8888, and DRM_FORMAT_ABGR8888.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-16 01:11:06 -07:00
Kenneth Graunke
78bd126194 i965: Mark delta_x/y as BAD_FILE if remapped away completely.
Commit afe3d1556f (i965: Stop doing
remapping of "special" regs.) stopped remapping delta_x/delta_y, and
additionally stopped considering them always-live.  We later realized
delta_x was used in register allocaiton, so we actually needed to remap
it, which was fixed in commit 23d782067a
(i965/fs: Keep track of the register that hold delta_x/delta_y.).

However, that commit didn't restore the "always consider it live" part.
If all the code using delta_x was eliminated, fs_visitor::delta_x would
be left pointing at its old register number.  Later code in register
allocation would handle that register number specially...even though it
wasn't actually delta_x.

To combat this, set delta_x/y to BAD_FILE if they're eliminated, and
check for that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83127
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-16 00:46:46 -07:00
Dave Airlie
7f6872d012 st_glsl_to_tgsi: init have_sqrt field.
Coverity reported this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-16 15:13:05 +10:00
Dave Airlie
8de5522d93 llvmpipe: fix rast debugging output
The triangle_32_ rast functions never made it into the debug output,
confused me for a few seconds.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-16 15:12:54 +10:00
Richard Sandiford
f93b6d8cc5 util: Add big-endian layout for a number of formats.
This patch builds on 6c8f547f66 and
previous patches by allowing u_format.csv to specify separate big-endian
and little-endian layouts.  It then uses this to specify the correct layouts
for various depth/stencil formats.  Later patches handle other formats.

To recap, the idea is that u_format.csv lists the channels for an N-byte
value as though it were an N-byte integer.  For little-endian targets
the channels are listed starting at the least-significant bit of the
integer while for big-endian targets the channels are listed starting
at the most-significant bit.  This means that for something like
PIPE_FORMAT_B8G8R8A8_UNORM (blue in first byte of memory, alpha in last
byte of memory) the orders are the same for both endiannesses.  But for
something like PIPE_FORMAT_S8_UINT_Z24_UNORM, where the stencil is in
the least significant byte of a 32-bit integer, there need to be separate
channel definitions for each endianness.

The effect of this patch is to make the affected PIPE_FORMAT_*s have
the same layout as the associated MESA_FORMAT_*s for big-endian.
The MESA_FORMAT_*s are already handled correctly.

Fixes various piglit tests on z.  No regressions on x86_64.

[airlied: squash subsequent patches]
util: Add big-endian layout for 5551 and 565 formats
util: Add big-endian layout for 10/10/10/2 formats
util: Add big-endian layout for 4444 formats
util: Add big-endian layout for 233 format
util: Add big-endian layout for 44 formats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-16 14:02:56 +10:00
Richard Sandiford
9cd4dced06 llvmpipe: Fix PIPE_FORMAT_Z32_FLOAT_S8X24_UINT handling for big-endian.
llvmpipe treats PIPE_FORMAT_Z32_FLOAT_S8X24_UINT as a bit of a special case,
handling it as two 32-bit pieces rather than a single 64-bit block:

   /* 64bit d/s format is special already extracted 32 bits */
   total_bits = format_desc->block.bits > 32 ? 32 : format_desc->block.bits;

The format_desc describes the whole 64-bit block, so the z shift
will be 32 for big-endian.  But since we're accessing the z channel
as a 32-bit value rather than a 64-bit value, we need to mask the shift
with 31.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-16 14:02:55 +10:00
Richard Sandiford
1a65629ccc gallivm: Fix uses of 2^24
Fallback cases in lp_bld_arit.c used 2^24 to mean "2 to the power 24",
but in C it's "2 xor 24", i.e. 26.  Fixed by using 1<< instead.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-16 14:02:55 +10:00
Richard Sandiford
0a7f9fe42b gallivm: Add SNORM clamping to lp_build_{add, sub}
...fixing the associated TODO.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2014-09-16 14:02:54 +10:00
Rafael Ávila de Espíndola
f6e71ff9eb gallivm: attach DataLayout to module too, not just pass manager.
It looks like it was possible to attach it to both for a long time, however
since llvm r217548 attaching it to just the pass manager is no longer
sufficient and causes bugs (see http://llvm.org/bugs/show_bug.cgi?id=20903).

Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-16 03:50:32 +02:00
Roland Scheidegger
145fef9636 gallivm: handle SAMPLE opcode in aos sampling
This is just a very limited version, in particular sampler and sampler view
index must be the same. It cannot handle any modifiers neither.
Works much the same as soa version otherwise, to figure out the target we
need to store the sampler view dcls.
While here, also handle (no-op) RET and get rid of a couple bogus deprecated
comments.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-16 03:50:31 +02:00
Roland Scheidegger
02595c55b0 tgsi: accept offsets for sample opcodes too in the text parser
sample opcodes are a little oddly represented in the opcode_info, since
they don't count as texture instructions - they don't have valid target
information, but they may have offsets (unlike "ordinary" texture
instructions, the texture token may be optional for them).
So just make sure with these opcodes the optional offsets are accepted.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-16 03:50:31 +02:00
Roland Scheidegger
3a9eb40ee1 tgsi: don't print texture target for sample opcodes
sample opcodes don't encode a texture target, it would thus always
print UNKNOWN, which is not helpful (and wouldn't parse when giving
back the shader text to tgsi).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-16 03:50:31 +02:00
Eric Anholt
84ca6bc113 vc4: Bump maximum ARB program temporaries to match Intel/AMD.
This query has always been useless, but we could potentially reject
well-formed, runnable programs if we expose a value that's too low.
2014-09-15 15:05:06 -07:00
Eric Anholt
33443f506f vc4: Bump maximum uniforms count to match other drivers.
We don't have any specific limits in the hardware, just like the other
GPUs, so match their behavior.  Fixes minmax_gles2 and several other
piglit tests relying on the specced uniform minmax values.
2014-09-15 15:04:38 -07:00
Eric Anholt
5638b87d4c vc4: Dynamically allocate the TGSI-to-qreg arrays.
Fixes buffer overflows in some piglit tests (which are still failing to
register allocate anyway).
2014-09-15 13:12:27 -07:00
Eric Anholt
2147dd9681 vc4: Fix memory leaks of struct qinst. 2014-09-15 13:12:27 -07:00
Eric Anholt
f78ee1b280 vc4: Fix memory leaks of some vc4_compile contents. 2014-09-15 13:12:27 -07:00
Eric Anholt
50292d76c5 vc4: Reuse the util header instead of defining our own ARRAY_SIZE.
Fixes redefinition warnings if you end up including this header before
util stuff.
2014-09-15 13:12:27 -07:00
Brian Paul
418da97905 mesa: move i, j var decls into SWIZZLE_CONVERT_LOOP() macro
Put macro code in do {} while loop and put semicolons on macro calls
so auto indentation works properly.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-15 09:52:44 -06:00
Brian Paul
cfeb394224 mesa: break up _mesa_swizzle_and_convert() to reduce compile time
This reduces gcc -O3 compile time to 1/4 of what it was on my system.
Reduces MSVC release build time too.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-09-15 09:52:44 -06:00
Kalyan Kondapally
dbc2d81d2b Generate a warning when not writing gl_Position with GLES.
With GLES we don't give any kind of warning in case we don't
write to gl_position. This patch makes changes so that we
generate a warning in case of GLES (VER < 300) and an error
in case of GL.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-15 08:14:33 +03:00
Tapani Pälli
9bd139e451 mesa: check that uniform exists in glUniform* functions
Remap table for uniforms may contain empty entries when using explicit
uniform locations. If no active/inactive variable exists with given
location, remap table contains NULL.

v2: move remap table bounds check before existence check (Ian Romanick)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Erik Faye-Lund <kusmabite@gmail.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83574
2014-09-15 07:33:12 +03:00
Chia-I Wu
ce50a61d36 ilo: clean up 3D/media functions
Mostly style changes to set dw[0] directly.
2014-09-15 10:25:35 +08:00
Chia-I Wu
c39377d3fc ilo: fix gen6_3DSTATE_MULTISAMPLE()
There was a typo introduced by 90f4b131fc.
2014-09-15 09:00:54 +08:00
Rob Clark
ca29c4c3b0 freedreno/a3xx: 3d/array textures
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-13 15:31:58 -04:00
Rob Clark
eea1cdf687 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-13 15:31:58 -04:00
Chia-I Wu
a32f48361a ilo: trust vertex element count more
We might run into ve->count == 0 and last_velement_edgeflag == true in
gen6_3DSTATE_VERTEX_ELEMENTS() when the state tracker sets an invalid
combination of VS and VE (does not seem to happen with st/mesa).  Do not
assume ve->count is positive when last_velement_edgeflag is true.

Reported by Coverity.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-14 00:30:33 +08:00
Chia-I Wu
8fcf1b1f90 ilo: simplify src operand gathering in disassembler
Always initialize the operand array to point to src0, src1, and src2.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-14 00:30:33 +08:00
Chia-I Wu
5341001b94 ilo: derive 3-src instructions from the opcode table
One less switch statement to maintain.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2014-09-14 00:30:33 +08:00
Ilia Mirkin
1d7b0d832c nouveau: check for mesa context init failure
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-13 11:29:23 -04:00
Ilia Mirkin
2e86432cc1 nouveau: avoid leaking screen on initialization fail
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-13 11:17:26 -04:00
Ilia Mirkin
b13a4ca3f7 nouveau: change internal variables to avoid conflicts with macro args
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-13 10:55:16 -04:00
Chia-I Wu
9133784a46 ilo: clean up 3DPRIMITIVE functions
Add ILO_PRIM_RECTANGLES to replace the rectlist bool.
2014-09-13 09:33:20 +08:00
Chia-I Wu
eca98153e9 ilo: clean up 3D/media common functions
Rename ilo_builder_batch_state_base_address() to gen6_state_base_address() for
consistency and remove unused gen6_STATE_BASE_ADDRESS().  Reorder the code in
gen6_PIPE_CONTROL() a bit.  Finally, some mostly cosmetic changes.
2014-09-13 09:31:08 +08:00
Chia-I Wu
ea8e7a8d4a ilo: move 3D functions to ilo_builder_3d*.h
Move functions for the 3D pipeline to the new headers.  We artificially split
the functions into top (vertex processing) and bottom (pixel processing), to
keep the headers at reasonable sizes.
2014-09-13 09:31:08 +08:00
Chia-I Wu
aec8521166 ilo: move media functions to ilo_builder_media.h
Move functions for the media pipeline to the new header.
2014-09-13 08:32:25 +08:00
Chia-I Wu
45023db7a9 ilo: move GPE common functions to ilo_builder_render.h
Move 3D/media common functions to the new header.
2014-09-13 08:30:32 +08:00
Kenneth Graunke
84a40ce86b glsl: Speed up constant folding for swizzles.
ir_rvalue::constant_expression_value() recursively walks down an IR
tree, attempting to reduce it to a single constant value.  This is
useful when you want to know whether a variable has a constant
expression value at all, and if so, what it is.

The constant folding optimization pass attempts to replace rvalues with
their constant expression value from the bottom up.  That way, we can
optimize subexpressions, and ideally stop as soon as we find a
non-constant subexpression.

In order to obtain the actual value of an expression, the optimization
pass calls constant_expression_value().  But it should only do so if it
knows the value can be combined into a constant.  Otherwise, at each
step of walking back up the tree, it will walk down the tree again, only
to discover what it already knew: it isn't constant.

We properly avoided this call for ir_expression nodes, but not for
ir_swizzle nodes.  This patch fixes that, drastically reducing compile
times on certain shaders where tree grafting has given us huge
expression trees.  It also fixes SuperTuxKart.

Thanks to Iago and Mike for help in tracking this down.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78468
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>
Cc: mesa-stable@lists.freedesktop.org
2014-09-12 16:35:39 -07:00
Kenneth Graunke
7865026c04 i965/vec4: Make type_size() return 0 for samplers.
The FS backend has always used 0, and the VS backend has always used 1.
I think 1 is just working around other problems, and is incorrect.
Samplers are baked in; nothing uses the UNIFORM register we would
create, and we shouldn't upload any constant values for them.

Fixes ES3-CTS.shaders.struct.uniform.sampler_array_vertex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-12 16:35:39 -07:00
Kenneth Graunke
2408f166db i965: Skip allocating UNIFORM file storage for uniforms of size 0.
Samplers take up zero slots and therefore don't exist in the params
array, nor are they included in stage_prog_data->nr_params.  There's no
need to store their size in param_size, as it's only used for dealing
with arrays of "real" uniforms (ones uploaded as shader constants).

We run into all kinds of problems trying to refer to the uniform storage
for variables that don't have uniform storage.  For one, we may use some
other variable's index, or access out of bounds in arrays.  In the FS
backend, our extra 2 * MaxSamplerImageUnits params for texture rectangle
rescaling paper over a lot of problems.  In the VS backend, we claim
samplers take up a slot, which also papers over problems.

Instead, just skip allocating storage for variables that don't have any.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-12 16:35:39 -07:00
Kenneth Graunke
6b6145204d i965: Separate gl_InstanceID and gl_VertexID uploading.
We always uploaded them together, mostly out of laziness - both required
an additional vertex element.  However, gl_VertexID now also requires an
additional vertex buffer for storing gl_BaseVertex; for non-indirect
draws this also means uploading (a small amount of) data.  This is extra
overhead we don't need if the shader only uses gl_InstanceID.

In particular, our clear shaders currently use gl_InstanceID for doing
layered clears, but don't need gl_VertexID.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-12 16:35:35 -07:00
Kenneth Graunke
e980fe6071 i965: Fix reference counting in new basevertex upload code.
In the non-indirect draw case, we call intel_upload_data to upload
gl_BaseVertex.  It makes brw->draw.draw_params_bo point to the upload
buffer, and increments the upload BO reference count.

So, we need to unreference it when making brw->draw.draw_params_bo point
at something else, or else we'll retain a reference to stale upload
buffers and hold on to them forever.

This also means that the indirect case should increment the reference
count on the indirect draw buffer when making brw->draw.draw_params_bo
point at it.  That way, both paths increment the reference count, so
we can safely unreference it every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-12 16:23:02 -07:00
Rob Clark
9b6281a7da freedreno: "fix" problems with excessive flushes
4f338c9b introduced logic to trigger a flush rather than overflowing
cmdstream buffer.  But the threshold was too low, triggering flushes
where they were not needed.  This caused problems with games like
xonotic.

Part of the problem is that we need to mark all state dirty between
cmdstream submit ioctls, because we cannot rely on state being
preserved across ioctls.  But even with that, there are still some
problems that are still being debugged.  For now:

1) correctly mark all state dirty
2) introduce FD_MESA_DEBUG flush flag to force rendering to be flushed
between each draw, to trigger problems (so that I can debug)
3) use a more reasonable threshold so for normal usecases we don't
trigger the problems

This at least corrects the regression, but there is still more debugging
to do.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 18:35:39 -04:00
Marek Olšák
d13d2fd161 r600g,radeonsi: add debug option which forces DMA for copy_region and blit 2014-09-12 22:51:28 +02:00
Ilia Mirkin
d7ec3db349 freedreno/ir3: implement UMUL correctly
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:21 -04:00
Ilia Mirkin
436dd1e2f8 freedreno/ir3: fix UCMP handling
UCMP does not require a compare, only a select.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:15 -04:00
Ilia Mirkin
9f5bd154d7 freedreno/ir3: add TXL support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:11 -04:00
Rob Clark
459f8f3d66 freedreno/ir3: add missing put_dst
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:09 -04:00
Rob Clark
59ff81663a freedreno/ir3: catch incorrect usage of tmp-dst
Each get_dst() should have a matching put_dst().  Add a bit of checking
to catch mistakes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:09 -04:00
Ilia Mirkin
db1a94b1cc freedreno/ir3: use unsigned comparison for UIF
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:05 -04:00
Ilia Mirkin
11d72553c5 freedreno/ir3: negate result of USLT/etc
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:26:01 -04:00
Ilia Mirkin
8edf83b377 freedreno/ir3: add UARL support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:25:57 -04:00
Ilia Mirkin
10273f84c2 freedreno/ir3: INEG operates on src0, not src1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:25:52 -04:00
Ilia Mirkin
572ffca050 freedreno/ir3: fix FSLT/etc handling to return 0/-1 instead of 0/1.0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:25:47 -04:00
Rob Clark
80058c0f08 freedreno/a3xx: alpha render-target shenanigans
We need the .w component to end up in .x, since the hw appears to fetch
gl_FragColor starting with the .x coordinate regardless of MRT format.
As long as we are doing this, we might as well throw out the remaining
unneeded components.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:23:52 -04:00
Rob Clark
3e0a82b52e util/u_format: add _is_alpha()
Because of render-to-alpha (000x) shenanigans, freedreno needs to do
some special handling when rendering to alpha-only formats.  And I
noticed that while we had _is_luminance(), _is_intensity(), etc, an
_is_alpha() helper was missing.  So fix that.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:23:52 -04:00
Rob Clark
480fe244dd freedreno/a3xx: format fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:23:52 -04:00
Rob Clark
1fba490569 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:23:52 -04:00
Rob Clark
2ed7640eec freedreno/a3xx: handle rendering to layer != 0
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-12 16:23:52 -04:00
Brian Paul
0d73ac6b02 mesa: fix _mesa_free_pipeline_data() use-after-free bug
Unreference the ctx->_Shader object before we delete all the pipeline
objects in the hash table.  Before, ctx->_Shader could point to freed
memory when _mesa_reference_pipeline_object(ctx, &ctx->_Shader, NULL)
was called.

Fixes crash when exiting the piglit rendezvous_by_location test on
Windows.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-12 09:17:31 -06:00
Connor Abbott
2828680e39 ra: assert against unsigned underflow in q_total
q_total should never go below 0 (which is why it's defined as unsigned),
and if it does, then something is seriously wrong.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-12 16:07:47 +02:00
Connor Abbott
ec046bc08e ra: note a restriction in the interfence graph API
As noted in the previous commit, this was introduced in
567e2769b8 ("ra: make the p, q test more
efficient"), but I forgot to mention it.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-12 16:07:47 +02:00
Connor Abbott
afd82dcad1 r300g: set register classes before interferences
In commit 567e2769b8 ("ra: make the p, q
test more efficient") I unknowingly introduced a new requirement to the
register allocator API: the user must set the register class of all
nodes before setting up their interferences, because
ra_add_conflict_list() now uses the classes of the two interfering
nodes. i965 already did this, but r300g was setting up register classes
interleaved with setting up the interference graph. This led to us
calculating the wrong q total, and in certain cases
e78a01d5e6 (" ra: optimistically color
only one node at a time") made it so that this bug caused a segfault. In
particular, the error occurred if the q total was decremented to 1 below
0 for the last node to be pushed onto the stack.  Since q_total is an
unsigned integer, it overflowed to 0xffffffff, which is what
lowest_q_total happens to be initialzed to. This means that we would
fail the "new_q_total < lowest_q_total" check on line 476 of
register_allocate.c, and so the node would never be pushed onto the
stack, which led to segfaults in ra_select() when we failed to ever give
it a register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82828
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Tested-by: Pavel Ondračka <pavel.ondracka@email.cz>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-09-12 16:07:07 +02:00
Andreas Boll
2a13ff954d gallium/util: add missing u_debug include
Needed for assert.
Fixes build on BE archs with -Werror=implicit-function-declaration.

In file included from
../../../../../src/gallium/auxiliary/draw/draw_fs.c:30:0:
../../../../../src/gallium/auxiliary/util/u_math.h: In function
'util_memcpy_cpu_to_le32':
../../../../../src/gallium/auxiliary/util/u_math.h:810:4: error:
implicit declaration of function 'assert'
[-Werror=implicit-function-declaration]
    assert(n % 4 == 0);
        ^

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-12 15:55:12 +02:00
Chia-I Wu
802018df5f ilo: fix builder size checks for BLT buffer clear/copy
In buf_clear_region() and buf_copy_region(), max_cmd_size was set to 0.  If
either of the functions is called and there is not enough space in the
builder, the next ilo_cp_flush() will fail silently in a release build.

Replace magic numbers by size defines in tex_clear_region()/tex_copy_region()
for consistency and readability.
2014-09-12 16:58:31 +08:00
Chia-I Wu
07e0923203 ilo: reduce BLT function parameters
Intruduce gen6_blt_bo and gen6_blt_xy_bo to describe BOs.  In the extreme case
of gen6_XY_SRC_COPY_BLT(), the number of parameters goes down from 18 to 8.
2014-09-12 16:58:30 +08:00
Chia-I Wu
8fa62a9982 ilo: clean up BLT functions
Follow the changes for MI functions, but for BLT this time.
2014-09-12 16:58:30 +08:00
Chia-I Wu
a77aaf4363 ilo: clean up MI functions
With ilo_builder in place, some conventions we had to build commands are no
longer needed.
2014-09-12 16:58:30 +08:00
Chia-I Wu
0c6a9cde94 ilo: move BLT functions to ilo_builder_blt.h
Follow the changes for MI functions, but for BLT this time.
2014-09-12 16:58:30 +08:00
Chia-I Wu
50d2d9a69d ilo: move MI functions to ilo_builder_mi.h
Have a centralized place for MI functions, and remove the duplicated
gen6_MI_LOAD_REGISTER_IMM().
2014-09-12 16:58:30 +08:00
Chia-I Wu
521887f9fd ilo: add ILO_DEV_ASSERT()
It replaces ILO_GPE_VALID_GEN().
2014-09-12 16:58:30 +08:00
Chia-I Wu
56d2ebb019 ilo: use an accessor for dev->gen
It should enable us to do specialized builds by making the accessor return a
constant.
2014-09-12 16:58:30 +08:00
Chia-I Wu
ea5de3e0bd ilo: add GEN_EXTRACT() and GEN_SHIFT32()
They replace READ() and SET_FIELD() that we have been using.
2014-09-12 16:58:29 +08:00
Chia-I Wu
e8f4dd70ab ilo: remove ILO_GEN_GET_MAJOR()
The last user has gone away.
2014-09-12 16:58:29 +08:00
Chia-I Wu
611f09890e ilo: careful with empty fb state in ilo_gpe_set_fb()
We cannot pass 0 as the width or height to ilo_gpe_init_view_surface_null().
2014-09-12 16:58:29 +08:00
Ilia Mirkin
95058bdec3 nv50,nvc0: enable ARB_texture_view
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-12 00:57:45 -04:00
Ilia Mirkin
d82bd7eb06 mesa/st: add ARB_texture_view support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-12 00:55:26 -04:00
Ilia Mirkin
c113095acd gallium: add a texture target to sampler view and a CAP to use it
This allows a sampler view to have a different texture target than the
underlying resource. This will be used to implement the type casting
between 2d arrays and cube maps as specified in ARB_texture_view.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-12 00:54:55 -04:00
Ilia Mirkin
3c81de5851 nouveau: only enable stencil func if the visual has stencil bits
The _Enabled property already has the relevant information.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-12 00:51:20 -04:00
Ilia Mirkin
79959e5de5 nouveau: only enable the depth test if there actually is a depth buffer
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-12 00:50:56 -04:00
Maarten Lankhorst
8ab85bfcd5 nouveau: remove unneeded assert
No idea why it was added, but the code runs fine even on videos
where it triggers.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-11 23:18:07 -04:00
Maarten Lankhorst
a41aad8431 nouveau: rework reference frame handling
Fixes a regression from "nouveau/vdec: small fixes to h264 handling"

New picking order for frames:
 1. Vidbuf pointer matches.
 2. Take the first kicked ref.
 3. If that fails, take a ref that has a different last_used.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-11 23:18:05 -04:00
Maarten Lankhorst
121ceb38f4 nouveau: fix MPEG4 hw decoding
Reorder some fields to make I-frame decoding work correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-11 23:18:03 -04:00
Maarten Lankhorst
f6afed7076 nouveau: re-allocate bo's on overflow
The BSP bo might be too small to contain all of the bsp data,
bump its size on overflow. Also bump inter_bo when this happens,
it might be too small otherwise.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-11 23:17:52 -04:00
Chia-I Wu
1187dbdd10 ilo: fix a compile error with -Werror=format-security
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83777
2014-09-12 09:45:42 +08:00
Ian Romanick
7aeb853c90 i965/vec4: Only examine virtual_grf_end for GRF sources
If the source is not a GRF, it could have a register >= virtual_grf_count.
Accessing virtual_grf_end with such a register would lead to
out-of-bounds access.  Make sure the source is a GRF before accessing
virtual_grf_end.

Fixes Valgrind complaints while compiling some shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2014-09-11 11:18:36 -07:00
Brian Paul
a46d7579e9 st/mesa: handle failed context creation for core profile
If the glx/wgl state tracker requested a core profile but the gallium
driver did not support some feature of GL 3.1 or later, we were setting
ctx->Version=0 and then failing the assertion in
_mesa_initialize_exec_table().

With this change we check for ctx->Version=0 and tear down the context
and return NULL from st_create_context().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-11 08:22:55 -06:00
Iago Toral Quiroga
f976b4c1bf i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams.
So far we have been using CL_INVOCATION_COUNT to resolve this query but this
is no good with streams, as only stream 0 reaches the clipping stage.

From ARB_transform_feedback3:

"When a generated primitive query for a vertex stream is active, the
 primitives-generated count is incremented every time a primitive emitted to
 that stream reaches the Discarding Rasterization stage (see Section 3.x)
 right before rasterization. This counter is incremented whether or not
 transform feedback is active."

Unfortunately, we don't have any registers that provide the number of primitives
written to a specific stream other than the ones that track the number of
primitives written to transform feedback in the SOL stage, so we can't
implement this exactly as specified.

In the past we implemented this feature by activating the SOL unit even if
transform feeback was disabled, but making it so that all buffers were
disabled and it only recorded statistics, which gave us the right semantics
(see 3178d2474a). Unfortunately, this came with
a significant performance impact and had to be reverted.

This new take does not intend to implement the exact semantics required by
the spec, but improves what we have now, since now we return the primitive
count for stream 0 in all cases. With this patch we use
GEN7_SO_PRIM_STORAGE_NEEDED to resolve GL_PRIMITIVES_GENERATED queries
for non-zero streams. This would return the number of primitives written
to transform feedback for each stream instead. Since non-zero streams are
only useful in combination with transform feedback this should not be too
bad, and the only case that I think we would not be supporting would be
the one in which we want to use both GL_PRIMITIVES_GENERATED and
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN on the same non-zero stream to
detect buffer overflow.

This patch also fixes the following piglit test:
arb_gpu_shader5-xfb-streams-without-invocations

This test uses both GL_PRIMITIVES_GENERATED and
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries on non-zero streams, but it
does never hit the overflow case, so both queries are always expected to return
the same value.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-09-11 15:17:22 +02:00
Christian König
6327b58415 radeon/uvd: use PIPE_USAGE_STAGING for msg&fb buffers
That better matches the actual userspace use case, the
kernel will force it to VRAM if the hardware requires it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-11 15:06:09 +02:00
Christian König
4dfdcdb4b3 radeon/video: use the hw to initial clear the buffers
Less CPU overhead and avoids contention over CPU accessible memory on startup.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-11 15:06:03 +02:00
Christian König
4bc0059229 radeon/video: use more of the common buffer code v2
In preparation to using buffers clears with the hw engine(s).

v2: split out flipping to using hw buffer clears.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-11 15:05:55 +02:00
José Fonseca
771ab951a8 scons: add /dynamicbase and /nxcompat to MinGW linkflags
Just like b26503b196d51dc46c815e241343e42ab30e8d66 for MSVC.
2014-09-11 11:59:28 +01:00
Brian Paul
4860e98972 scons: add /dynamicbase and /nxcompat to MSVC linkflags
This builds the opengl DLLs with address layout space randomization
(ASLR) and data execution prevention (DEP) for better security.

Reviewed-by: Kurt Daverman <krd@vmware.com>
2014-09-11 11:59:28 +01:00
Chia-I Wu
6816d853db ilo: add a new disassembler
The old disassembler was modified from i965's.  It is as much work as doing a
new one to keep it up-to-date, which also requires copying more headers over.

The outputs of this new disassembler should match i965's as closely as
possible.
2014-09-11 16:29:38 +08:00
Chia-I Wu
b51b349942 ilo: update genhw headers
Add some new registers and some tweaks.  The changes that affect ilo are

 GEN6_REG_HS_INVOCATION_COUNT -> GEN7_REG_HS_INVOCATION_COUNT
 GEN6_REG_DS_INVOCATION_COUNT -> GEN7_REG_DS_INVOCATION_COUNT
 GEN6_COND_NORMAL             -> GEN6_COND_NONE
2014-09-11 16:29:38 +08:00
Frank Henigman
9c707d065a glsl: allow precision qualifier on sampler arrays
If a precision qualifer is allowed on type T, it should be allowed
on an array of T.  Refactor the check to ensure this is the case.

(Fixes failures in WebGL conformance test 'gl-min-textures')

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-11 10:41:00 +03:00
Tapani Pälli
096ee4c3b0 glsl: mark variable as loop constant when it is set read only
Patch modifies is_loop_constant() to take advantage of 'read_only' bit
in ir_variable to detect a loop constant. Variables marked read-only
are loop constant like mentioned by a comment in the function.

v2: remove unnecessary comment (Francisco)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82537
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-09-11 10:09:12 +03:00
Michel Dänzer
82edcb918b radeonsi: Simplify si_dma_copy_tile function
No functional change intended.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-11 12:36:03 +09:00
Brian Paul
5cf8d9f54b u_vbuf: simple whitespace fix 2014-09-10 16:37:54 -06:00
Brian Paul
9608193cbc mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC
MSVC replaces the "F" in "255.0F" with the macro argument which leads
to an error.  s/F/FLT/ to avoid that.

It turns out we weren't using this macro at all on MSVC until the
recent "mesa: Drop USE_IEEE define." change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-09-10 16:37:54 -06:00
Brian Paul
56d8cfd7a5 mesa: trim down some #includes 2014-09-10 13:16:00 -06:00
Vinson Lee
cc20c45a36 pipe-loader: Include unistd.h in pipe_loader_drm.c for close function.
This patch fixes a build error on DragonFly.

  CC       libpipe_loader_la-pipe_loader_drm.lo
pipe_loader_drm.c: In function 'pipe_loader_drm_probe':
pipe_loader_drm.c:207:10: error: implicit declaration of function 'close' [-Werror=implicit-function-declaration]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-10 11:59:38 -07:00
Kenneth Graunke
0bac2551e4 i965: Disable guardband clipping in the smaller-than-viewport case.
Apparently guardband clipping doesn't work like we thought: objects
entirely outside fthe guardband are trivially rejected, regardless of
their relation to the viewport.  Normally, the guardband is larger than
the viewport, so this is not a problem.  However, when the viewport is
larger than the guardband, this means that we would discard primitives
which were wholly outside of the guardband, but still visible.

We always program the guardband to 8K x 8K to enforce the restriction
that the screenspace bounding box of a single triangle must be no more
than 8K x 8K.  So, if the viewport is larger than that, we need to
disable guardband clipping.

Fixes ES3 conformance tests:
- framebuffer_blit_functionality_negative_height_blit
- framebuffer_blit_functionality_negative_width_blit
- framebuffer_blit_functionality_negative_dimensions_blit
- framebuffer_blit_functionality_magnifying_blit
- framebuffer_blit_functionality_multisampled_to_singlesampled_blit

v2: Mention the acronym expansion for TA/TR/MC in the comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-09-10 11:40:30 -07:00
Ian Romanick
927f5db461 i965: Request lowering gl_VertexID
Fixes the (new) piglit tests gles-3.0-drawarrays-vertexid,
gl-3.0-multidrawarrays-vertexid, and gl-3.2-basevertex-vertexid.

Fixes gles3conform failure in:

ES3-CTS.gtf.GL3Tests.transform_feedback.transform_feedback_vertex_id

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80247
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-10 11:05:09 -07:00
Kenneth Graunke
fbb353bc13 i965: Expose gl_BaseVertex via a vertex attribute.
Now that we have the data available, we need to expose it to the
shaders.  We can reuse the same vertex element that we use for
gl_VertexID, but we need to back it by an actual vertex buffer.

A hardware restriction requires that vertex attributes coming from a
buffer (STORE_SRC) must come before any other types (i.e. STORE_0).
So, we have to make gl_BaseVertex be the .x component of the vertex
attribute.  This means moving gl_VertexID to a different component.

I chose to move gl_VertexID and gl_InstanceID to the .z and .w
components, respectively, to make room for gl_BaseInstance in the .y
component (which would also come from a buffer, and therefore be
STORE_SRC).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Kenneth Graunke
87b10c4a71 i965: Refactor Gen4-7 VERTEX_BUFFER_STATE emission into a helper.
We'll need to emit another VERTEX_BUFFER_STATE for gl_BaseVertex;
pulling this into a helper function will save us from having to deal
with cross-generation differences in that code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Kenneth Graunke
fdbabf22e1 i965: Make gl_BaseVertex available in a buffer object.
This will be used for GL_ARB_shader_draw_parameters, as well as fixing
gl_VertexID, which is supposed to include gl_BaseVertex's value.

For indirect draws, we simply point at the indirect buffer; for normal
draws, we upload the value via the upload buffer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Kenneth Graunke
c89306983c i965: Calculate start/base_vertex_location after preparing vertices.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Ian Romanick
9975792abd i965: Handle SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-10 11:05:08 -07:00
Kenneth Graunke
26e949b26e mesa: Fix glGetActiveAttribute for gl_VertexID when lowered.
The lower_vertex_id pass converts uses of the gl_VertexID system value
to the gl_BaseVertex and gl_VertexIDMESA system values.  Since
gl_VertexID is no longer accessed, it would not be considered active.

Of course, it should be, since the shader uses gl_VertexID.

v2: Move the var->name dereference past the var != NULL check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Kenneth Graunke
26c9514155 mesa: Replace string comparisons with SYSTEM_VALUE enum checks.
This is more efficient.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-09-10 11:05:08 -07:00
Ian Romanick
ec08b5e768 glsl: Add a lowering pass for gl_VertexID
Converts gl_VertexID to (gl_VertexIDMESA + gl_BaseVertex). gl_VertexIDMESA
is backed by SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, and gl_BaseVertex is backed
by SYSTEM_VALUE_BASE_VERTEX.

v2: Put the enum in struct gl_constants and propoerly resolve the scope
in C++ code.  Fix suggested by Marek.

v3: Reabase on Matt's foreach_in_list changes (was using foreach_list).

v4 (Ken): Use a systemvalue instead of a uniform because
STATE_BASE_VERTEX has been removed.

v5: Use a boolean to select lowering, and only allow one lowering
method.  Suggested by Ken.

v6 (Ken): Replace strcmp against literal "gl_BaseVertex"/"gl_VertexID"
with SYSTEM_VALUE enum checks, for efficiency.

v7: Rebase on context constant initialization work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-10 11:05:08 -07:00
Ian Romanick
04d3323d4b glsl/linker: Make get_main_function_signature public
The next patch will use this function in a different file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-10 11:05:05 -07:00
Ian Romanick
1e87fbd78f mesa: Add SYSTEM_VALUE_BASE_VERTEX
This system value represents the basevertex value passed to
glDrawElementsBaseVertex and related functions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-10 11:04:50 -07:00
Ian Romanick
5964a4f344 mesa: Add SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
There exists hardware, such as i965, that does not implement the OpenGL
semantic for gl_VertexID.  Instead, that hardware does not include the
value of basevertex in the gl_VertexID value.
SYSTEM_VALUE_VERTEX_ID_ZERO_BASE is the system value that represents
this semantic.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-10 11:04:48 -07:00
Ian Romanick
9afb5ae8ca mesa: Document SYSTEM_VALUE_VERTEX_ID and SYSTEM_VALUE_INSTANCE_ID
v2: Additions to the documentation for SYSTEM_VALUE_VERTEX_ID.  Quote
the GL_ARB_shader_draw_parameters spec and mention DirectX SV_VertexID.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-09-10 11:04:44 -07:00
Jonathan Gray
cdb353539c configure.ac: unbreak the build with non gnu grep
181581280b changed the way the
llvm-config version is read from sed to grep and introduced
a requirement for gnu grep extension that treats BREs as EREs.

Avoid this by calling egrep instead of grep which should be
able to handle EREs everywhere.

This allows Mesa to build on OpenBSD again.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2014-09-10 08:35:11 -07:00
Eric Anholt
d64ca0a765 vc4: Add support for shadow samplers.
This doesn't quite make depth-tex-compare work, presumably because we're
not hitting equality with itof(sample) * 1.0/0xffffff in the 0xffffff
case.  arb_fragment_program_shadow tests pass, though, as well as a bunch
of other shadow-related stuff.
2014-09-09 20:41:43 -07:00
Eric Anholt
7d5c57f8e9 vc4: Add support for texture swizzles.
Fixes depth-tex-modes.
2014-09-09 20:39:29 -07:00
Eric Anholt
1e77c93340 vc4: Move the texture format into a struct.
I'm going to be putting some bitfields into the struct as well.
2014-09-09 20:38:39 -07:00
Eric Anholt
e7a6c54473 vc4: Add support for depth texturing. 2014-09-09 20:38:39 -07:00
Eric Anholt
d952a98c53 vc4: Expose r4 to register allocation.
We potentially need to be careful that use of a value stored in r4 isn't
copy-propagated (or something) across another r4 write.  That doesn't
appear to happen currently, and this makes the dataflow more obvious.  It
also opens up not unpacking the r4 value, which will be useful for depth
textures.
2014-09-09 20:38:39 -07:00
Eric Anholt
be1fcd2cd3 vc4: Drop pointless raddr conflict handling on SF.
SF doesn't have a src[1].
2014-09-09 20:38:39 -07:00
Eric Anholt
04faeff28a vc4: The r4_count is supposed to be how many writes, not reads.
It's part of the key so that you can tell which r4 value is being read.
2014-09-09 20:38:38 -07:00
Michel Dänzer
5679ccfcaf r600g,radeonsi: Set RADEON_GEM_NO_CPU_ACCESS flag for tiled BOs
This lets the kernel know that such BOs can be pinned outside of the CPU
accessible part of VRAM.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-10 12:01:10 +09:00
Rob Clark
720cfb6fe9 freedreno/a3xx: enable hw primitive-restart
Since software primitive-restart emulation is going to be removed (and
anyways, mostly seemed to be crash prone in combination with
u_primconvert and oddball scenarios (like PIPE_PRIM_POLYGON with only a
single vertex), might as well do it in hardware (which fortunately
didn't turn out to be too hard to figure out).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
564183f39c freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
a2c22d80d4 freedreno/ir3: fix potential segfault in RA
Triggered by shaders like:

  FRAG
  PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
  DCL OUT[0], COLOR
  DCL CONST[0]
  DCL TEMP[0..2], LOCAL
    0: IF CONST[0].xxxx :0
    1:   MOV TEMP[0], TEMP[1]
    2: ELSE :0
    3:   MOV TEMP[0], TEMP[2]
    4: ENDIF
    5: MOV OUT[0], TEMP[0]
    6: END

not really a sane shader, although driver segfaulting is probably
not the appropriate response.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
4f338c9bbf freedreno: don't overflow cmdstream buffer so much
We currently aren't too clever about dealing with running out of
cmdstream buffer space.  Since we use a single buffer for both drawing
and tiling commands, we need to ensure there is enough space at the tail
of the cmdstream buffer to fit the tiling commands.

Until we get more clever, the easy solution is a threshold to trigger
flushing rendering even if the application does not trigger flush (swap,
changing render target, etc).  This way we at least don't crash for apps
that do several thousand draw calls (like some piglit tests do).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
fd4884e929 freedreno/ir3: add no-copy-propagate fallback step
Most of the things the new compiler still has trouble with basically
amount to cp stage removing too many copies.  But without the cp stage,
the shaders the new compiler produces are still better (perf and
correctness) than the old compiler.  So a simple thing to do until I
have more time to work on it is first trying falling back to new
compiler without cp, before finally falling back to old compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Emil Velikov
e387fdd235 ilo: add ilo_builder.h to the sources list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 22:17:39 +01:00
Kenneth Graunke
e36bbff0e6 ir_to_mesa: Stop converting uniform booleans.
Excess conversions considered harmful.

Recently Matt reworked the boolean uniform handling to use the value of
UniformBooleanTrue, rather than integer 1, when uploading uniforms:

    mesa: Upload boolean uniforms using UniformBooleanTrue.
    glsl: Use UniformBooleanTrue value for uniform initializers.

Marek then set the default to 1.0f for drivers without native integer
support:

    mesa: set UniformBooleanTrue = 1.0f by default

However, ir_to_mesa was assuming a value of integer 1, and arranging for
it to be converted to 1.0f on upload.  Since Marek's commit, we were
uploading 1.0f = 0x3f800000 which was being interpreted as the integer
value 1065353216 and converted to float as 1.06535322E9, which broke
assumptions in ir_to_mesa that "true" was exactly 1.0f.

+13 Piglits on classic swrast (fs-bool-less-compare-true,
{vs,fs}-op-not-bool-using-if, glsl-1.20/execution/uniform-initializer).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-09 13:19:44 -07:00
Jonathan Gray
c68073e65f configure.ac: strip _GNU_SOURCE from llvm-config output
Mesa already defines _GNU_SOURCE for glibc based systems and defining
_GNU_SOURCE will break the Mesa build on other systems such as OpenBSD.

_GNU_SOURCE only seems to be included in llvm-config output when
LLVM is built via autoconf and not when it is built by cmake.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2014-09-09 20:04:45 +01:00
Stefan Dirsch
49022a9713 xmlconfig: suppress libGL warnings when LIBGL_DEBUG == "quiet"
Let's handle LIBGL_DEBUG env. variable in Mesa in a consistent way.

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=895730
Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
2014-09-09 19:46:57 +01:00
Emil Velikov
3d8b53ffb4 automake: remove obsolete NEED_GALLIUM_LOADER
Superseded by HAVE_LOADER_GALLIUM. The latter has a *DRM* brethren
making the whose easier on which one to keep.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:45:24 +01:00
Emil Velikov
44ec468e80 configure: enable the gallium loader only when needed
With the gallium megadrivers we've converted most ST to optionally
use either statically linked in or shared pipe-drivers.

The hardcoded switch forgot to conditionally enable the build of the
shared pipe-drivers which resulted in them being constantly build.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Cc: James Ausmus <james.ausmus@intel.com>
Reported-by: James Ausmus <james.ausmus@intel.com>
Tested-by: James Ausmus <james.ausmus@intel.com>
Bugzilla: https://code.google.com/p/chromium/issues/detail?id=412089
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:45:10 +01:00
Emil Velikov
6dcd5ae725 configure: inform the user when we're building sw/kms-dri
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:37 +01:00
Emil Velikov
2903289706 configure: kill off NEED_WINSYS_WRAPPER
Just drop the conditional and simplify our build. This means that
it'll build every time, but it does not require any dependencies nor
does it take that long to compile 200 lines of boilerplate code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:37 +01:00
Emil Velikov
0d0313ce9b configure: kill off NEED_NONNULL_WINSYS
The variable was unused and gave false information. The need for nonnull
winsys currently does not relate as it used to. Nowadays one can mix and
match more freely with plenty of winsys' to make your head spin.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:36 +01:00
Emil Velikov
40bb6f9313 configure: bail out if building svga without libdrm
With recent commit we removed the NEED_NONNULL_WINSYS checks when
selecting the hardware (inc svga) winsys. svga has only one winsys
that explicitly requires libdrm (via it's bundled version of
vmwgfx_drm.h) but configure.ac never really checks for it.

Add the check early to prevent people from shooting themselves when
they select the driver but lack libdrm.

$ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm
--with-dri-drivers=swrast --with-gallium-drivers=svga,swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:36 +01:00
Eric Anholt
2220692330 vc4: Fix segfaults when rendering with no color render target. 2014-09-09 07:29:16 -07:00
Eric Anholt
5774f16453 vc4: Fill out the stencil clear field.
The rest of stencil handling isn't done yet, but it documents an extra
cl_u8(0) and helps make it obvious why we don't need to format clear_depth
the same way the depth/stencil buffer is formatted.
2014-09-09 07:29:16 -07:00
Eric Anholt
fd6e4fccad vc4: Flip around the depth/stencil fields.
After implementing depth stores, it looks like this is the way things
actually are, according to hiz-depth-read-fbo-d24-s0's probes.
2014-09-09 07:29:16 -07:00
Eric Anholt
2cbecee4b7 vc4: Add support for loading/storing the depth buffer.
For now it still requires the color buffer to be present -- we're relying
on the store of color buffer contents to end the frame, and we have to do
something with color buffers in the rendering config packet.
2014-09-09 07:29:16 -07:00
Eric Anholt
1663a89374 vc4: Don't forget to do initial tile clearing for depth/stencil. 2014-09-09 07:29:16 -07:00
Eric Anholt
2cbdbeb4fa vc4: Ignore non-address bits of the offset for load/store.
These only get used for full buffer dumps, which we don't support yet
anyway.
2014-09-09 07:29:16 -07:00
Eric Anholt
a894898255 vc4: Add a debug flag for flushing after every draw.
It was useful on i965, but it's even more useful for debugging tiled
renderers.
2014-09-09 07:29:12 -07:00
Eric Anholt
840f381120 vc4: Add missing null terminator to the debug options list.
So far, apparently there's been some NULL laying at the address just after
the options anyway, but the next commit changed that.
2014-09-09 07:28:12 -07:00
Tom Stellard
181581280b configure.ac: Fix build with git-svn llvm version string
Reviewed-and-tested-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-09-09 09:47:25 -04:00
Kalyan Kondapally
78c9201a5b Linking fails when not writing gl_Position.
According to GLSL-ES Spec(i.e. 1.0, 3.0), gl_Position value is undefined
after the vertex processing stage if we don't write gl_Position. However,
GLSL 1.10 Spec mentions that writing to gl_Position is mandatory. In case
of GLSL-ES, it's not an error and atleast the linking should pass.
Currently, Mesa throws an linker error in case we dont write to gl_position
and Version is less then 140(GLSL) and 300(GLSL-ES). This patch changes
it so that we don't report an error in case of GLSL-ES.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83380
2014-09-09 10:39:39 +03:00
Chia-I Wu
2a49a94079 ilo: remove unused ilo_cp functions
Remove

  ilo_cp_begin()
  ilo_cp_steal()
  ilo_cp_write()
  ilo_cp_write_multi()
  ilo_cp_write_bo()
  ilo_cp_end()
  ilo_cp_steal_ptr()
  ilo_cp_assert_no_implicit_flush()
2014-09-09 13:31:37 +08:00
Chia-I Wu
90f4b131fc ilo: convert GPE GEN6 command functions to use ilo_builder
Similar to the changes to GEN7 command functions, but to GEN6 this time.

As every GPE function has been converted, remove
ilo_cp_assert_no_implicit_flush() calls.
2014-09-09 13:31:37 +08:00
Chia-I Wu
80e29ae42c ilo: convert GPE GEN7 command functions to use ilo_builder
Make these changes

  ilo_cp_begin()    -> ilo_builder_batch_pointer()
  ilo_cp_write()    -> direct memory set
  ilo_cp_write_bo() -> ilo_builder_batch_reloc()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
fff9869164 ilo: convert GPE state functions to use ilo_builder
Make these changes

  ilo_cp_steal_ptr() and memcpy() -> ilo_builder_state_write()
  ilo_cp_steal_ptr()              -> ilo_builder_state_pointer()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
c81a973e04 ilo: convert GPE surface functions to use ilo_builder
Make these changes

  ilo_cp_steal_ptr() and memcpy()   -> ilo_builder_surface_write()
  ilo_cp_steal() and ilo_cp_write() -> ilo_builder_surface_write()
  ilo_cp_write_bo()                 -> ilo_builder_surface_reloc()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
6cbd1f4bd3 ilo: convert BLT to use ilo_builder
Make these changes

  ilo_cp_begin()    -> ilo_builder_batch_pointer()
  ilo_cp_write()    -> direct memory set
  ilo_cp_write_bo() -> ilo_builder_batch_reloc()

and make sure there is no implicit flush.  Use this chance to drop the
"_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
d2acd67313 ilo: use ilo_builder for kernels and STATE_BASE_ADDRESS
Remove instruction buffer management from ilo_3d and adapt ilo_shader_cache to
upload kernels to ilo_builder.  To be able to do that, we also let ilo_builder
manage STATE_BASE_ADDRESS.
2014-09-09 13:31:37 +08:00
Chia-I Wu
55f80a3290 ilo: make ilo_cp based on ilo_builder
This makes ilo_cp use the builder to manage batch buffers, and use
ilo_builder_decode() to replace ilo_3d_pipeline_dump().
2014-09-09 13:31:36 +08:00
Chia-I Wu
dab4a676f7 ilo: add a builder for building BOs for submission
Comparing to how we manage batch and instruction buffers, the new builder

 - does not flush
 - manages both types of buffers
 - manages STATE_BASE_ADDRESS
 - uploads kernels using unsynchronized mapping
 - has its own decoder for the buffers
 - provides more helpers
2014-09-09 13:31:36 +08:00
Chia-I Wu
43bf14eaeb ilo: make toy_compiler_disassemble() more useful
Do not require a toy_compiler so that it can be used in other places, such as
state dumping.  Add a bool to control whether the raw instruction words are
shown.
2014-09-09 13:31:30 +08:00
Ilia Mirkin
4ea1565bbc nv50/ir: accomodate all file types, there are now more than 8
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
5966903c28 nvc0/ir: uses was always null at that point in the code
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
874a9396c5 nv50/ir: avoid array overrun when checking for supported mods
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
64c5aeaa94 nouveau: buffer can never be null
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
1792d60900 nvc0/ir: insn can never be null
Reported by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
9ced42b1aa nvc0: size is a uint16_t, remove unnecessary assertion
Reported by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
564e305094 nvc0: avoid null deref of screen when collecting stats
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
c02ac40837 nvc0: use 64-bit math when scaling the query results
Reported by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Roland Scheidegger
08f13ff439 gallivm: (trivial) don't try to use rcp when the division 1/x is integer
This would just crash. Noticed by accident while checking int divisions by zero
with a quickly hacked piglit test.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-09 01:44:08 +02:00
Roland Scheidegger
51b52ea013 docs: (trivial) mark softpipe, llvmpipe as done for GL_ARB_base_instance
Forgot to add it when I fixed up the start instance handling in (llvm) draw.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-09 01:44:07 +02:00
Roland Scheidegger
9405e15f51 gallivm: (trivial) fix min / max variable names
Calling the variable min when it's really max and vice versa seems a bit
confusing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-09-09 01:44:05 +02:00
Kenneth Graunke
a20cc2796f i965: Handle ir_binop_ubo_load in boolean expression code.
UBO loads can be boolean-valued expressions, too, so we need to handle
them in emit_bool_to_cond_code() and emit_if_gen6().

However, unlike most expressions, it doesn't make sense to evaluate
their operands, then do something with the results.  We just want to
evaluate the UBO load as a whole---which performs the read from
memory---then load the boolean result into the flag register.

Instead of adding code to handle it, we can simply bypass the
ir_expression handling, and fall through to the default code, which will
do exactly that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83468
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-08 15:43:52 -07:00
Kenneth Graunke
b9699e09bc i965/fs: Make emit_if_gen6 never fall back to emit_bool_to_cond_code.
Matt and I believe that Sandybridge actually uses 0xFFFFFFFF for a
"true" comparison result, similar to Ivybridge.  This matches the
internal documentation, and empirical results, but contradicts the PRM.

So, the comment is inaccurate, and we can actually just handle these
directly without ever needing to fall through to the condition code
path.

Also, the vec4 backend has always done it this way, and has apparently
been working fine.  This patch makes the FS backend match the vec4
backend's behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-08 15:43:51 -07:00
Kenneth Graunke
6272e60ca3 i965: Handle ir_triop_csel in emit_if_gen6().
ir_triop_csel can return a boolean expression, so we need to handle it
here; we simply forgot when we added ir_triop_csel, and forgot again
when adding it to emit_bool_to_cond_code.

Fixes Piglit's EXT_shader_integer_mix/{vs,fs}-mix-if-bool on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-08 15:43:49 -07:00
Christian König
12fb74fe89 mesa/st: don't advertise NV_vdpau_interop if it doesn't work.
As long as we don't have a workaround for frame based
decoding in VDPAU we should not advertise NV_vdpau_interop.

v2: fix commit message, check if get_video_param is present

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2014-09-08 16:53:39 +02:00
Brian Paul
a3306f028e docs: add news link to 10.2.7 release notes 2014-09-08 08:08:46 -06:00
Jordan Justen
dc0bd799ca i965/fs: Remove direct fs_visitor gl_fragment_program dependence
Instead we cast backend_visitor::prog for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-06 11:17:53 -07:00
Ulrich Weigand
0feb977bbf gallivm: Fix Altivec pack intrinsics for little-endian
This patch fixes use of Altivec pack intrinsics on little-endian PowerPC
systems.  Since little-endian operation only affects the load and store
instructions, the semantics of pack (and other) instructions that take
two input vectors implicitly change: the pack instructions still fill
a register placing values from the first operand into the "high" parts
of the register, and values from the second operand into the "low" parts
of the register, but since vector loads and stores perform an endian swap,
the high parts end up at high memory addresses.

To still achieve the desired effect, we have to swap the two inputs to
the pack instruction on little-endian systems.  This is done automatically
by the back-end for instructions generated by LLVM, but needs to be done
manually when emitting intrisincs (which still result in that instruction
being emitted directly).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2014-09-06 15:51:58 +02:00
Jordan Justen
1f184bc114 i965/fs: Remove direct fs_generator brw_wm_prog_key dependence
Instead we store a void pointer to the key, and cast it to
brw_wm_prog_key for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Jordan Justen
c43ae405aa i965/fs: Remove direct fs_generator brw_wm_prog_data dependence
Instead we store a brw_stage_prog_data pointer, and cast it to
brw_wm_prog_data for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Jordan Justen
f96a02c7ca i965/fs: Don't store gl_fragment_program* in fs_generator
gl_program* is named prog similar to backend_visitor.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Jordan Justen
936ca6f3cf i965: Add uses_kill to brw_wm_prog_data
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Jordan Justen
d0e166752a i965/fs: Rename fs_generator::prog to shader_prog
This matches backend_visitor, and will allow gl_program to be named prog.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Jordan Justen
000a9ee1ba i965/fs: Add stage variable to fs_generator
This will allow for stage specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 22:15:06 -07:00
Kristian Høgsberg
2d6d3461d3 i965: Adjust fast-clear resolve rect for BDW
The scale factors for the resolve rectangle change for BDW and we have
to look at brw->gen now to figure out how big it should be.

Fixes: https://bugs.freedesktop.org/attachment.cgi?id=105777
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 20:47:03 -07:00
Christoph Bumiller
ca9ab05d45 nvc0/ir: clarify recursion fix to finding first tex uses
This is a simple shader for reproducing the case mentioned:

FRAG
DCL IN[0], GENERIC[0], PERSPECTIVE
DCL OUT[0], COLOR
DCL SAMP[0]
DCL CONST[0]
DCL TEMP[0..1], LOCAL
IMM[0] FLT32 {    0.0000,    -1.0000,     1.0000,     0.0000}
  0: MOV TEMP[0].x, CONST[0].wwww
  1: MOV TEMP[1].x, CONST[0].wwww
  2: BGNLOOP
  3:   IF TEMP[0].xxxx
  4:     BRK
  5:   ENDIF
  6:   ADD TEMP[0].x, TEMP[0], IMM[0].zzzz
  7:   IF CONST[0].xxxx
  8:     TEX TEMP[1].x, CONST[0], SAMP[0], 2D
  9:   ENDIF
 10:   IF CONST[0].zzzz
 11:     MOV TEMP[1].x, CONST[0].zzzz
 12:   ENDIF
 13: ENDLOOP
 14: MOV OUT[0], TEMP[1].xxxx
 15: END

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-05 23:08:24 -04:00
Christoph Bumiller
b9f9e3ce03 nv50/ir/util: fix BitSet issues
BitSet::allocate() is being used with the expectation that it would
leave the bitfield untouched if its size hasn't changed, however,
the function always zeroed the last word, which led to obscure bugs
with live set computation.

This also fixes BitSet::resize(), which was broken, but luckily not
being used.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-05 23:05:42 -04:00
Ilia Mirkin
a71380040c nvc0: remove nvc0_push, replaced with nvc0_vbo_translate
Fixes build.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-05 23:00:27 -04:00
Ilia Mirkin
12311c7c52 nv50,nvc0: get rid of draw module support
This hasn't been enabled in a long time and is completely stale and
unnecessary. Remove, esp since it doesn't build.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-05 23:00:27 -04:00
Jason Ekstrand
ecf6c26757 i965/fs: Don't look at virtual_grf_sizes for uniforms
Uniform values are in the UNIFORM register file, not the GRF register file.
Looking in virtual_grf_sizes makes no sense and only makes the output of
dump_instructions confusing.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-05 17:33:17 -07:00
Dave Airlie
291ae622fd loader: fds can be 0
Possible resource leak reported by coverity.

Reported-by: Coverity scanner.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-06 10:24:25 +10:00
Emil Velikov
196e949cf7 docs: Import 10.2.7 release notes, add news item.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-06 01:18:45 +01:00
Emil Velikov
2c69c9fdcb gallium/vc4: ship all files in the tarball
- include all headers in Makefile.sources

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:27 +01:00
Emil Velikov
ec9d8060e4 gallium/trace: ship all files in the tarball
- include all headers in Makefile.sources
 - bundle the scons buildscript, README and trace.xsl

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:27 +01:00
Emil Velikov
7134043837 gallium/svga: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android & scons buildscript
 - include the headers' README & svga_dump.py

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:27 +01:00
Emil Velikov
f7008a6c5e gallium/softpipe: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android & scons buildscript

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:27 +01:00
Emil Velikov
858d932d6a gallium/rbug: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript & README

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
36b5012a8d gallium/radeonsi: ship all files in the tarball
- include all headers in Makefile.sources
 - bundle the android buildscript

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
8b48e14a48 gallium/radeon: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript & LLVM note

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
27d4f2eae3 gallium/r600: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript & custom include

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
cdd3a34096 gallium/r300: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript & the tests

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
2ba31a5185 gallium/nouveau: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript

v2: Don't double-include the compiler sources.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
0cba104921 gallium/noop: ship all files in the tarball
- include all headers in Makefile.sources
 - bundle the scons buildscript

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:26 +01:00
Emil Velikov
48d251cebb gallium/llvmpipe: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the scons buildscript

v2: Don't double include the test sources.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
a408b75849 gallium/identity: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the scons buildscript

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
930afeaa54 gallium/ilo: ship all files in the tarball
- include all headers in Makefile.sources
 - bundle the android buildscript

Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
38719795a6 gallium/i915: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android buildscript & TODO

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
8928788d58 gallium/galahad: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the scons buildscript

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
0ea9569d8f gallium/freedreno: ship all files in the tarball
- include all headers in Makefile.sources
 - sort the list(s)
 - bundle the android build

Cc: freedreno@lists.freedesktop.org
Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
525c48a316 gallium/tools: pick up the tools for distribution
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:25 +01:00
Emil Velikov
c6948da666 gallium/tests: ship all the tests in the release tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
13a5adc1b7 st/vega: ship the final headers
Commit 60d772cd9d1(st/vega: add headers and SConscript in
the tarball) meant to pick all the headers to be included in
the release tarball yet it missed a few.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
cd2e62a2f3 st/egl: include the remaining files in the tarball
A few files were missing, namely:
 - a few of the common headers
 - the android + gdi sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
96fb492583 st/glx/xlib: ship the SConscript in the release tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
fc69d1141b st/dri: ship the scons buildscript in the release tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
3d3d9c3617 st/clover: ship Doxyfile in the release tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:24 +01:00
Emil Velikov
cf0c4d6d63 gallium: ship state-tracker/README in the release tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:23 +01:00
Emil Velikov
c553b6e2df gallium: ship the non-automaked state-trackers & targets
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:23 +01:00
Emil Velikov
0fd45d3079 winsys/intel: drop intel_winsys.h from makefile.sources
With the last revisions of commit 664c2d76947(gallium/ilo: cleanup
intel_winsys.h) we moved the header from winsys to drivers, but we
forgot to update the makefile.sources to reflect this.

Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-09-05 23:46:23 +01:00
Anuj Phogat
d09167a39f meta: Store precompiled msaa shaders for all supported sample counts
Currently, BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE* and
BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE* shaders
in setup_glsl_msaa_blit_shader() are not recompiled
when the source buffer sample count changes. For example,
implementation continued using a 4X msaa shader, even if
source buffer changes from 4X msaa to 8x msaa. It causes
incorrect rendering.

This patch adds new enums in blit_msaa_shader, one for
each supported sample count, and uses them to store
msaa shaders.

Fixes following piglit tests on Broadwell:
ext_framebuffer_multisample-accuracy all_samples color
ext_framebuffer_multisample-accuracy all_samples depth_draw
ext_framebuffer_multisample-accuracy all_samples depth_resolve
ext_framebuffer_multisample-accuracy all_samples stencil_draw
ext_framebuffer_multisample-accuracy all_samples stencil_resolve
ext_framebuffer_multisample-formats all_samples

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstarnd <jason@jlekstrand.net>
2014-09-05 15:40:37 -07:00
Emil Velikov
0b76c51728 configure: check for core xcb and link the VL targets against it
Make sure to check the presence of the module in order to pick the
correct libs flag and before feeding them to the compiler/linker.

Current libXvMC*, libvdpau* and libomx_mesa depends unconditionally
upon xcb, due to their usage of the aux/vl gallium module.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-09-05 23:18:00 +01:00
Emil Velikov
17798bfb47 configure: check for core xcb and link libEGL against it
Make sure to check the presence of the module in order to pick the
correct libs flag and before feeding them to the compiler/linker.

Current libEGL depends conditionally (when building with x11 platform)
upon xcb.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 23:17:59 +01:00
Emil Velikov
da029f8081 configure: check for core xcb and link libGL against it
Make sure to check the presence of the module in order to pick the
correct libs flag and before feeding them to the compiler/linker.

Current libGL depends conditionally (when building with dri3) upon
xcb 1.9.3 and unconditionally on ancient xcb functions -
xcb_generate_id and xcb_request_check amongst others.

v2: Use PKG_CHECK_EXISTS() when checking for dri3 xcb.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80848
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 23:17:49 +01:00
Jason Ekstrand
7599886b26 i965/blorp: Pass image formats seperately from the miptree
When a texture is wrapped in a texture view, we can't trust the format in
the miptree itself.  This patch allows us to pass the format seperately
through blorp so we can proprerly handled wrapped textures.

It's worth noting here that we can use the miptree format directly for
depth/stencil formats because they cannot be reinterpreted by a texture
view.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
CC: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-09-05 10:45:27 -07:00
Matt Turner
87472ae58c i965/fs: Brown bag fix. 2014-09-05 10:29:38 -07:00
Matt Turner
e8df6a6b32 i965/vec4: Add ability to reswizzle arbitrary swizzles.
Before commit 04895f5c we would only reswizzle dot product instructions
(since they wrote the same value into all channels, and we didn't have
to think about anything else). That commit extended reswizzling to cases
when the swizzle was single valued -- i.e., writing the same result into
all channels.

But allowing reswizzling of arbitrary things is actually really easy and
is even less code. (Why didn't we do this in the first place?!)

total instructions in shared programs: 4266079 -> 4261000 (-0.12%)
instructions in affected programs:     351933 -> 346854 (-1.44%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 10:22:06 -07:00
Matt Turner
1ee1d8ab46 i965/vec4: Reswizzle sources when necessary.
Despite the comment above the function claiming otherwise, the function
did not reswizzle sources, which would lead to bad code generation since
commit 04895f5c, which began claiming we could do such swizzling when we
could not.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 10:22:06 -07:00
Jason Ekstrand
e49cfe9bfc i965/fs: Clean up emitting of untyped atomic and surface reads
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-05 10:04:06 -07:00
Matt Turner
ef8477cddf i965/fs: Fix basic block tracking in try_rep_send().
The 'start' instruction is always in the current block, except for the
case of shader time, which emits code in a pattern seen no where else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 09:53:21 -07:00
Matt Turner
248eaff63d i965/fs: Pass block to insert and remove functions missed earlier.
Otherwise, the basic block start/end IPs don't get updated properly,
leading to a broken CFG.  This usually results in the following
assertion failure:

brw_fs_live_variables.cpp:141:
void brw::fs_live_variables::setup_def_use():
Assertion `ip == block->start_ip' failed.

Fixes KWin, WebGL demos, and a score of Piglit tests on Sandybridge and
earlier hardware.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 09:52:50 -07:00
Kenneth Graunke
6ff5bb2465 i965: Mark cfg dumping functions const.
The dump() methods don't alter the CFG or basic blocks, so we should
mark them as const.  This lets you call them even if you have a const
cfg_t - which is the case in certain portions of the code (such as live
interval handling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-05 09:52:38 -07:00
Matt Turner
88d673bde6 i965: Update if_block/else_block in the dead control flow pass.
I think this bug crept in only recently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 09:52:29 -07:00
Matt Turner
3e248e0418 i965/fs: Connect cfg properly in predicated break peephole.
If the ENDIF instruction was the only instruction in its block, we'd
leave the successors of the merged if+jump block in a bad state.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83080
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-05 09:08:59 -07:00
Marek Olšák
1a00f24751 st/mesa: use 1.0f as boolean true on drivers without integer support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82882

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-05 15:41:47 +02:00
Marek Olšák
d67db73458 mesa: set UniformBooleanTrue = 1.0f by default
because NativeIntegers is 0 by default.

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

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-05 15:41:47 +02:00
Jonathan Gray
635477dc4b automake: check if the linker supports --dynamic-list
As older versions of gnu ld did not support --dynamic-list check to see
if it is supported before using it.  Non gnu linkers such the apple one
likely lack this option as well.

Fixes the build on OpenBSD which has binutils 2.15 and 2.17.
The --dynamic-list option seems to been have introduced sometime after
binutils 2.17 was released as it is present in 2.18.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 14:20:42 +01:00
Jonathan Gray
d3dee3df97 st/xvmc/tests: avoid non portable error.h functions
To improve compatibility with OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-05 14:17:34 +01:00
Andreas Pokorny
8bcd57a46c kms-swrast: Support Prime fd handling
Allows using prime fds as display target and from display target.
Test for PRIME capability after initializing kms_swrast screen.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2014-09-05 14:14:37 +01:00
Michel Dänzer
76b906c9f6 configure.ac: Add AC_SYS_LARGEFILE
Making sure large file support is enabled across the tree even on 32-bit
systems.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 18:08:59 +09:00
Francisco Jerez
b4539274b6 clover/util: Null-terminate the result of compat::string::c_str().
Reported-by: EdB <edb+mesa@sigluy.net>
2014-09-05 09:27:20 +03:00
Francisco Jerez
923c72982e clover/util: Implement compat::string using aggregation instead of inheritance. 2014-09-05 09:27:20 +03:00
Francisco Jerez
7c1e6d582c clover/util: Have compat::vector track separate size and capacity.
In order to make the behaviour of resize() and reserve() closer to the
standard.

Reported-by: EdB <edb+mesa@sigluy.net>
2014-09-05 09:27:20 +03:00
Francisco Jerez
995f7b37da clover: Use conversion operator to initialize build log from compat::string.
Fixes binary garbage in the compilation logs caused by
compat::string::c_str() not being null-terminated (which is a bug on
its own that will be fixed in another commit).

Reported-by: EdB <edb+mesa@sigluy.net>
2014-09-05 09:27:20 +03:00
Jordan Justen
864c463485 Revert 5 i965 patches: 8e27a4d2, 373143ed, c5bdf9be, 6f56e142, 88e3d404
Reverts
* "i965: Modify state upload to allow 2 different sets of state atoms."
   8e27a4d2b3
* "i965: Modify dirty bit handling to support 2 pipelines."
   373143ed91
* "i965: Create a macro for checking a dirty bit."
   c5bdf9be1e
   Conflicts:
	src/mesa/drivers/dri/i965/brw_context.h
* "i965: Create a macro for setting all dirty bits."
   6f56e1424d
   Conflicts:
	src/mesa/drivers/dri/i965/brw_blorp.cpp
	src/mesa/drivers/dri/i965/brw_state_cache.c
	src/mesa/drivers/dri/i965/brw_state_upload.c
* "i965: Create a macro for setting a dirty bit."
   88e3d404da

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-04 23:06:27 -07:00
Rob Clark
5d8f40a53a freedreno/ir3: fix constlen with relative addressing
We can't rely on the value from the assembler if relative addressing is
used.  So instead use the max of declared-consts (which does not include
compiler immediates) and what we get from the assembler (which does).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-04 22:28:50 -04:00
Rob Clark
73ff4c5f70 freedreno/ir3: fix error in bail logic
all_delayed will also be true if we didn't attempt to schedule anything
due to no more instructions using current addr/pred.  We rely on coming
in to block_sched_undelayed() to detect and clean up when there are no
more uses of the current addr/pred, which isn't necessarily an error.

This fixes a regression introduced in b823abed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-04 22:28:50 -04:00
Rob Clark
08ee0488e6 freedreno/ir3: bit of debug
Make it easier to figure out which compiler stage failed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-04 22:28:50 -04:00
Eric Anholt
4bca922878 vc4: Merge qcompile and tgsi_to_qir
The split between these two didn't make much sense.  I'm going to want the
chance to look at uniform contents in optimization passes, and the QPU
emit I think is going to end up rewriting the uniforms stream.
2014-09-04 17:00:54 -07:00
Jordan Justen
23e20f4687 i965/fs: Use prog rather than fp->Base in fs_visitor
Reduce fs_visitor's dependence on gl_fragment_program.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 11:46:42 -07:00
Jordan Justen
a346870ba8 i965/fs: Use stage_prog_data instead of prog_data->base in fs_visitor
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 11:46:42 -07:00
Jordan Justen
246211d366 i965/fs: Add init function to fs_visitor
This common init routine can be used by constructors for multiple program
types.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 11:46:42 -07:00
Eric Anholt
55d2a16262 vc4: Add a CSE optimization pass.
Debugging a regression in discard support was just too full of duplicate
instructions, so I decided to remove them instead of re-analyzing each of
them as I dumped their outputs in simulation.
2014-09-04 11:39:51 -07:00
Eric Anholt
80b27ca2cd vc4: Switch to using native integers.
There were troubles with bools without using native integers
(st_glsl_to_tgsi seemed to think bool true was 1.0f sometimes, when as a
uniform it's stored as ~0), and since I've got native integers other than
divide, I might as well just support them.
2014-09-04 11:39:51 -07:00
Eric Anholt
874dfa8b2e vc4: Expose compares at a lower level in QIR.
Before, we had some special opcodes like CMP and SNE that emitted multiple
instructions.  Now, we reduce those operations significantly, giving
optimization more to look at for reducing redundant operations.

The downside is that QOP_SF is pretty special -- we're going to have to
track it separately when we're doing instruction scheduling, and we want
to peephole it into the instruction generating the destination write in
most cases (and not allocate the destination reg, probably.  Unless it's
used for some other purpose, as well).
2014-09-04 11:39:51 -07:00
Eric Anholt
3972a6f057 vc4: Stop being so clever in CMP handling.
This kind of cleverness should be in a general merging-of-ADD-and-MUL
instruction scheduler, rather than individual opcodes.
2014-09-04 11:39:51 -07:00
Eric Anholt
511d2f9a13 state_tracker: Fix bug in conditional discards with native ints.
A bool is 0 or ~0, and KILL_IF takes a float arg that's <0 for discard or
>= 0 for not.  By negating it, we ended up doing a floating point subtract
of (0 - ~0), which ended up as an inf.  To make this actually work, we
need to convert the bool to a float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-04 11:39:50 -07:00
Brian Paul
e69b4abc43 swrast: s/INLINE/inline/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 12:17:44 -06:00
Brian Paul
0f255fd26b osmesa: s/INLINE/inline/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 12:17:44 -06:00
Brian Paul
27727b8479 xlib: s/INLINE/inline/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 12:17:44 -06:00
Brian Paul
c4a0be73ea meta: s/INLINE/inline/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 12:17:43 -06:00
Brian Paul
44df6df05b mesa: s/INLINE/inline/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-04 12:17:40 -06:00
Marek Olšák
3dbf55c1be r600g,radeonsi: make sure there's enough CS space before resuming queries
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83432

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-04 16:15:21 +02:00
Marek Olšák
374f3e9e19 mesa: invalidate draw state in glPopClientAttrib
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82538

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-04 16:09:56 +02:00
Marek Olšák
8bd6723179 Revert "r600g,radeonsi: initialize HTILE to fully-expanded state"
This reverts commit f05fe294e7.

Apparently the hw doesn't like this. Revert to the "cleared" state.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83418
2014-09-04 15:48:38 +02:00
Thomas Hellstrom
2d6206140a winsys/svga: Fix incorrect type usage in IOCTL v2
While similar in layout, the size of the SVGA3dSize type may be smaller than
the struct drm_vmw_size type that is part of the ioctl interface. The kernel
driver could accordingly overwrite a memory area following the size variable
on the stack. Typically that would be another local variable, causing
breakage in, for example, ubuntu 12.04.5 where the handle local variable
becomes overwritten.

v2: Fix whitespace errors

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: "10.1 10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-04 14:31:52 +02:00
Timothy Arceri
504f5f9d1a glapi: Add KHR_debug functions to check_table test
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-09-04 12:29:14 +10:00
Carl Worth
ecc89e4e42 egl: Restrict multiplication in calloc arguments to use compile-time constants
As explained in the previous commit, we want to avoid the possibility of
integer-multiplication overflow while allocating buffers.

In these two cases, the final allocation size is the product of three values:
one variable and two that are fixed constants at compile time.

In this commit, we move the explicit multiplication to involve only the
compile-time constants, preventing any overflow from that multiplication, (and
allowing calloc to catch any potential overflow from the remainining implicit
multiplication).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 18:37:02 -07:00
Carl Worth
c35f14f368 Eliminate several cases of multiplication in arguments to calloc
In commit 32f2fd1c5d, several calls to
_mesa_calloc(x) were replaced with calls to calloc(1, x). This is strictly
equivalent to what the code was doing previously.

But for cases where "x" involves multiplication, now that we are explicitly
using the two-argument calloc, we can do one step better and replace:

	calloc(1, A * B);

with:

	calloc(A, B);

The advantage of the latter is that calloc will detect any overflow that would
have resulted from the multiplication and will fail the allocation, (whereas
the former would return a small allocation). So this fix can change
potentially exploitable buffer overruns into segmentation faults.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 18:37:02 -07:00
Kenneth Graunke
96ce065db4 glsl: Report progress from opt_copy_propagation_elements().
It's been altering the tree and reporting "false" since January 2011.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 17:26:06 -07:00
Kenneth Graunke
702b6ea051 glsl: Skip rewriting instructions in opt_cpe when unnecessary.
Previously, opt_copy_propagation_elements would always rewrite the
instruction stream, even if was the same thing as before.  In order to
report progress correctly, we'll need to bail if the suggested
replacement is identical (or equivalent) to the original code.

This also introduced unnecessary noop swizzles, as far as I can tell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 17:26:04 -07:00
Kenneth Graunke
5ced83ee15 glsl: Initialize source_chan in opt_copy_propagation_elements.
Previously, if chans < 4, we passed uninitialized stack garbage to the
ir_swizzle constructor for the excess components.  Thankfully, it
ignores that data, as it's unnecessary, so no harm actually comes of it.

However, it's obviously better to initialize it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 17:25:56 -07:00
Kenneth Graunke
8270b048cf i965: Handle ir_triop_csel in emit_bool_to_cond_code().
ir_triop_csel can return a boolean expression, so we need to handle it
here; we simply forgot when we added it.

Fixes Piglit's EXT_shader_integer_mix/{vs,fs}-mix-if-bool.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-09-03 17:12:03 -07:00
Kenneth Graunke
f92fbd554f i965: Move curb_read_length/total_scratch to brw_stage_prog_data.
All shader stages have these fields, so it makes sense to store them in
the common base structure, rather than duplicating them in each.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-03 17:11:33 -07:00
Carl Worth
7528f6fd17 build: Rename md5 to checksums as part of .PHONY target
In commit 46d03d37bf I renamed a Makefile target
from md5 to checksums, (as we switched from MD5 checksums to SHA-256
checksums, so the more general name is more future proof).

But that commit missed one mention of "md5" as a dependency of the .PHONY
target. Rename that here as well.
2014-09-03 16:08:20 -07:00
tiffany
cfc42db592 glsl: fix assertion which fails for unsigned array indices.
According to the GLSL 1.40 spec, section 5.7 Structure and Array Operations:

"Array elements are accessed using an expression whose type is int or uint."

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-09-03 13:52:39 -06:00
Jason Ekstrand
11ee9a4d99 i965/copy_image: Divide the x offsets by block width when using the blitter
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 12:27:19 -07:00
Jason Ekstrand
499acf6e4a i965/copy_image: Use the correct block dimension
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 12:27:19 -07:00
Jason Ekstrand
b608cd7fbf meta/copy_image: Use the correct texture level when creating views
Previously, we were accidentally assuming that the level of both textures
was 0.  Now we actually use the correct level in our hacked texture view.
This doesn't 100% fix the meta path because the texture type is getting
lost somewhere in the pipeline.  However, it actually copies to/from the
correct layer now.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 12:27:19 -07:00
Jason Ekstrand
fcb6d5b9ef i965/copy_image: Use the correct texture level
Previously, we were using the source images level for both source and
destination.  Also, we weren't taking the MinLevel from a potential texture
view into account.  This commit fixes both problems.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 12:27:19 -07:00
Michel Dänzer
58b386dce4 gallivm: Fix build against LLVM SVN >= r216982
Only MCJIT is available anymore.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-03 09:15:01 -07:00
Marek Olšák
8abdc3c4a9 r600g: fix alpha-test with HyperZ enabled, fixing L4D2 tree corruption
*_update_db_shader_control depends on the alpha test state. The problem was
it was in a block which is only entered if the pixel shader is changed.

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

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-03 11:50:21 +02:00
Michel Dänzer
2adf7ee92e r600g,radeonsi: Preserve existing buffer flags
The default case was accidentally clearing RADEON_FLAG_CPU_ACCESS from the
previous fall-through cases.

Reported-by: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-03 12:49:59 +09:00
Jason Ekstrand
454aab45ef main: Don't leak temporary texture rows
Reviewed-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-09-02 15:50:27 -07:00
Dave Airlie
8380b894ad r300g: pointless assignment of info.indexed
Did this code mean to do something else, you tell me!

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-03 07:59:09 +10:00
Dave Airlie
2b24e58310 omx/h264: remove stray semicolon after if
Coverity reported this, looks wrong to me.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-03 07:58:58 +10:00
Dave Airlie
f4ccf687a6 vdpau: unlock the mutex on error paths in attribute setting.
Coverity pointed out we never dropped the lock here, so fix
it by using a common exit path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-03 07:58:50 +10:00
Eric Anholt
2da9118852 u_primconvert: Use u_upload_mgr for our little IB allocations.
tex-miplevel-selection was hammering my memory manager with primconverts
on individual quads.  This gets all those converted IBs packed into larger
IBs.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
2014-09-02 13:55:15 -07:00
Eric Anholt
6720d1573a u_primconvert: Shut up compiler warning.
gcc isn't detecting that src is set before used, since both are under if
(info->indexed).

Reviewed-by: Rob Clark <robclark@freedesktop.org>
2014-09-02 13:55:15 -07:00
Eric Anholt
1718ba30e5 gbm: Fix gallium build when X11 is in a non-system directory
pipe-loader.h will include Xlib.h when HAVE_PIPE_LOADER_XLIB is set in the
build.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-02 13:48:54 -07:00
Eric Anholt
d71a9b7d9d vc4: Handle a couple of the transfer map flags.
This is part of fixing extremely long runtimes on some piglit tests that
involve streaming vertex reuploads due to format conversions, and will
similarly be important for X performance, which relies on these flags.
2014-09-02 12:10:56 -07:00
Kristian Høgsberg
8f55174fbd meta: Make MESA_META_DRAW_BUFFERS restore properly
A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL
state.  We recreate the draw buffer enums from the buffer bitfield, which
changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT).

This commit modifes the save/restore logic to instead copy the buffer enums
from the gl_framebuffer and then set them on restore using
_mesa_drawbuffers().

It's not clear how this breaks the benchmark in 82796, but fixing meta to not
leak the state change fixes the regression.

No piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
2014-09-02 10:33:13 -07:00
Emil Velikov
5a4e0f3873 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>
2014-09-02 11:39:29 +01:00
Dave Airlie
021e84f292 mesa/program_cache: calloc the correct size for the cache.
Coverity reported this, and I think this is the right solution,
since cache->items is struct cache_item ** not struct cache_item *,
we also realloc it using struct cache_item * at some point.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-02 16:42:24 +10:00
Michel Dänzer
a75fee78c6 radeonsi: Compile dummy pixel shader on demand
It's never used under normal circumstances.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-02 15:24:07 +09:00
Michel Dänzer
b84b9eae20 u_blitter: Create all shaders on demand
Not all of these are used in every context, so this can make a
significant difference for short-lived contexts such as in piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-02 15:24:07 +09:00
Michel Dänzer
51131c423c r600g,radeonsi: Inform the kernel if a BO will likely be accessed by the CPU
This allows the kernel to prevent such BOs from ever being stored in the
CPU inaccessible part of VRAM.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-02 15:24:07 +09:00
Dave Airlie
2d5d1f5598 glsl: free uniform_map on failure path.
If we fails in reserve_explicit_locations, we leak uniform_map.

Reported-by: coverity scanner.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-02 16:05:52 +10:00
Paul Berry
9f20503658 main/cs: Add gl_context::ComputeProgram
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Jordan Justen
d035d50e05 mesa: Convert NewDriverState to 64-bits
i965 will have more than 32 bits when BRW_STATE_COMPUTE_PROGRAM is added.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-01 19:38:27 -07:00
Paul Berry
8e27a4d2b3 i965: Modify state upload to allow 2 different sets of state atoms.
The set of state atoms for compute shaders is currently empty; it will
be filled in by future patches.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Paul Berry
373143ed91 i965: Modify dirty bit handling to support 2 pipelines.
The hardware state for compute shaders is almost entirely orthogonal
to the hardware state for 3D rendering.  To avoid sending unnecessary
state to the hardware, we'll need to have a separate set of state
atoms for the compute pipeline and the 3D pipeline.  That means we
need to maintain two separate sets of dirty bits to determine which
state atoms need to be run.

But the dirty bits are not completely independent; for example, if
BRW_NEW_SURFACES is flagged while doing 3D rendering, then not only do
we need to re-run 3D state atoms that depend on BRW_NEW_SURFACES, but
we also need to re-run compute state atoms that depend on
BRW_NEW_SURFACES.  But we'll also need to re-run those state atoms the
next time the compute pipeline is run.

To accomplish this, we record two sets of dirty bits, one for each
pipeline.  When bits are dirtied (via SET_DIRTY_BIT() or
SET_DIRTY_ALL()) we set them to the dirty state in both pipelines.
When brw_state_upload() is run, we clear the dirty bits just for the
pipeline that was run.

Note that since the number of pipelines is known at compile time to be
2, the compiler should unroll the loops in SET_DIRTY_BIT() and
SET_DIRTY_ALL().

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Paul Berry
c5bdf9be1e i965: Create a macro for checking a dirty bit.
This will make it easier to extend dirty bit handling to support
compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Paul Berry
6f56e1424d i965: Create a macro for setting all dirty bits.
This will make it easier to extend dirty bit handling to support
compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Paul Berry
88e3d404da i965: Create a macro for setting a dirty bit.
This will make it easier to extend dirty bit handling to support
compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 19:38:27 -07:00
Dave Airlie
94a909ec2d 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>
2014-09-02 11:07:11 +10:00
Dave Airlie
19f6e80a1e nouveau: don't leak dec struct on error
This one path doesn't goto fail, so it seems to leak dec.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-02 10:08:58 +10:00
Dave Airlie
32a8b2cf54 xvmc/tests: %C isn't a valid printf specifier.
Reported-by: Coverity scanner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-02 10:07:54 +10:00
Dave Airlie
ea88b1de2f nouveau/nv40: quiten coverity warning in unused vertex texture code.
This fixes the code, but we never run it anyways, so silence coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-02 10:04:29 +10:00
Ilia Mirkin
d0cd86686d nv50: remove unused variables
Recent code changes have caused these to no longer be used. Remove them.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-01 18:47:42 -04:00
Ilia Mirkin
0c38006b55 mesa: force height of 1D textures to be 1 in texture views
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
2c44043313 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
9d52e551a5 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
2528d402b9 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
6c2b079231 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
115d9a5525 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
362cd26960 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>
2014-09-01 18:38:02 -04:00
Ilia Mirkin
c4bb436f76 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>
2014-09-01 18:38:02 -04:00
Rob Clark
ef858ac770 freedreno/ir3: add DDX/DDY
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-01 18:08:21 -04:00
Rob Clark
5e5604cc28 freedreno/ir3: don't keep IR around
Once we've assembled the shader, no need to keep the intermediate
around.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-01 18:08:21 -04:00
Jason Ekstrand
e8f83538dd i965/fs: Don't segfault when debug-logging a null program
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-01 12:33:13 -07:00
Jason Ekstrand
1c573c9adb i965/vec4: Don't segfault when debug-logging a null program
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-01 12:31:56 -07:00
Marek Olšák
a10c8db715 radeonsi: implement EXPCLEAR optimization for depth
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:52 +02:00
Marek Olšák
f05fe294e7 r600g,radeonsi: initialize HTILE to fully-expanded state
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:52 +02:00
Marek Olšák
573313c94e radeonsi: implement fast depth clear
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:51 +02:00
Marek Olšák
63cb4077e6 radeonsi: move DB_RENDER_CONTROL into draw_vbo
So that I can add fast depth clear.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:51 +02:00
Marek Olšák
78aa717601 radeonsi: disable occlusion queries if they are not needed
We always left them enabled, which turned off HiZ in some cases.
This should improve performace with Hyper-Z.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:51 +02:00
Marek Olšák
ab9ad91779 r600g,radeonsi: force fast stencil and HTILE stencil off, fixing a Hyper-Z hang
This should be as fast as no HTILE for stencil. I think we can still get full
performance with depth-only rendering even if stencil is present in the buffer
but not used, but I'm not 100% sure. This may be revisited when HiS and fast
stencil clear are implemented.

This fixes a hang in Brutal Legend.

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

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:51 +02:00
Marek Olšák
ba14d4910c r600g: set VGT_ENHANCE=4 on R7xx
This is a golden setting on RV740, but there is a hw bug which recommends
setting it on all R7xx chipsets.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:49 +02:00
Marek Olšák
13b93596da r600g: expose AMD_vertex_shader_layer and *_viewport_index on R600-R700
already implemented

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:45 +02:00
Marek Olšák
d159c5e3e0 r600g: fix layered clear
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:42 +02:00
Marek Olšák
e6d191bb6f r600g: some DB bug workarounds for R6xx DB flushing
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:40 +02:00
Marek Olšák
0ccc653c70 r600g: enable fast depth clear for array textures and cubemaps
I have a piglit test that hits this.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:37 +02:00
Marek Olšák
6d751065cc r600g: use HTILE allocator from SI
It's almost the same.

This enables tiling for HTILE. It also enables Hyper-Z for other texture
targets (1D, 1D_ARRAY, 2D_ARRAY, CUBE, CUBE_ARRAY, 3D, RECT).

2D array depth textures are tested by Unigine Sanctuary and my new piglit
test.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:18:33 +02:00
Marek Olšák
ee1b30eaff r600g: set DB_DEPTH_SIZE.HEIGHT_TILE_MAX for EG/CM, inline other fields
This fixes rendering to non-zero layer/face/slice with HTILE.

v2: added the assertion

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:17:40 +02:00
Marek Olšák
91050ff215 radeonsi: set DB_DEPTH_SIZE.HEIGHT_TILE_MAX, inline other fields
This fixes rendering to a non-zero layer/face/slice with HTILE.

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

v2: added the assertion

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-09-01 21:15:36 +02:00
Glenn Kennard
8d0f6ff810 r600g: Implement sm5 geometry shader instancing
Requires Evergreen or later hardware.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-09-01 21:12:03 +02:00
Marek Olšák
482def592f 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>
2014-09-01 21:03:58 +02:00
Marek Olšák
b419c651fb gallium/pb_bufmgr_cache: limit the size of cache
This should make a machine which is running piglit more responsive at times.
e.g. streaming-texture-leak can easily eat 600 MB because of how fast it
creates new textures.
2014-09-01 20:17:48 +02:00
Marek Olšák
bba7d29a86 pipe-loader: use the correct screen index 2014-09-01 20:09:19 +02:00
Marek Olšák
0b56e23e7f egl/dri2: use the correct screen index
Required for multi-GPU configuration where each GPU has its own X screen.
2014-09-01 20:09:19 +02:00
Jordan Justen
1a428a5256 docs: Mark ARB_compute_shader as work in progress
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2014-09-01 10:45:37 -07:00
Connor Abbott
d571f2b15d i965/fs: don't use ir->shadow_comparitor in emit_texture_*
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-01 00:55:14 -07:00
Connor Abbott
cbfcb1b069 i965/fs: don't pass ir_variable * to emit_samplepos_setup()
We were only using it to get at its type, which we already know because
it's a builtin variable.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-01 00:12:15 -07:00
Connor Abbott
ec3d06f591 i965/fs: don't pass ir_variable * to emit_frontfacing_interpolation()
We were only using it to get at its type, which we already know because
it's a builtin variable.

v2 (Ken): Rebase on Matt's optimized gl_FrontFacing calculations.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-01 00:11:16 -07:00
Kenneth Graunke
70691f0c28 i965: Fix GPU hangs when INTEL_DEBUG=no16 is set.
The replicated data clear shader needs to be SIMD16, or else the GPU
will hang.  So, compile it even if INTEL_DEBUG=no16 is set.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-31 17:03:31 -07:00
Emil Velikov
88cbe3908f 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>
2014-09-01 00:22:20 +01:00
Abdiel Janulgue
5598458e69 i965/vec4: Remove try_emit_saturate
Now that saturate is implemented natively as an instruction,
we can cut down on unneeded functionality.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:09 +03:00
Abdiel Janulgue
cbd225057a i965/fs: Refactor try_emit_saturate
v3: Since the fs backend can emit saturate as a separate instruction, there is
    no need to detect for min/max instructions and to rewrite the instruction tree
    accordingly. On the other hand, we don't need to emit a separate saturated
    mov either when the expression generating src can do saturate directly.
v4: Add can_do_saturate() check before enabling saturate modifer (Ken)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:09 +03:00
Abdiel Janulgue
b2c0c35907 ir_to_mesa, glsl_to_tgsi: Remove try_emit_saturate
Now that saturate is implemented natively as instruction,
we can cut down on unneeded functionality.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:09 +03:00
Abdiel Janulgue
7841a246b9 i965/vec4: Allow propagation of instructions with saturate flag to sel
When sel conditon is bounded within 0 and 1.0. This allows code as:
        mov.sat a b
        sel.ge  dst a 0.25F

To be propagated as:
        sel.ge.sat dst b 0.25F

v3: - Syntax clarifications in inst->saturate assignment
    - Remove extra parenthesis when assigning src_reg value
      from copy_entry (Matt Turner)
v4: - Take channels into consideration when propagating saturated instructions.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:09 +03:00
Abdiel Janulgue
40aeb558ce i965/fs: Allow propagation of instructions with saturate flag to sel
When sel conditon is bounded within 0 and 1.0. This allows code as:
	mov.sat a b
	sel.ge  dst a 0.25F

To be propagated as:
	sel.ge.sat dst b 0.25F

v3: Syntax clarifications in inst->saturate assignment (Matt Turner)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:09 +03:00
Abdiel Janulgue
0e2ba3ee82 glsl: Optimize clamp(x, b, 1.0), where b > 0.0 as max(saturate(x),b)
v2: - Output max(saturate(x),b) instead of saturate(max(x,b))
    - Make sure we do component-wise comparison for vectors (Ian Romanick)
v3: - Add missing condition where the outer constant value is > 0.0 and
      inner constant is 1.0.
    - Fix comments to show that the optimization is a commutative operation
      (Matt Turner)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
d92394c5d8 glsl: Optimize clamp(x, 0.0, b), where b < 1.0 as min(saturate(x),b)
v2: - Output min(saturate(x),b) instead of saturate(min(x,b)) suggested by Ilia Mirkin
    - Make sure we do component-wise comparison for vectors (Ian Romanick)
v3: - Add missing condition where the outer constant value is zero and
      inner constant is < 1
    - Fix comments to reflect we are doing a commutative operation (Matt Turner)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
8f890b119e glsl: Optimize clamp(x, 0, 1) as saturate(x)
v2: - Check that the base type is float (Ian Romanick)
v3: - Make sure comments reflect that we are doing a commutative operation
    - Add missing condition where the inner constant is 1.0 and outer constant is 0.0
    - Make indexing of operands easier to read (Matt Turner)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
cbd0d643a3 glsl: Implement saturate as ir_unop_saturate
Now that we have the ir_unop_saturate implemented as a single
instruction, generate the correct simplified expression.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
cb621166dc yi965/vec4: Add support for ir_unop_saturate
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
4bfe8a1e61 i965/fs: Add support for ir_unop_saturate
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
909fa50f5b ir_to_mesa, glsl_to_tgsi: Add support for ir_unop_saturate
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
cfa8c1cb39 ir_to_mesa, glsl_to_tgsi: lower ir_unop_saturate
Needed when vertex programs doesn't allow saturate

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
8935c12937 glsl: Add a pass to lower ir_unop_saturate to clamp(x, 0, 1)
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
4c0ccfc5b3 glsl: Add constant evaluation of ir_unop_saturate
v2: Use CLAMP macro (Ian Romanick)

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
a5f02b6696 glsl: Add ir_unop_saturate
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-31 21:04:08 +03:00
Abdiel Janulgue
f340145107 i965/vec4/fs: Count loops in shader debug
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:04:03 +03:00
Abdiel Janulgue
ddc1d297bc i965/vec4: inline generate_vec4_instruction() within generate_code()
Suggested by Matt. This patch combines and moves back the code-generation
functions from generate_vec4_instruction() into generate_code(). Makes
generate_code() a bit larger, but helps us to count loops in a
straightforward manner.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-08-31 21:03:49 +03:00
Kenneth Graunke
e34a363a78 i965: Add 2x MSAA support to Broadwell fast clear code.
According to the cited documentation section (but in the newer docs),
x_scaledown is the same for 2x and 4x MSAA.

+47 piglits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83081
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
2014-08-31 01:48:10 -07:00
Matt Turner
8b5ac1df17 i965/vec4: Update register coalescing test.
In commit 04895f5c I added support for reswizzling writemasks. This test
was checking that we didn't support this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82881
2014-08-30 21:00:28 -07:00
Matt Turner
0492275038 i965: Use unreachable() to silence warning.
brw_meta_fast_clear.c:211:17: warning: 'x_scaledown' may be used
uninitialized in this function [-Wmaybe-uninitialized]
    unsigned int x_scaledown, y_scaledown;

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-30 21:00:28 -07:00
Chia-I Wu
a14c23735e ilo: set INTEL_RELOC_GGTT only on GEN6
We asked MI commands to use GGTT only on GEN6.
2014-08-31 10:34:39 +08:00
Chia-I Wu
255b274d75 ilo: fix bound check for 3DSTATE_URB_VS
Fix max/min entries on GEN7.5 GT2/GT3.
2014-08-31 10:34:39 +08:00
Chia-I Wu
5f4b13f5fa ilo: replace cmd by dw0 in GPE
With e3c251071b, the magic values are gone.  We
no longer need "cmd" to hide them.  Replace it by dw0.
2014-08-31 10:34:39 +08:00
Alexander von Gluck IV
7b6ea6ab8c st/hgl: Move st_visual create/destroy into hgl state_tracker 2014-08-30 19:35:24 -04:00
Alexander von Gluck IV
15da8d0761 st/hgl: Move st_manager create/destroy into hgl state_tracker 2014-08-30 19:35:24 -04:00
Rob Clark
c06afcede2 freedreno/ir3: fix potential null ptr deref
Fix potential segfault in debug code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-30 18:02:51 -04:00
Rob Clark
c99f09f4be freedreno/ir3: add TXB
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-30 18:02:51 -04:00
Rob Clark
b823abedf8 freedreno/ir3: detect scheduler fail
There are some cases where the scheduler can get itself into impossible
situations, by scheduling the wrong write to pred or addr register
first.  (Ie. it could end up being unable to schedule any instruction if
some instruction which depends on the current addr/reg value also
depends on another addr/reg value.)

To solve this we'd need to be able to insert extra mov instructions
(which would also help when register assignment gets into impossible
situations).  To do that, we'd need to move the nop padding from sched
into legalize.

But to start with, just detect when we get into an impossible situation
and bail, rather than sitting forever in an infinite loop.  This way it
will at least fall back to the old compiler, which might even work if
you are lucky.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-30 18:02:50 -04:00
Ian Romanick
932b0ef1ce glsl: Use bit-flags image attributes and uint16_t for the image format
All of the GL image enums fit in 16-bits.

Also move the fields from the anonymous "image" structucture to the next
higher structure.  This will enable packing the bits with the other
bitfield.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 76 40,572,916,873       68,831,248       63,328,783     5,502,465            0
After  (32-bit): 70 40,577,421,777       68,487,584       62,973,695     5,513,889            0

Before (64-bit): 60 36,822,640,058       96,526,824       88,735,296     7,791,528            0
After  (64-bit): 74 37,124,603,758       95,891,808       88,466,712     7,425,096            0

A real savings of 346KiB on 32-bit and 262KiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-29 23:29:19 -07:00
Ian Romanick
8eeca7a56c glsl: Use a single bit for the dual-source blend index
The only values allowed are 0 and 1, and the value is checked before
assigning.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 74 40,580,119,657       69,186,544       63,506,327     5,680,217            0
After  (32-bit): 76 40,572,916,873       68,831,248       63,328,783     5,502,465            0

Before (64-bit): 89 36,822,971,897       96,526,616       88,735,296     7,791,320            0
After  (64-bit): 60 36,822,640,058       96,526,824       88,735,296     7,791,528            0

A real savings of 173KiB on 32-bit and no change on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-29 23:28:26 -07:00
Ian Romanick
c0cd5bedf6 glsl: Eliminate ir_variable::data.atomic.buffer_index
Just use ir_variable::data.binding... because that's the where the
binding is stored for everything else that can use layout(binding=).

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 50 40,564,927,443       69,185,408       63,683,871     5,501,537            0
After  (32-bit): 74 40,580,119,657       69,186,544       63,506,327     5,680,217            0

Before (64-bit): 59 36,822,048,449       96,526,888       89,113,000     7,413,888            0
After  (64-bit): 89 36,822,971,897       96,526,616       88,735,296     7,791,320            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-29 23:27:59 -07:00
Kenneth Graunke
941269f89c mesa: Delete ctx->GeometryProgram.Cache.
The VertexProgram and FragmentProgram have a Cache member for dealing
with fixed function programs.  There are no fixed function geometry
programs, so this should never have existed, and was just copy and
pasted.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-29 22:13:37 -07:00
Roland Scheidegger
ca4f0baca2 gallivm: fix somewhat broken NaN behavior for exp2
I actually screwed that up in 754319490f,
mistakenly thinking the code actually wanted the non-nan result before.
So, introduce that missing nan behavior case and use that instead.
For sse, there's no actual change in the resulting code at all, the fallback
code wouldn't have done the right thing though.
Of course, the actual issue I saw with pow() was completely unrelated...

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:34:41 +02:00
Roland Scheidegger
3d29e75a5f softpipe: handle vertex texture sampling when using llvm for draw
Pretty trivial, just fill in the offsets and such. The implementation
is near 100% copy and paste from llvmpipe. Should be useful for debugging.

No piglit change when not using SOFTPIPE_USE_LLVM=1.
Now that it can do the same tests with and without using llvm for vs/gs,
with llvm more pass, the only things failing only with llvm seems to be
edgeflags tests and vs/gs-pow-float-float (and for the latter I'm not
convinced the zero tolerance it requires is somehow mandated by glsl).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:34:16 +02:00
Roland Scheidegger
62fd871984 llvmpipe: (trivial) enable cube map arrays
The code is all in place now so enable it.
Seems to pass all relevant piglit tests (just like cube maps, some of the
cube map array tests need GALLIVM_DEBUG=no_quad_lod,no_rho_approx)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:33:40 +02:00
Roland Scheidegger
9da75f96bc gallivm: handle cube map arrays for texture sampling
Pretty easy, just make sure that all paths testing for PIPE_TEXTURE_CUBE
also recognize PIPE_TEXTURE_CUBE_ARRAY, and add the layer * 6 calculation
to the calculated face.
Also handle it for texture size query, looks like OpenGL wants the number
of cubes, not layers (so need division by 6).

No piglit regressions.

v2: fix up adding cube layer to face for seamless filtering (needs to happen
after calculating per-sample face). Undetected by piglit unfortunately.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (v1)
2014-08-30 01:33:02 +02:00
Roland Scheidegger
26a5156de7 draw: kill off bogus assertion in tgsi_fetch_gs_outputs
Not sure why it was there but it is definitely not an error if gs outputs are
infs/nans. Besides, the outputs can be ints, in which case any small negative
number asserted.
This fixes piglit's texelFetch gs isamplerXX crashes with softpipe (down from
14 to 2).

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:17:47 +02:00
Roland Scheidegger
c9ae5038d5 softpipe: don't assert on illegal wrap mode for rect textures
piglit tex-miplevel-selection nowadays doesn't use repeat wrap mode due to
sampler objects any longer, however at the time of the clear the wrap mode
is still illegal and at this point we get to verify the state, including
samplers (even though they won't get used), and because mesa doesn't treat
it as an incomplete texture as the spec says it should, we hit the assertion.
Just warn about this for now instead.
Gets crashes down from 44 to 14 in a piglit run (all were in various tests of
tex-miplevel-selection with texture rectangles). Though just about all
tex-miplevel-selection tests fail anyway for other reasons.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:17:47 +02:00
Roland Scheidegger
032fe4ed23 tgsi: (trivial) fix handling msaa resources on TXF
Just handle as ordinary 2d / 2d array resources. Prevents an assertion failure
with softpipe and piglit glsl-resource-not-bound 2DMS/2DMSArray tests.
While here also fix TXD shadowCube similarly, which fixes the crash with piglit
tex-miplevel-selection textureGrad CubeShadow (the test will still fail due to
softpipe being broken).

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:17:47 +02:00
Roland Scheidegger
99105454b0 draw: remove fishy num_samplers/num_sampler_views check in llvm path
This was meant for softpipe to not crash at some point if vertex texturing
was used. It is, however, fishy because it uses values from
draw_set_samplers/draw_set_sampler_views and not from the shader key. Albeit
we should still in all cases actually generate a new shader if this changes
(because the samplers and views themselves are in the key) I don't want to
think again wondering if that's really correct in the future.
Besides, at least today, it does not actually work for softpipe, as this was
relying on softpipe not actually calling draw_set_samplers/sampler_views at
all - I've verified it crashes regardless (if there were a tex instruction in
the vs, which normally should not happen anyway). For drivers which do indeed
not call these functions because they don't support vertex texturing at all
(r300), this should still not crash because the static texture data is all
zero, which causes the sampling functions to take an early out (same as is done
if no texture is bound at the slot used for sampling - verified with hacked up
softpipe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-30 01:17:46 +02:00
Roland Scheidegger
85d4cc4790 mesa: fix fallback texture for cube map array
mesa was creating a cube map array texture with just one layer, which is
not legal. This caused an assertion failure when using that texture later
in llvmpipe (when enabling cube map arrays) since it verifies the number
of layers in the view is divisible by 6 (the sampling code might well crash
randomly otherwise) with piglit glsl-resource-not-bound CubeArray -fbo -auto.

v2: use appropriately sized texel array...

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2014-08-30 01:17:46 +02:00
Aaron Watry
7c73ee677f r600/compute: Don't leak compute pool item_list/unallocated_list
v3: Fix multi-line comment format
v2: Change to C-style comments and fix indentation

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
2014-08-29 17:38:24 -05:00
Michel Dänzer
6cd0dbc415 u_vbuf: Make sure all caps are initialized
Pointed out by valgrind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83148
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-29 12:15:10 +09:00
Michel Dänzer
2a99b6e40f r600g: Reinstate include path to common radeon source directory
Fixes build failure since commit a131263a2f
('gallium/radeon: cleanup header inclusion'):

../../../../../src/gallium/drivers/r600/evergreen_compute.c:50:30: fatal error: radeon_llvm_util.h: No such file or directory
 #include "radeon_llvm_util.h"
                              ^
compilation terminated.

Trivial.
2014-08-29 12:09:16 +09:00
Matt Turner
2cab62a68d i965: Mark BRW_CONDITIONAL_R as Gen <= 5. 2014-08-28 19:06:45 -07:00
Matt Turner
4fcefac753 i965/disasm: Show jump count for if/iff/halt.
These instructions don't have pop count.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-28 19:06:27 -07:00
Matt Turner
fb2fddefce i965/disasm: Disassemble JMPI's source properly.
The source can be a register as well as an immediate, and disassembling
a register as an immediate can have some strange results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-28 19:06:27 -07:00
Matt Turner
bef7a025eb i965/disasm: Add break/cont/halt to list of has_uip().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-28 19:06:27 -07:00
Matt Turner
383eccb77e i965/disasm: Disassemble Z/NZ conditional modifiers as .z/.nz.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-28 19:06:27 -07:00
Ilia Mirkin
b4418cd4ce nouveau: allow more tokens by default to avoid parse failures
Also print a note saying that parsing failed to help isolate issues.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-28 21:53:55 -04:00
Emil Velikov
76e5406e58 targets/haiku-softpipe: explicitly prefix sw/hgl header
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:41:51 -04:00
Emil Velikov
f5fb9c556b sw/hgl: struct haiku_displaytarget is not public struct
It is meant to be private within the actual winsys. Remove it from
the exported header, and fold it into it's only user.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:41:46 -04:00
Emil Velikov
3b36ba4c39 include/haiku: fix comment typo
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:41:29 -04:00
Emil Velikov
5b8900ded3 hgl: trivial bits
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:34:43 -04:00
Alexander von Gluck IV
311b59495c gallium/targets: Break haiku state_tracker out to own directory
Ack'ed by Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:27:29 -04:00
Alexander von Gluck IV
86d1aa8531 gallium/targets: Haiku softpipe, perform better framebuffer validation
* Check for back left attachment as well
* Set and act on pipe format none

Ack'ed by Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:27:26 -04:00
Emil Velikov
96b45e67d5 st/egl: ship all the files in the tarball
Namely we were missing the headers and the Android/SCons buildscripts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:42 +01:00
Emil Velikov
da1d324909 st/clover: sort the sources list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:42 +01:00
Emil Velikov
010fa9074e st/gbm: include the header in the sources list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:42 +01:00
Emil Velikov
27be19aa45 st/xlib: Include the headers in the sources list.
Yet another step towards a working 'make dist'.

Cc: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: José Fonseca <jfonseca@vmware.com>
2014-08-28 21:24:42 +01:00
Emil Velikov
526a9d9c5e st/omx: use makefile.sources to handle sources lists
... and add the headers so that 'make check' is happy.

Cc: 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-08-28 21:24:41 +01:00
Emil Velikov
f6507d2357 st/vdpau: pickup/ship the private header
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-08-28 21:24:41 +01:00
Emil Velikov
e3fd703e85 st/vdpau: remove obsolete define VL_HANDLES
This define is always set and it had no real purpose according to
git log. Seems like it is a leftover from the vl/vdpau prototype
stage.

Cc: 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-08-28 21:24:41 +01:00
Emil Velikov
60d772cd9d st/vega: add headers and SConscript in the tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:41 +01:00
Emil Velikov
bcdb47d838 st/xa: add remaining files in the tarball
Namely
 - the private header (xa_priv.h)
 - README and
 - xa-indent

Sort the sources list while we're here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:40 +01:00
Emil Velikov
398f6eefee st/xvmc: pick up the headers for distribution
- autotools/make will pick them up in the tarball.
 - Sort the list alphabetically.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:40 +01:00
Emil Velikov
c6e5801b40 Revert "configure: Disable xvmc by default"
This reverts commit 6a19bb56e0.

The above commit disabled the default build of xvmc as the xvmc tests
were failing. As pointed out by Ilia, the tests are "broken by design"
as they do not test the object that is build but the one that is
installed and setup on the workstation.

With previous commit we moved the programs from the 'make check' to
noinst automake target. This way they won't be run but will be around
for people to use them.

Cc: Tom Stellard <thomas.stellard@amd.com>
2014-08-28 21:24:40 +01:00
Emil Velikov
91f49befd0 st/xvmc: automake: move tests to noinst
All the tests require an installed and setup XvMC, thus they
are not good candidates for 'make check'.
Keep them around as the user might want to actually test the
implementation post installation/setup.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Tom Stellard <thomas.stellard@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:40 +01:00
Emil Velikov
015792fb02 winsys/sw: add the final files to the tarball
Add the final remaining files into the tarball (make dist), namely:
 - SConscripts
 - Non-autotooled winsys' - android, gdi and hgl.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:39 +01:00
Emil Velikov
95603e259b winsys/sw: automake: consistently use Makefile.sources
- Include the headers within.
 - Update scons to use them.
 - Drop useless include (gallium/drivers) from scons.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:39 +01:00
Emil Velikov
f0ae81cc13 winsys/$(hw): ship the Android/SCons scripts in the tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:38 +01:00
Emil Velikov
63e9831756 winsys/$(hw): include headers in Makefile.sources
Otherwise 'make dist' will not pick them up :'(

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:38 +01:00
Emil Velikov
afdc44deca st/egl: cleanup sw winsys header inclusions
- Drop duplicate include compiler directives.
 - Leave the sw/ prefix for all the software winsys headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:37 +01:00
Emil Velikov
30f3df4e53 winsys/radeon: move radeon_cs_dump.h to drm
... to ease packaging (make dist).
Update it to fetch libdrm's include/libs via pkg-config.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-28 21:24:37 +01:00
Emil Velikov
a131263a2f gallium/radeon: cleanup header inclusion
- Add top_srcdir/src/gallium/winsys to GALLIUM_DRIVER_C{XXFLAGS}.
 - Remove top_srcdir/src/gallium/drivers/radeon from the includes.

As a result:
 - Common radeon headers are prefixed with 'radeon/'
 - Winsys header inclusion is prefixed 'radeon/drm'

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-28 21:24:37 +01:00
Emil Velikov
22a13f5b09 winsys/svga: build: cleanup the includes
gallium/drivers is already part fo GALLIUM_WINSYS_CFLAGS.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-28 21:24:36 +01:00
Emil Velikov
7dc2f9f919 winsys/i915: remove the software winsys
We stopped building it recently as it was unused and not tested.
Good bye, it's been nice knowing you :)

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Stephane Marchesin <stephane.marchesin@gmail.com>
2014-08-28 21:24:36 +01:00
Emil Velikov
664c2d7694 gallium/ilo: cleanup intel_winsys.h
Make the header location, inclusion and contents more common with
its i915,r* and nouveau counterparts:

 - Move the header within drivers/ilo.
 - Separate out intel_winsys_create_for_fd into 'drm_public' header.
 - Cleanup the compiler includes.

v2: Move the header to drivers/ilo. Suggested by Chia-I.
v3: Correct intel_winsys.h inclusion. Spotted by Chia-I.

Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-08-28 21:24:16 +01:00
Timothy Arceri
4ca203f6a1 docs: mark GL_MAX_VERTEX_ATTRIB_STRIDE as done
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-27 20:36:03 -10:00
Timothy Arceri
89e6806dea gallium: add cap for MAX_VERTEX_ATTRIB_STRIDE
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-27 20:35:59 -10:00
Timothy Arceri
3246e11d33 mesa: implement GL_MAX_VERTEX_ATTRIB_STRIDE
V2: moved test for the VertexAttrib*Pointer() functions
 to update_array(), and made constant available for drivers to set

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-27 20:35:56 -10:00
Michel Dänzer
eae9da879f st/clover: Fix build against LLVM SVN >= r216583
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-28 12:05:21 +09:00
Roland Scheidegger
eee9f6ae8a draw: fix base instance handling in llvm path
The base instance needs to be passed to the jited function, otherwise the
instanced data fetch will only work with the same start instance when the
jit function was created (and baking that into the key instead is not a viable
option).
This fixes piglit arb_base_instance-drawarrays (modulo some unrelated
core/compat context trouble I get for the test).
And fix the pipe cap bit in llvmpipe for it now that it actually works (it
already worked for softpipe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-28 03:03:23 +02:00
Roland Scheidegger
17eabfeccf docs: fix up status of softpipe, llvmpipe
The docs were never really up to date for them, missing just about everything.
So mark them off as all done for GL 3.3 (though softpipe is in fact quite
broken for some newer things especially wrt texturing, and both don't have
compliant, real msaa support). And add the extensions missing too (no
guarantee of completeness).

Reviewed-by: Dave Airlie <airlied@gmail.com>
2014-08-28 03:01:16 +02:00
Alexander von Gluck IV
0348429586 glsl: Add strings.h on non-MSC platforms
* IEEE Std 1003.1-2001 placed strcasecmp() in strings.h.
* ISO C99 doesn't mention strcase* in string.h
* On all platforms I could find, strcasecmp is in strings.h and string.h
  as a compatibility layer for software written pre-2001 POSIX
* Technically strcasecmp should be only in strings.h and the man
  pages back this up.
* Tested build on CentOS and Haiku

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-27 20:20:58 -04:00
Alex Deucher
6b48c18b03 radeon/uvd: remove comment about RV770
It doesn't seem to support field based decode after testing.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-08-27 10:04:13 -04:00
Christian König
80771e47b6 radeon/uvd: fix field handling on R6XX style UVD
The first UVD generation can only do frame based output.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-08-26 17:56:57 +02:00
Christian König
03a99ba9e4 vl/compositor: set the scissor before clearing the render target
Otherwise we clear areas that shouldn't be cleared.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2014-08-26 17:56:57 +02:00
Christian König
b73c20759f st/vdpau: fix vlVdpOutputSurfaceRender(Output|Bitmap)Surface
Correctly handle that the source_surface is only optional.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2014-08-26 17:56:57 +02:00
Chia-I Wu
e3c251071b ilo: use genhw command opcodes
Replace ILO_GPE_MI and ILO_GPE_CMD with magic values by descriptive genhw
macros.
2014-08-26 14:11:02 +08:00
Chia-I Wu
6c73478223 ilo: rename intel_bo_map_unsynchronized()
Rename it to intel_bo_map_gtt_async().
2014-08-26 14:10:50 +08:00
Chia-I Wu
354d84b629 ilo: remove max_batch_size
It is used to derive an artificial limit on max relocs per bo.  We choose not
to export it anymore.
2014-08-26 14:10:50 +08:00
Chia-I Wu
fbb869c1aa ilo: replace domains by reloc flags
It is simpler and is supported by the kernel.  It cannot be used with
libdrm_intel yet though.
2014-08-26 14:10:50 +08:00
Chris Forbes
01887593a4 docs: Update who is working on tessellation
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-26 07:51:11 +12:00
Chris Forbes
38a3490368 glsl: Remove bogus "OUPTUT" token
This is never used. There is another token "OUTPUT" which the lexer can
generate, though. This has been around since the dawn of time; is most
likely a typo.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-26 07:50:43 +12:00
Marek Olšák
83503f9e68 radeonsi: handle PIPE_BIND_BLENDABLE
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-25 13:12:24 +02:00
Marek Olšák
770719eb82 r600g: only set PIPE_BIND_BLENDABLE if colorbuffer rendering is supported
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-25 13:12:24 +02:00
Marek Olšák
bc0ae40616 r300g: handle PIPE_BIND_BLENDABLE
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-25 13:12:23 +02:00
Eric Anholt
7317f11859 vc4: Stop doing qpu_inst(add, NOP) or qpu_inst(NOP, mul).
Now that the extra WADDR is set, we can knock this off.  Saves a lot of
typing, and makes this code much more legible.
2014-08-24 22:13:26 -07:00
Eric Anholt
78d144f7de vc4: Set the other WADDR in the qpu instruction helpers.
Now you don't need to qpu_inst() your instruction with a NOP to get the
other waddr set.
2014-08-24 22:13:26 -07:00
Eric Anholt
54499a85ff vc4: Merge qpu_a_NOP() and qpu_m_NOP to a single qpu_NOP() helper.
Now that qpu_inst() ignores the WADDR from the other half of the
instruction, we can set both the ADD and MUL WADDRs in the NOP helper.
Thanks to that, we also no longer need to qpu_inst(NOP, NOP).
2014-08-24 22:13:25 -07:00
Eric Anholt
1a7035f386 vc4: Ignore WADDRs from the other half of the instruction when merging.
This allows setting the opposite-side WADDR to NOP (a non-zero value) in
qpu_* helpers, so that we don't need to qpu_inst() merge them with NOPs
all the time just to get the waddr set.
2014-08-24 22:13:25 -07:00
Eric Anholt
3212bafc28 vc4: Fix LT/GE set-0-or-1 compares.
We were using the integer sub, which worked for the common case of EQ and
NE.  Fixes fs-lessThan-ivec2-ivec2 and other tests.
2014-08-24 22:13:25 -07:00
Eric Anholt
e2f66315cb u_vbuf: Add a few more format fallbacks.
Fixes piglit draw-vertices and gl-2.0-vertexattribpointer on vc4, where
I'm only advertising R32F to RGBA32F support so far.

Note: regresses gl-1.5-normal3b3s-invariance due to introduced flushes and
missing depth buffer load/store support in the driver.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-24 22:13:25 -07:00
Eric Anholt
bbbe3b65ad u_vbuf: Simplify the format fallback translation.
Individual caps made supporting new fallbacks more complicated than it
needed to be.  Instead, just make a table of fallbacks at context init
time.

v2: Fix inverted "do we need to install vbuf?" flagging caught by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
2014-08-24 22:13:25 -07:00
Rob Clark
306e421887 freedreno/a2xx: fix segfault
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-24 13:09:47 -04:00
Rob Clark
bd3b096467 freedreno/a3xx: handle first/last level properly
Fixes some assumptions about first_level being zero.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-24 13:09:23 -04:00
Rob Clark
b40a6c2b17 freedreno: implement pipe_flush_resource()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-24 13:09:00 -04:00
Rob Clark
478a08ebd2 freedreno: don't ignore src/dst level
Don't ignore src/dst_level in pipe_copy_region.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-08-24 13:08:14 -04:00
Eric Anholt
8d8a5eb792 vc4: Fix save/restore of the VS/FS in the blitter.
When I made the shader cache take the .fs member and moved the binding
point to .bind_fs, I failed to update these.  Fixes crashes in
copyteximage-related tests.
2014-08-23 16:30:42 -07:00
Eric Anholt
9542e68207 vc4: Clear padding of ioctl arguments.
Fixes valgrind complaints from valgrind being unaware of our ioctls.
2014-08-23 16:30:34 -07:00
Vinson Lee
c2867f5b36 auxilary/os: Add Solaris support in os_get_total_physical_memory.
The patch fixes the build on Oracle Solaris.

  CC     os/os_misc.lo
"os/os_misc.c", line 59: #error: unexpected platform in os_sysinfo.c

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-22 18:24:34 -07:00
Alexander von Gluck IV
12a679a6f6 gallium/targets: Haiku, Fix some improper type warnings 2014-08-22 19:37:19 -04:00
Alexander von Gluck IV
31406d978d gallium/targets: Clean up Haiku softpipe renderer visual
* Drop creating gl_config first as it's only really used
  to create the state tracker visual.
2014-08-22 19:37:19 -04:00
Carl Worth
23163df24c glcpp: Don't use alternation in the lookahead for empty pragmas.
We've found that there's a buffer overrun bug in flex that's triggered by
using alternation in a lookahead pattern.

Fortunately, we don't need to match the exact {NEWLINE} expression to
detect an empty pragma. It suffices to verify that there are no non-space
characters before any newline character. So we can use a simple [\r\n] to
get the desired behavior while avoiding the flex bug.

Fixes the regression of piglit's 17000-consecutive-chars-identifier test,
(which has been crashing since commit
04e40fd337 ).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82472
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

CC: <mesa-stable@lists.freedesktop.org>
2014-08-22 15:14:59 -07:00
Kenneth Graunke
97d03b9366 i965: Disable try_emit_b2f_of_compare on Gen4-6.
The optimization relies on CMP setting the destination to 0, which is
equivalent to 0.0f.  However, early platforms only set the least
significant byte, leaving the other bits undefined.  So, we must disable
the optimization on those platforms.

Oddly, Sandybridge wasn't reported as broken.  The PRM states that it
only sets the LSB, but the internal documentation says that it follows
the IVB behavior.  Since it wasn't reported as broken, we believe it
really does follow the IVB behavior.

v2: Allow the optimization on Sandybridge (requested by Matt).

+32 piglits on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?=79963
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-22 11:40:32 -07:00
Matt Turner
b8aa1005c8 i965/fs: Preserve CFG in predicated break pass.
Operating on this code,

B0: ...
    cmp.ne.f0(8)
    (+f0) if(8)
B1: break(8)
B2: endif(8)

We can delete B2 without attempting to merge any blocks, since the
break/continue instruction necessarily ends the previous block.

After deleting the if instruction, we attempt to merge blocks B0 and B1.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
3c4c2a6e30 i965/fs: Rename variable in predicated break pass.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
1db74a423f i965/fs: Preserve CFG in the SEL peephole.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
81755bc67b i965: Preserve CFG when deleting dead control flow.
This pass deletes an IF/ELSE/ENDIF or IF/ENDIF sequence, or the ELSE in
an ELSE/ENDIF sequence.

In the typical case (where IF and ENDIF) aren't the only instructions in
their basic blocks, we can simply remove the instructions (implicitly
deleting the block containing only the ELSE), and attempt to merge
blocks B0 and B2 together.

B0: ...
    (+f0) if(8)
B1: else(8)
B2: endif(8)
    ...

If the IF or ENDIF instructions are the only instructions in their
respective basic blocks (which are deleted by the removal of the
instructions), we'll want to instead merge the next blocks.

Both B0 and B2 are possibly removed by the removal of if & endif.
Same situation for if/endif. E.g., in the following example we'd remove
blocks B1 and B2, and then attempt to combine B0 and B3.

B0: ...
B1: (+f0) if(8)
B2: endif(8)
B3: ...

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
9cf06e27e1 i965/cfg: Add functions to combine basic blocks.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
5e6ead5e8b i965/cfg: Point to bblock_t containing associated control flow
... rather than pointing directly to the associated instruction. This
will let us set the block containing the IF statement's else-pointer to
NULL, when we delete a useless ELSE instruction, as in the case

   (+f0) if(8)
   ...
   else(8)
   endif(8)

Also, remove the pointer to the ENDIF, since it's unused, and it was
also potentially wrong, in the case of a basic block containing both an
ENDIF and an IF instruction:

   endif(8)
   cmp.ne.f0(8) ...
   (+f0) if(8)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
2a98ebd42b i965/fs: Preserve CFG in register allocation.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
20a849b4aa i965: Use basic-block aware insertion/removal functions.
To avoid invalidating and recreating the control flow graph. Also stop
invalidating the CFG in places we didn't add or remove an instruction.

cfg calculations:     202951 -> 80307 (-60.43%)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
e0aa45768c i965: Add invalidate_cfg parameter to invalidate_live_intervals().
Will let us avoid invalidating the CFG if the optimization pass has
removed instructions using the new basic block methods.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
3d6d4dc6f7 i965: Add basic-block aware backend_instruction::insert_* methods.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:34 -07:00
Matt Turner
dc527fbf7d i965: Add a basic-block aware backend_instruction::remove method.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:33 -07:00
Matt Turner
240adc1346 i965/cfg: Add a function to remove a block from the cfg.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:33 -07:00
Matt Turner
b7d50beea4 i965/cfg: Add functions to test if a block is a successor/predecessor.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-22 10:23:33 -07:00
Eric Anholt
e51e20c35e vc4: Add support for fragment discards.
Fixes piglit glsl-fs-discard-01 and -03, and allows a lot of mesa demos to
start running.  glsl-fs-discard-02 has a problem where the first tile is
not getting stored on the first render.
2014-08-22 10:16:58 -07:00
Eric Anholt
0f894b2795 vc4: Make some helpers for setting condition codes in instructions. 2014-08-22 10:16:58 -07:00
Eric Anholt
cc68be2620 vc4: Avoid using undefined values when there's no color write.
The simulator assertion fails when you read-before-write a temporary
value, and there's no point in doing the packing if there was no color
written.
2014-08-22 10:16:58 -07:00
Eric Anholt
ae83955b1d vc4: Emit the scoreboard wait just when it's needed.
This should improve performance on real hardware by allowing more shader
instances to run in parallel.  It also fixes assertion failures in tests
that don't emit a fragment color, since otherwise we didn't have enough
instructions to fit our signals in.
2014-08-22 10:16:58 -07:00
Eric Anholt
c3c922289b vc4: Fix FLR for integer values less than 0.
If we didn't truncate at all, then we don't need to fix for truncation
happening in the wrong direction.

Fixes piglit builtin-functions/*-floor-*
2014-08-22 10:16:57 -07:00
Eric Anholt
2ab4e48f94 vc4: Fix totally broken assertions about inter-instruction reg conflicts.
The spec citation talked about A and B, and I proceeded to pay no
attention to whether the waddrs were for A or B.  As a result, this pair
of instructions would claim to conflict:

mov ra4, ra4 ; nop nop, r0, r0
mov.ns ra4, rb4 ; nop nop, r0, r0
2014-08-22 10:16:57 -07:00
Eric Anholt
b064c9103d vc4: Add support for all the texture and FBO formats we can.
Now that tiling is in place, we can expose the other formats.  Depth is
still broken (need to make changes in the shader), but if you don't expose
it things crash all over.  SNORM is dropped, but we could re-add it later
with some shader fixes to handle converting between [0,1] and [-1,1].
2014-08-22 10:16:57 -07:00
Eric Anholt
3a1efcc7f9 vc4: Add support for texture tiling.
This still treats everything as RGBA8888 for the most part, same as
before.  This is a prerequisite for handling other texture formats, since
only RGBA8888 has a raster-layout mode.
2014-08-22 10:16:57 -07:00
Eric Anholt
1b6dcaf40c vc4: Fix a typo in the validation for miplevels.
It meant that LUMALPHA was being marked as *many* miplevels, and
unsurprisingly wouldn't validate.  On the other hand, some miplevel counts
wouldn't get the small mips validated at all.
2014-08-22 10:16:57 -07:00
Eric Anholt
74ea87cde4 vc4: Convert to using an enum for texture data types 2014-08-22 10:16:57 -07:00
Eric Anholt
1cb5cfba85 vc4: Stop complaining about unknown texture channel types.
It doesn't matter to this code -- the sampler always returns 8-bit unorm
rgba.
2014-08-22 10:16:57 -07:00
Eric Anholt
b0a1e401a9 vc4: Include stdio/stdlib in headers so I don't have to include it per file.
There are a few tools I want to have always available, and fprintf() and
abort() are among them.
2014-08-22 10:16:57 -07:00
Matt Turner
d77f5603a5 i965: Fix JIP/UIP calculations.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82846
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82929
2014-08-22 09:30:03 -07:00
Aaron Watry
2a553e4dc9 st/clover: Change platform name from Default to Clover
Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-22 10:02:31 -05:00
Emil Velikov
e7f2f2dea5 dri/radeon: nuke the remaining references to sarea
Remainder of the dri1 times.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-21 21:47:44 +01:00
Emil Velikov
515ffb6c93 dri/radeon: cleanup the radeon_context vtbl
Remove the set-but-unused, and set-but-empty vtable entries.
Most likely a leftover from the dri1 days.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-21 21:47:40 +01:00
Emil Velikov
dd46f0926d include: move sarea.h next to it's only user
The header is used by DRI1 drivers, which we've removed a while
back. Now only the dri1 loader in libGL is using it, so let's
move it in src/glx, and prefix it accordingly.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-21 21:47:37 +01:00
Emil Velikov
7550a24fa6 dri/radeon: drop obsolete radeon_{dri,macros}.h headers
Both have been unused for at least a couple of years.
For example the last user of radeon_macros.h was removed with

commit 8c11f0a883
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Oct 14 13:27:02 2011 -0700

    radeon: Drop the legacy BO manager code.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-21 21:47:22 +01:00
Vinson Lee
1748ea8b2b SCons: Rename dri2_query_renderer.c to dri_common_query_renderer.c.
Fix SCons build error introduced with commit
3fe7daec14.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-08-21 12:22:18 -07:00
Connor Abbott
06ef631573 glsl/linker: pass through the is_intrinsic flag
This flag was set to true for the atomic counter intrinsics, but it
never got plumbed through the linker, so by the time it got to the
backends it would always be set to the false. The current i965 backend
code doesn't use is_intrinsic, so this should not change any existing
code, but it's useful for codepaths that want to distinguish between
intrinsics and non-intrinsics without using strcmp.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-08-21 11:46:13 -07:00
Carl Worth
619505ac7c docs: Update instructions for creating a release
This captures all of the steps I have been following in making releases for
the past year or so. This way, the instructions should be sound for anyone who
would like to take over the release process going forward.
2014-08-21 10:46:02 -07:00
Roland Scheidegger
eb4541ebaf llvmpipe: change LP_MAX_SHADER_INSTRUCTIONS definition
This change will double cache size for branches which have a lower
LP_MAX_SHADER_VARIANTS limit (it will not do anything on master).
The reason is that nowadays shaders tend to be quite a bit larger than they
were (they were big when llvmpipe didn't have a fs loop, got much smaller with
that loop, and since then have gradually increased quite a bit though still
smaller than without the fs loop for various reasons - among them being d3d10
compliance, usage of 8-wide vectors, non-swizzled blend code). Thus effectively
less shaders would be cached (unless they were very small and the variant limit
was hit first). Also, since we're getting rid of the IR nowadays, the cached
shaders shouldn't need all that much memory actually.
2014-08-21 19:00:29 +02:00
Carl Worth
399b4e2227 docs: Add my notes on stable-branch patch criteria
This captures the set of rules I have been using for stable-branch management,
(starting with a discussion on the mesa-dev mailing list on July 2013, and
then refined through my own experience of performing stable-branch releases
since then).
2014-08-21 09:46:57 -07:00
Carl Worth
46d03d37bf 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>
2014-08-21 09:05:01 -07:00
Jon TURNEY
3fe7daec14 glx: Fix build since 679c2ef "glx/drisw: add support for DRI2rendererQueryExtension", when only building drisw renderer
v2:
- Move dri*_query_renderer_* into their respective dri*_priv.h headers
- Drop then unnneeded include of dri2.h from dri2_query_renderer.c
- Rename dri2_query_renderer.c as dri_common_query_renderer.c, as it's contents
now are used for more than dri[23]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-21 16:59:48 +01:00
Carl Worth
ea565108ae Increment version to 10.4.0-devel
Now that the 10.3 branch has been created
2014-08-21 08:38:24 -07:00
Alex Deucher
153df68834 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
2014-08-21 11:16:15 -04:00
Alex Deucher
f50b6b4895 radeonsi: add new CIK pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
2014-08-21 11:13:17 -04:00
Glenn Kennard
0fb221065e r600g: Fix flat/smooth shade state toggle
If only the flat/smooth shade state changed between
two render calls the prior code would miss updating the
hardware state.

Also add check for sprite coord, potentially same type
of issue otherwise for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81967
Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-21 16:20:38 +02:00
Tom Stellard
bf7a60f41d 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>
2014-08-21 06:12:12 -07:00
Tom Stellard
a9f0b08bac r600g/compute: Use the first parameter in evergreen_set_global_binding() 2014-08-21 06:12:12 -07:00
Tom Stellard
43d954342e 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>
2014-08-21 06:12:12 -07:00
Tom Stellard
8109664ded 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>
2014-08-21 06:12:11 -07:00
Michel Dänzer
3ba225c1ab st/clover: Fix build against LLVM SVN >= r215967 v2
v2: Tom Stellard
  - Properly destroy the Module

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-21 07:55:23 -04:00
Kenneth Graunke
d682ebec0b i965,meta: Stop unlocking the texture to try and prevent deadlocks.
Unlocking the texture is not safe: another thread could come in and grab
it.  Now that we use a recursive mutex, this should work.  This also fixes
texture lock deadlocks in the new meta fast clear path.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-20 17:31:19 -07:00
Kenneth Graunke
0871028188 mesa: Use a recursive mutex for the texture lock.
This avoids problems with things like meta operations calling functions
that want to take the lock while the lock is already held.  Basically,
the point is to guard against API reentrancy across threads...not to
guard against ourselves.

Dave Airlie opposed this change, but it makes master usable again and no
one proposed a better solution.  We can revert this if/when someone
does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-20 17:31:19 -07:00
Carl Worth
f90b7e0f2b glcpp: Fix glcpp-test-cr-lf "make check" test for Mac OS X
There were two problems with the way this script used sed on OS X:

  1. The OS X sed doesn't interpret "\r" in a replacement list as a
     carriage-return character, (instead it was inserting a literal
     'r' character).

     We fix this by putting an actual ^M character into the source of
     the script, (rather than a two-character escape sequence hoping
     for sed to do the right thing).

  2. When generating the test files with LF-CR ("\n\r") newlines, the
     OS X sed was adding an undesired final newline ("\n") at the end
     of the file. We avoid this by first using sed to add the ^M
     before the newlines, then using tr to swap the \r and \n
     characters. This way, sed never sees any lines ending with
     anything but \n, so it doesn't get confused and doesn't add any
     bogus extra newlines.

Tested-by: Vinson Lee <vlee@freedesktop.org>

Vinson's testing confirmed that this patch fixes FreeBSD as well.
2014-08-20 16:42:46 -07:00
Carl Worth
c09a8b0e3b glcpp: Use printf instead of "echo -n" in glcpp-test
I noticed that with /bin/sh on Mac OS X, "echo -n" does not work as
desired, (it actually prints "-n" rather than suppressing the final
newline). There is a /bin/echo that could be used (it actually works)
instead of the builtin echo.

But I decided it's more robust to just use printf rather than
hardcoding /bin/echo into the script.
2014-08-20 16:41:38 -07:00
Matt Turner
04895f5c60 i965/vec4: Allow reswizzling writemasks when swizzle is single-valued.
total instructions in shared programs: 4288033 -> 4266151 (-0.51%)
instructions in affected programs:     930915 -> 909033 (-2.35%)
2014-08-20 13:01:18 -07:00
Jon TURNEY
bde2a62af7 Teach os_get_total_physical_memory about Cygwin
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-20 17:18:39 +01:00
Michel Dänzer
cd765cf7ee r300g: Fix path to test programs for out-of-tree builds
Fixes make check in that case.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-08-20 16:12:51 +09:00
Vinson Lee
c04a6d5c29 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>
2014-08-20 15:24:44 +09:00
Timothy Arceri
a1853eaea7 glsl: Use the without_array predicate in some more places
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-08-19 17:44:06 -07:00
Kristian Høgsberg
e6a53533b7 i965: Flush the RC and TC before doing a fast clear resolve
The docs say "When performing a render target resolve, PIPE_CONTROL with end
of pipe sync must be delivered.", which doesn't actually tell us whether we
need to do it before or after.  Blorp did it before and after, and doing it
before certainly makes sense.  The resolve operation needs to read from the
MCS and if we don't flush the render cache it won't get up-to-date data.

On the other hand, doing it after should not be necessary, since we call
brw_render_cache_set_check_flush() after the resolve.

Fixes rendering corruption in kwin's cover switch effect and various steam
games.

Missing flush spotted by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-19 17:21:39 -07:00
Carl Worth
8791cfedde docs: Import 10.2.6 release notes, add news item. 2014-08-19 15:21:09 -07:00
Chris Forbes
1c4f141a54 docs: Mark off ARB_conditional_render_inverted for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Chris Forbes
06ca96daad i965: Enable ARB_conditional_render_inverted on Gen6+.
The extension requires GL 3.0, so enable on just the generations
exposing that.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Chris Forbes
3f8ad32627 mesa: Add support for inverted s/w conditional rendering
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Matt Turner
9a071e3339 i965/vec4: Add a pass to reduce swizzles.
total instructions in shared programs: 4344280 -> 4288033 (-1.29%)
instructions in affected programs:     397468 -> 341221 (-14.15%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-19 12:37:11 -07:00
Eric Anholt
5833680e7a vc4: Plumb the texture index from TGSI through to the sampler uniforms.
This commit and the last one fix ARB_fragment_program/sparse-samplers and
6 other tests.
2014-08-19 08:47:13 -07:00
Eric Anholt
c8097afe29 vc4: Avoid a null-deref if a sampler index isn't used.
Part of fixing ARB_fragment_program/sparse-samplers
2014-08-19 08:47:13 -07:00
Brian Paul
31ce84a81f 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>
2014-08-19 09:29:16 -06:00
Glenn Kennard
dfa10ed264 r600g: Fix missing SET_TEXTURE_OFFSETS
SB needs a bit of special handling to handle
instructions without obvious side effects, to
avoid it deleting them.

Fixes failing non-const ARB_gpu_shader5
textureOffsets piglits with sb enabled.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-19 16:30:13 +02:00
Alexander von Gluck IV
ef1cf69cd3 gallium/target: Add needed mesautil lib to haiku-softpipe
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Alexander von Gluck IV
8cbf01f12a gallium/aux: Fill in Haiku get process name code
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Alexander von Gluck IV
82c23dd962 haiku/swrast: Add missing src include search path for missing util/macros.h
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Tobias Klausmann
eed8b19aac docs: Update status of ARB_conditional_render_inverted
Done for: nvc0, softpipe and llvmpipe

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
544c54114a llvmpipe/softpipe: enable ARB_conditional_render_inverted
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
a2fc85f5d0 nvc0: Handle ARB_conditional_render_inverted and enable it
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
7a48858fcb mesa/st: Support ARB_conditional_render_inverted modes
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
fd5edee700 gallium: Add and handle PIPE_CAP_CONDITIONAL_RENDER_INVERTED
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Tobias Klausmann
64cc1876fa mesa: add ARB_conditional_render_inverted flags
Also add an extension bit so we can safely enable

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Tobias Klausmann
1a51751e93 glapi: add GL_ARB_conditional_render_inverted
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Chia-I Wu
58511b62c4 ilo: fix PIPE_CAP_VIDEO_MEMORY
I changed Emil's patch in f921131a5c to report
raw values in the winsys, but forgot to convert the values to megabytes in the
pipe driver.
2014-08-19 19:56:07 +08:00
Chia-I Wu
17401896dd ilo: enable HiZ in more cases on GEN6
With layer offsetting killed, we no longer need to restrict HiZ to
non-mipmapped and non-arary depth buffers.
2014-08-19 19:53:37 +08:00
Chia-I Wu
5b4fc5f156 ilo: remove layer offsetting
Follow i965 to kill layer offsetting for GEN6.
2014-08-19 19:53:37 +08:00
Chia-I Wu
fb3d506431 ilo: migrate to ilo_layout
Embed an ilo_layout in ilo_texture, and remove now duplicated members.
2014-08-19 19:53:37 +08:00
Chia-I Wu
925359bc78 ilo: add new resource layout code
Based on the old code, the new layout code describes the layout with the new,
well-documented, ilo_layout.  It also gains new features such as MCS support
and extended ARYSPC_LOD0 that i965 comes up with (see
6345a94a9b).
2014-08-19 19:53:37 +08:00
Niels Ole Salscheider
5ae9bdafd4 gallium/radeon: Do not use u_upload_mgr for buffer downloads
Instead create a staging texture with pipe_buffer_create and
PIPE_USAGE_STAGING.

u_upload_mgr sets the usage of its staging buffer to PIPE_USAGE_STREAM.
But since 150ac07b85 CPU -> GPU streaming buffers
are created in VRAM. Therefore the staging texture (in VRAM) does not offer any
performance improvements for buffer downloads.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-19 12:56:04 +02:00
Marek Olšák
498dc676ea r600g: copy IA_MULTI_VGT_PARAM programming from radeonsi for Cayman
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
f62f88274a radeonsi: bump PRIMGROUP_SIZE for some cases
Recommended by hw people.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
4be7ff5567 radeonsi: set PARTIAL_VS_WAVE(0) when appropriate
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
94e474f3c3 radeonsi: set IA_MULTI_VGT_PARAM on SI the same as on CIK (v2)
Nothing's changed for CIK here.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
a333309979 radeonsi: simplify si_num_banks function
This makes it easier to use.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
db51ab6d6a radeonsi: use r600_draw_rectangle from r600g
Rectangles are easier than triangles for the rasterizer.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
7792f9858b 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>
2014-08-19 12:20:18 +02:00
Marek Olšák
25633c85e1 radeonsi: don't set CB_SHADER_MASK=1 if there are no color outputs
This hack isn't needed anymore because of the previous u_blitter commit.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
a6fcdbf560 gallium/u_blitter: don't use an empty fragment shader if there's a colorbuffer
This is custom code used by some drivers.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
406ab1662c gallium/util: handle PIPE_BUFFER in util_pipe_tex_to_tgsi_tex
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
8db7dacf29 rbug: only add textures to the list
rbug-gui cannot display buffers, so it's pointless to add them.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
ddcbe9c526 rbug: fix a crash in sampler_view_destroy caused by incorrect context
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
ba81a3784b rbug: send the actual number of layers to the client
This sends the correct value for array textures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
90d10f467f rbug: implement streamout context functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
b7b1ad9c6c rbug: fix crash in set_vertex_buffers
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:17 +02:00
Marek Olšák
4a3f156dd1 rbug: remove contexts from the list properly
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:17 +02:00
Emil Velikov
f921131a5c ilo: fold drm_intel_get_aperture_sizes() within probe_winsys()
... and store the value in intel_winsys_info/ilo_dev_info.

Suggested-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

olv: check for errors and report raw values
2014-08-19 17:45:00 +08:00
Matt Turner
a4359bcaa5 i965/cfg: Add a foreach_block_and_inst_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:08:53 -07:00
Matt Turner
26624b85e7 i965/cfg: Add a foreach_inst_in_block_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
c51b0861e4 i965/cfg: Add a foreach_block_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
a3d0ccb037 i965: Pass a cfg pointer to generate_{code,assembly}.
The loop over all instructions is now two-fold, over all of the blocks
and all of the instructions in each block.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
596990d91e i965: Add and use foreach_block macro.
Use this as an opportunity to rename 'block_num' to 'num'. block->num is
clear, and block->block_num has always been redundant.
2014-08-18 18:56:30 -07:00
Matt Turner
d688667c7f i965/cfg: Embed link in bblock_t for main block list.
The next patch adds a foreach_block (block, cfg) macro, which works
better if it provides a direct bblock_t pointer, rather than a
bblock_link pointer that you have to use to find the actual block.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 18:56:30 -07:00
Matt Turner
19c6617adf i965/fs: Optimize gl_FrontFacing calculation on Gen4/5.
Doesn't use fewer instructions, but it does avoid writing the flag
register and if we want to switch the representation of true for Gen4/5
in the future, we can just delete the AND instruction.
2014-08-18 18:35:56 -07:00
Matt Turner
d1c43ed487 i965/fs: Optimize gl_FrontFacing calculation on Gen6+.
total instructions in shared programs: 4288650 -> 4282838 (-0.14%)
instructions in affected programs:     595018 -> 589206 (-0.98%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:54 -07:00
Matt Turner
2e51dc838b i965: Use ~0 to represent true on Gen >= 6.
total instructions in shared programs: 4292303 -> 4288650 (-0.09%)
instructions in affected programs:     299670 -> 296017 (-1.22%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:53 -07:00
Matt Turner
cc60a487d1 i965/fs: Optimize emit_bool_to_cond_code for logical exprs.
AND, OR, and XOR can generate the conditional code directly.

total instructions in shared programs: 4293335 -> 4292303 (-0.02%)
instructions in affected programs:     121408 -> 120376 (-0.85%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:53 -07:00
Matt Turner
2a6b6621d8 i965: Use UniformBooleanTrue value for boolean literal true.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:49 -07:00
Matt Turner
9e2e7c7dc0 glsl: Use UniformBooleanTrue value for uniform initializers.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:48 -07:00
Matt Turner
6df0fd8fe9 mesa: Upload boolean uniforms using UniformBooleanTrue.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:47 -07:00
Matt Turner
e0f955abd3 i965: Remove dead call to _mesa_associate_uniform_storage().
Dead since the call to _mesa_generate_parameters_list_for_uniforms
was removed in commit 12751ef2. So this was why all of that code that
was supposed to fix up the value of a uniform bool to wasn't happening.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:41 -07:00
Matt Turner
e87106d153 mapi: Inline shared-glapi/tests/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:27:20 -07:00
Matt Turner
7172f02d7c mapi: Inline glapi/tests/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:27:16 -07:00
Matt Turner
9dbb0f49b6 mapi: Inline glapi/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:52 -07:00
Matt Turner
dff5a219d0 mapi: Inline es2api/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:29 -07:00
Matt Turner
18ef5136b6 mapi: Inline es1api/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:02 -07:00
Matt Turner
c3ce1a942f mapi: Inline shared-glapi/Makefile. 2014-08-18 18:24:09 -07:00
Matt Turner
4ccd2a9f9b build: Let install-lib-links.mk handle .la files in subdirectories.
The next patches are going to combine some of the mapi subdirectories'
Makefiles into a single Makefile, giving better build parallelism.

lib_LTLIBRARIES will be set to something like

   lib_LTLIBRARIES = shared-glapi/libglapi.la es2api/libGLESv2.la

and the current code in install-lib-links.mk simply prepends .libs/ and
replaces the .la in order to create the filenames that it needs to ln/cp
into the LIBDIR. This doesn't work when the .la file is actually in a
subdirectory.

This patch fixes this and puts .libs/ in the right place.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-18 18:22:40 -07:00
Matt Turner
45eb065668 i965: Enable instruction compaction on Gen8+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
31eed95b22 i965: Add support for compacting 3-src instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
fb1db6753f i965: Add support for compacting 1- and 2-src instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
3904d404a3 i965/gen8: Add 3-src instruction compaction tables.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
190ce6b093 i965/gen8: Add instruction compaction tables.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
2faa1a414c i965: Update JIP/UIP compaction code to operate on bytes.
JIP/UIP were previously in units of compacted instructions. On Gen8
they're in units of bytes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
23ab55cb6c i965: Reverse condition ordering to let us support other gens.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
6cc6c3b647 i965/disasm: Add CSEL. 2014-08-18 18:18:50 -07:00
Timothy Arceri
39a920c0cb mesa: fix copy and paste errors in glBindVertexBuffers
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-08-19 10:19:18 +10:00
Tobias Klausmann
9100c359ac nv50/ir: (trivial) initialize pointer to silence warning
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-18 19:41:26 -04:00
Eric Anholt
76f687d5a5 vc4: Add support for swizzling of texture colors.
Fixes swapped colors on the copypix demo and some piglit tests like
pbo-teximage-tiling .
2014-08-18 15:27:43 -07:00
Eric Anholt
489350e570 vc4: Fix handling of non-XYZW swizzles in color outputs.
The SWIZZLE_1 of the winsys destination was dereffing off the end of the
array, which surprisingly often worked out (since nobody reads the
rendered value anyway, so whatever junk was referenced in the QIR didn't
matter), but shader dumping would sometimes segfault.
2014-08-18 15:27:43 -07:00
Eric Anholt
37992a4e39 vc4: Extract the swizzle handling from vertex fetch.
I want to reuse this elsewhere, and NONE debug output hasn't been useful
so I don't miss it being as detailed as it was before.
2014-08-18 15:27:43 -07:00
Eric Anholt
c1db622215 vc4: Add support for color masking.
This gets fbo-colormask-formats working for core formats, which increases
my confidence in some of the swizzle and blend handling.
2014-08-18 15:27:43 -07:00
Eric Anholt
50b4293eb3 vc4: Add a helper for QOP_R4_UNPACK_[ABCD]. 2014-08-18 15:27:43 -07:00
Eric Anholt
8795341e2c vc4: Don't forget to set up the offset for render targets.
This almost fixes fbo-generatemipmap rendering, except that the 1x1 level
isn't getting rendered.
2014-08-18 15:27:43 -07:00
Eric Anholt
63fe494877 vc4: Fix multi-level texture setup.
We weren't accounting for the level 0 offset in the texture setup (so it
only worked if it happened to be a single-level texture), and doing so
required that we get the level 0 offset page aligned so that the offset
bits don't get interpreted as the texture format and such.
2014-08-18 15:27:43 -07:00
Eric Anholt
a538bab065 vc4: Fix viewport handling in the uniforms upload.
I had the right viewports in vc4_emit.c, but grabbed the wrong values in
the uniform setup, so primitives would claim to be in the wrong parts of
the screen.  (The vc4_emit.c state looks like it just decides how big the
clipping guardband is).

This gets fbo-viewport closer to working (which still has the problem that
the HW is always guard-band clipping), and fixes inverted FBO rendering in
general.
2014-08-18 15:27:43 -07:00
Marek Olšák
082d8c54c1 docs/relnotes: document GLX_MESA_query_renderer 2014-08-19 00:26:41 +02:00
Francisco Jerez
e9a4e74926 clover: Refuse to build a program if there are kernel objects attached to it.
Fixes piglit cl-api-build-program.

Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
Francisco Jerez
c6817f19f6 clover/util: Pass initial count value to ref_counter constructor.
And mark the ref_count() method as const.

Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
Francisco Jerez
37e4d22e95 clover/util: Implement minimalist reference to clover::ref_counter object.
Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
EdB
ce4d3f3104 clover: clGetProgramInfo support for OpenCL 1.2.
[ Francisco Jerez: Rework using fold() for conciseness. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-17 23:34:11 +03:00
Ilia Mirkin
ef130b6050 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>
2014-08-16 17:52:54 -04:00
Ilia Mirkin
1f4bc0c95e egl: don't exit process on initialization failure
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-16 17:52:54 -04:00
Brian Paul
9d9879abed mesa: fix compressed_subtexture_error_check() return value
The function should return GLboolean, not GLenum.
If we detect invalid compressed pixel storage parameters, we should
return GL_TRUE, not GL_FALSE so that the function is no-op'd.
An update to the piglit s3tc-errors test will check this.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:45 -06:00
Brian Paul
cf8b680f40 mesa: move _mesa_compressed_texture_pixel_storage_error_check()
to pixelstore.c, add const qualifier to the 'packing' parameter.
Add comments.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:44 -06:00
Brian Paul
9b4c6da7f0 mesa: minor improvements to _mesa_compute_compressed_pixelstore()
Replace the gl_texture_image parameter with mesa_format since we only
used the image's format.

Add some comments.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:44 -06:00
Brian Paul
1e594d4f5c util: whitespace and formatting fixes in u_math.h
Trivial.
2014-08-16 06:48:44 -06:00
Ilia Mirkin
8867ffbf95 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>
2014-08-16 02:33:12 -04:00
Jordan Justen
a1dca7069b i965/gen6: Force ALL_SLICES_AT_EACH_LOD for separate stencil/hiz
For gen6 we will use the ALL_SLICES_AT_EACH_LOD miptree layout for
separate stencil/hiz. This is needed because gen6 hiz and separate
stencil only support a single miplevel. When accessing the other LODs,
we will program a tile aligned offset for the bo.

PRM Volume 1, Part 1, 7.18.3.7.2 For separate stencil buffer [DevILK]
to [DevSNB]:
 "The separate stencil buffer does not support mip mapping, thus the
  storage for LODs other than LOD 0 is not needed."

We still allocate storage for the other stencil mip-levels within a
single texture, but each mip-level will use non-mip-array spacing.

PRM Volume 2, Part 1, 7.5.3 Hierarchical Depth Buffer
 "[DevSNB]: The hierarchical depth buffer does not support the LOD
  field, it is assumed by hardware to be zero. A separate
  hierarachical depth buffer is required for each LOD used, and the
  corresponding buffer’s state delivered to hardware each time a new
  depth buffer state with modified LOD is delivered."

We allocate storage for the other hiz mip-levels within a single
texture, but each mip-level will use non-mip-array spacing.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
31e1beec89 i965/gen6: Stencil/hiz needs an offset for LOD > 0
Since gen6 separate stencil & hiz only supports LOD0, we need to
program an offset to the LOD when emitting the separate stencil/hiz.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
b3d68d5a30 i965/gen6: Force tile alignment for each stencil/hiz LOD
Gen6 doesn't support multiple miplevels for hiz and stencil.

Therefore, we must point to the LOD directly during rendering.

But, we also have removed the tile offsets from normal depth surfaces,
so we need to align each LOD to a tile boundary for hiz and stencil.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
6345a94a9b i965: Support array_layout == ALL_SLICES_AT_EACH_LOD for multiple LODs
Previously array_layout ALL_SLICES_AT_EACH_LOD was only used for array
spacing lod0 on gen7+ and therefore was only used with a single mip
level.

gen6 separate stencil & hiz only support LOD0, so we need to allocate
the miptree similar to gen7+ array spacing lod0, except we also need
space for multiple mip levels. (Since OpenGL stencil and depth support
multiple LODs.)

The miptree is allocated with tightly packed array slice spacing, but
we still also pack the miplevels into the region similar to a normal
multi mip level packing.

A 2D Array texture with 2 slices and multiple LODs would look somewhat
like this:

+----------+
|          |
|          |
+----------+
|          |
|          |
+----------+
+---+ +-+
|   | +-+
+---+ +-+
|   | :
+---+

v3:
 * Use new array_layout enum
 * ASCII art!

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
27f5fa7a37 i965: Allow forcing miptree->array_layout = ALL_SLICES_AT_EACH_LOD
gen6 does not support multiple miplevels with separate
stencil/hiz. Therefore we need to layout its miptree with no mipmap
spacing between the slices of each miplevel.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
7e856d0b18 i965: Change mipmap array_spacing_lod0 to array_layout (enum)
We will want to setup gen6 separate stencil and hiz miptrees in a
layout that is similar to array_spacing_lod0. This is needed because
gen6 hiz and stencil only support a single mip-level.

In both use cases (gen7+ LOD0 spacing & gen6 separate stencil/hiz),
the array slices will be packed at each LOD without reserving extra
space for LODs within each array slice.

So, we generalize the name of this field and add comments to indicate
the old and new uses.

Motivation for the gen6 change comes from the PRM:

PRM Volume 1, Part 1, 7.18.3.7.2 For separate stencil buffer [DevILK]
to [DevSNB]:
 "The separate stencil buffer does not support mip mapping, thus the
  storage for LODs other than LOD 0 is not needed."

PRM Volume 2, Part 1, 7.5.3 Hierarchical Depth Buffer
 "[DevSNB]: The hierarchical depth buffer does not support the LOD
  field, it is assumed by hardware to be zero. A separate
  hierarachical depth buffer is required for each LOD used, and the
  corresponding buffer’s state delivered to hardware each time a new
  depth buffer state with modified LOD is delivered."

v2:
 * Rename array_spacing_lod0 to non_mip_arrays
v3:
 * Instead, replace array_spacing_lod0 with array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
56cdb55e38 i965/gen6 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surface
(bf25ee2 for gen6)

Previously we would always find the 2D sub-surface of interest,
and then program the surface to this location. Now we always
program the 3DSTATE_DEPTH_BUFFER at the start of the surface.
To select the lod/slice, we utilize the lod & minimum array
element fields.

We also must disable brw_workaround_depthstencil_alignment for
gen >= 6. Now the hardware will handle alignment when rendering
to additional slices/LODs.

v3:
 * Set depth_mt bo RELOC offset to 0, as was done in bf25ee2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56127
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
3da13aef01 i965/gen6 fbo: make unmatched depth/stencil configs return unsupported
(f3c886b for gen6)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
96306a6cbb i965/gen6 blorp depth: calculate base surface width/height
(e3a49e1 for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
039eb81abf i965/gen6 depth surface: calculate minimum array element being rendered
(a23cfb8 for gen6)

In layered rendering this will be 0. Otherwise it will be the
selected slice.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
cfa19af966 i965/gen6 depth surface: calculate LOD being rendered to
(08ef1dd for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
51b38106d7 i965/gen6 depth surface: calculate depth (array size) for depth surface
(bc1acaa for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Note: Cube maps are treated as 2D arrays with 6 times as
many array elements as the cube map array would have.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
48acf19d23 i965/gen6 depth surface: calculate more specific surface type
(171e633 for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Note: Cube maps are treated as 2D arrays with 6 times as
many array elements as the cube map array would have.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
11663050eb i965/gen6_depth_state.c: Remove (gen != 6) code paths
Since this code was branched from brw_misc_state.c, it had support for
gen != 6. We can now remove this.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
39a5b69985 i965: Split gen6 depth hiz state out from brw
We will program the gen6 hiz depth state differently to enable layered
rendering on gen6.

v2:
 * Remove unneeded gen6_emit_depthbuffer as suggested by Topi

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:40 -07:00
Jordan Justen
341995e4b5 i965/gen6: Adjust render height in errata case for MSAA
In the gen6 PRM Volume 1 Part 1: Graphics Core, Section
7.18.3.7.1 (Surface Arrays For all surfaces other than separate
stencil buffer):

 "[DevSNB] Errata: Sampler MSAA Qpitch will be 4 greater than the
  value calculated in the equation above , for every other odd Surface
  Height starting from 1 i.e. 1,5,9,13"

Since this Qpitch errata only impacts the sampler, we have to adjust
the input for the rendering surface to achieve the same qpitch. For
the affected heights, we increment the height by 1 for the rendering
surface.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:40 -07:00
Jordan Justen
f063712373 i965/gen6: Add support for layered renderbuffers
Rather than pointing the surface_state directly at a single
sub-image of the texture for rendering, we now point the
surface_state at the top level of the texture, and configure
the surface_state as needed based on this.

v2:
 * Use SET_FIELD as suggested by Topi
 * Simplify min_array_element assignment as suggested by Topi
v3:
 * Use irb->layer_count for depth instead of rb->Depth
 * Make gl_target const
 * depth - 1, not depth
v4:
 * Merge in dd43900b & b875f39e fixes to prevent 3D texture piglit
   regressions

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:04 -07:00
Jordan Justen
89b1f5d6ac i965/gen6_surface_state.c: Remove (gen < 6) code path
Since this code was branched from brw_wm_surface_state.c, it had
support for gen < 6. We can now remove this.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 17:19:20 -07:00
Jordan Justen
1f8e0fbd38 i965: Split gen6 renderbuffer surface state from gen5 and older
We will program the gen6 renderbuffer surface state differently to
enable layered rendering on gen6.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 17:19:20 -07:00
Kenneth Graunke
2d1735187d meta: Use instanced rendering for layered clears.
Layered rendering is part of OpenGL 3.2; GL_ARB_draw_instanced is part
of OpenGL 3.1.  As such, all drivers supporting layered rendering
already support gl_InstanceID.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-15 16:53:48 -07:00
Kenneth Graunke
ed6a4d6a7d mesa: Expose vbo_exec_DrawArraysInstanced as _mesa_DrawArraysInstanced.
So we can use it in meta.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-15 16:53:48 -07:00
Dave Airlie
e2594ee882 Revert "hud: don't overrun malloced arrays"
This reverts commit 1cfcd0164e.

This seems to cause r600g lockups,
https://bugs.freedesktop.org/show_bug.cgi?id=82628

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-16 09:15:19 +10:00
Kristian Høgsberg
14c1a2a94c i965: Guard access to gl_Layer by extension #ifdef
Only assign gl_Layer if we have GL_AMD_vertex_shader_layer.  Gen6 doesn't
(currently) have that extension, but it also doesn't support layered
rendering.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
2014-08-15 16:09:11 -07:00
Emil Velikov
1e1d285701 gallium/vc4: PIPE_CAP_VIDEO_MEMORY return the amount of system ram
Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-15 23:42:10 +01:00
Eric Anholt
7c65b714ed vc4: Add support for blending.
Passes blendminmax and blendsquare.  glean's more serious blendFunc fails
in simulation due to binner memory overflow (I really need to work around
that), and fbo-blending-formats fails due to Mesa refusing one of the
getter requests, even before it could fail due to the driver not actually
supporting different formats yet.
2014-08-15 12:01:32 -07:00
Eric Anholt
f663102585 vc4: Drop incorrect attempt to incorrectly invert the primconvert hw_mask.
The hw_mask is the set of primitives you actually support, so this attempt
to provide the set of formats that's unsupported was wrong in two ways (it
was intended to be '~' not '!').  However, we only call this code when
prim isn't one of the actually supported hw_mask bits, so missing out on
the memcpy didn't matter anyway.
2014-08-15 12:01:32 -07:00
Eric Anholt
a8f16054ca vc4: Use cl_f() instead of cl_u32(fui()) 2014-08-15 12:01:32 -07:00
Eric Anholt
e6fe6d0694 vc4: Consistently use qir_uniform_f(). 2014-08-15 12:01:32 -07:00
Eric Anholt
ba875b3a0d vc4: Consume the implicit varyings for points and lines.
We were triggering simulator assertion failures for not consuming these,
and presumably we want to actually make use of them some day (for things
like point/line antialiasing)

Note that this has the qreg index as 0, which is the same index as the
first GL varyings read.  This doesn't matter currently, since that number
isn't used for anything except dumping.
2014-08-15 12:00:32 -07:00
Eric Anholt
64ad96a9f4 vc4: Move the deref of the color buffer for simulator into the simulator.
At some point I'm going to want to move the information necessary for the
host buffer upload/download into the BO so that it's independent of the
current vc4->framebuffer, but for now this fixes pointless derefs on
non-simulator in vc4_context.c since the dump_fbo() removal
2014-08-15 11:52:18 -07:00
Kristian Høgsberg
2f28a0dc23 i965: Implement fast color clears using meta operations
This patch uses the infrastructure put in place by previous patches
to implement fast color clears and replicated color clears in terms of
meta operations.

This works all the way back to gen7 where fast clear was introduced and
adds support for fast clear on gen8.  It replaces the blorp path
completely and improves on a few cases.  Layered clears are now done
using instanced rendering and multiple render-target clears use a
MRT shader with rep16 writes.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
f9dc7aabb3 i965: Add optimization pass to let us use the replicate data message
The data port has a SIMD16 'replicate data' message, which lets us write
the same color for all 16 pixels by sending the four floats in the
lower half of a register instead of sending 4 times 16 identical
component values in 8 registers.

The message comes with a lot of restrictions and could be made generally
useful by recognizing when those restriction are satisfied.  For now,
this lets us enable the optimization when we know it's safe, but we don't
enable it by default.  The optimization works for simple color clear shaders
only, but does recognized and support multiple render targets.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
ba4507576c meta: Export _mesa_meta_drawbuffers_from_bitfield()
We'll use this in the i965 fast clear implementation.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
5fad83bdf8 mesa: Use _mesa_lock_context_textures in _mesa_GetTexParameterfv()
GetTexParamterfv() doesnt change texture state, so instead of
_mesa_lock_texture() we can use _mesa_lock_context_textures(),
which doesn't increase the texture stamp.  With this change,
_mesa_update_state_locked() is now only called from under
_mesa_lock_context_textures(), which is right thing to do.  Right now
it's the same mutex, but if we made texture locking more fine grained
locking one day, just locking one texture here would be wrong.

This all ignores the fact that texture locking seem a bit
flaky and broken, but we're trying to not blatantly make it worse.

This change allows us to reliably unlock the context textures in the
dd::UpdateState callback as is necessary for meta color resolves.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:25 -07:00
Kristian Høgsberg
388f02729b i965: Move pre-draw resolve buffers to dd::UpdateState
No functional change except for glBegin/glEnd style rendering, where we now
do the resolves at glBegin time instead of FLUSH_VERTICES time.  This is also
the reason for this change, so that when we later switch fast clear resolve to
use meta, we won't be doing meta operations in the middle of a begin/end
sequence.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
cf89b29d2f i965: Provide a context flag to let us enable fast clear
GEN7+ has the fast clear functionality, which lets us clear the color
buffers using the MCS and a scaled down rectangle.  To enable this
we have to set the appropriate bits in the 3DSTATE_PS package.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
1a05dcb349 i965: Disable clipping when rendering 3DPRIM_RECTLIST primitives
The clipper doesn't support clipping 3DPRIM_RECTLIST primitives and must
be turned off when we use them.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
3f0f2c7f7d i965: Add a mechanism for sending native primitives into the driver
The brw_draw_prims() function is the draw entry point into the driver,
and takes struct _mesa_prim for input.  We want to be able to feed
native primitives into the driver, and to that end we introduce
BRW_PRIM_OFFSET, which lets use describe geometry using the native
GEN primitive types.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
ff7a2fc322 i965: Add context flag to disable the viewport transform
This lets us disable the viewport transform, which will be useful for
emitting 3DPRIM_RECTLIST.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
1effbf6898 i965: Add an option to not generate the SIMD8 fragment shader
For now, this can only be triggered with a new 'no8' INTEL_DEBUG option
and a new context flag.  We'll use the context flag later, but introducing
it now lets us bisect to this commit if it breaks something.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Emil Velikov
0267c6d7ee docs/autoconf: explicitly mention PKG_CONFIG_PATH for cross/multilib builds
... and squash a couple of typos.

Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 18:00:37 +01:00
Emil Velikov
5fe400d82a st/dri: Add __DRI2rendererQueryExtension support
The final step to get GLX_MESA_query_renderer working with gallium
drivers.

v2: Remove __DRI2_RENDERER_PREFERRED_PROFILE handling. It's already
handled in dri/common. Spotted by Marek.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
89f80c2185 gallium/softpipe/llvmpipe: handle query_renderer caps
Both report 0xffffffff as both vendor and device id, and the maximum
amount of system memory as video memory.

v2: Use aux helper os_get_total_physical_memory().

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
3a6b68b113 gallium/svga: handle query_rendered caps
All the values are are currently hardcoded. One could use
some heuristics to determine the amount of video memory if
a callback to the host is not available.

Do we what to advertise the driver as hardwar accelerated ?

Cc: Brian Paul <brianp@vmware.com>
Cc: José Fonseca <jose.r.fonseca@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
2b5f3956be gallium/nouveau: handle query_renderer caps
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
0b67d5d4ce gallium/vc4: handle query_renderer caps
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
de01443753 gallium/r300/r600/radeonsi: handle query_renderer caps
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
cc313b3ffe gallium/ilo: handle query_renderer caps
Implementation based on the classic driver with the following
changes:
 - Use auxiliarry function os_get_total_physical_memory to get the
total amount of memory.
 - Move the libdrm_intel specific get_aperture_size to the winsys.

Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
5b9cb13295 gallium/i915: handle query_renderer caps
Implementation based on the classic driver with the following
changes:
 - Use auxiliarry function os_get_total_physical_memory to get the
total amount of memory.
 - Move the libdrm_intel specific get_aperture_size to the winsys.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:46 +01:00
Emil Velikov
e9c43b1f01 gallium/freedreno: handle query_renderer caps
Provide the real vendor and and hardcode the device id as
0xffffffff as the devices currently using freedreno are non-pci.
The device features UMA.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-08-15 17:42:43 +01:00
Emil Velikov
8d2745703c auxiliary/os: introduce os_get_total_physical_memory helper function
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:41:57 +01:00
Emil Velikov
139751403c gallium: add GLX_MESA_query_renderer caps
Namely vendor/device id, accelerated and UMA, which will be used to describe
the underlying renderer.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:41:34 +01:00
Emil Velikov
64b1dc4449 dri/swrast: add GLX_MESA_query_renderer support
v2:
 - Drop __DRI2_RENDERER_PREFERRED_PROFILE case.
 - Cleanup return statements.

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:38 +01:00
Emil Velikov
9c65361457 dri/radeon: add GLX_MESA_query_renderer support
- Create radeon{Vendor,GetRenderer}String helpers.
 - Drop __DRI2_RENDERER_PREFERRED_PROFILE case.
 - Cleanup return statements.

To be used by the upcomming GLX_MESA_query_renderer implementation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:38 +01:00
Emil Velikov
55d1251d41 dri/radeon: don't print TCL status on glGetString(GL_RENDERER)
Printing the TCL involves that context is available at the time of
query. The GLX_MESA_query_renderer states that glGetString(GL_RENDERER)
and glXQueryRendererStringMESA(GLX_RENDERER_DEVICE_ID_MESA) will have
the same format, thus removing the context dependenicy will help us
achieve that.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
76f07362ea dri/nouveau: add GLX_MESA_query_renderer support
- Create nouveau_{vendor,get_renderer}_string helpers.
 - Set correct max_gl*version.
 - Query the device PCIID via libdrm_nouveau/nouveau_getparam.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
87d3ae0b45 dri/common: Move __DRI2_RENDERER_PREFFERED_PROFILE handling to driQueryRendererIntegerCommon
Essentially all drivers would like to use to opengl core profile if
available, so avoid duplication by moving the code to a common fallback
within driQueryRendererIntegerCommon.

If a driver uses different approach they can handle it separately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
679c2ef8a0 glx/drisw: add support for DRI2rendererQueryExtension
The extension is used by GLX_MESA_query_renderer, which
can be provided for by hardware and software drivers.

v2: Use designated initializers.
v3: Move drisw_query_renderer_*() to dri2_query_renderer.c

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
1bccf99c30 glx/dri2: use mapping table for dri2_convert_glx_query_renderer_attribs()
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
d10ba8b7c0 glx/drisw: Move private structure declarations to a header file
v2: Reff the correct file wrt copyright, spotted by Chia-I

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:36 +01:00
Brian Paul
ffb8e884f7 mesa: check if GL_ARB_copy_image is enabled in _mesa_CopyImageSubData()
Generate a GL error and return rather than crashing on a null
ctx->Driver.CopyImageSubData pointer (gallium).  This allows apitraces
with glCopyImageSubData() calls to continue rather than crash.

Plus, fix a comment typo.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-15 08:35:17 -06:00
Neil Roberts
aa9d4f9d1a i965/blorp_clear: Use memcpy instead of assignment to copy clear value
Similar to the problem described in 2c50212b14, if we copy the clear
value through a regular assignment via a floating point value, then if an
integer clear value is being used that happens to contain a signalling NaN
value then it would get converted to a quiet NaN when stored via the x87
floating-point registers. This would corrupt the integer value. Instead we
should use a memcpy to ensure the exact bit representation is preserved.

This bug can be triggered on 32-bit builds with optimisations by using an
integer clear color with a value like 0x7f817f81.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 12:35:40 +01:00
Glenn Kennard
afa7df9b78 r600g: Implement ARB_derivative_control
Requires Evergreen/Cayman

marek: update release notes

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 12:23:06 +02:00
Chris Forbes
f1370fed2c docs: Update relnotes for ARB_gpu_shader5
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:25:10 +12:00
Chris Forbes
139f127aac docs: Mark off ARB_gpu_shader5 for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:25:07 +12:00
Chris Forbes
4a3667993e i965: Enable ARB_gpu_shader5 on Gen7
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:24:56 +12:00
Chris Forbes
abedd05bcd i965/fs: Add support for nonconst sampler indexing in FS visitor
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:33 +12:00
Chris Forbes
fbfcd671a1 i965/fs: Add support for non-const sampler indices in generator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
4ba5171f30 i965/fs: Refactor generate_tex in prep for nonconst sampler indexing
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
2b1204aa96 i965/fs: Use brw_adjust_sampler_state_pointer in fs generator too
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
2cd6169e92 i965/vec4: Add support for nonconst sampler indexing in VS visitor
V2: Set force_writemask_all on ADD; this *is* necessary in the VS case
too.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:12:45 +12:00
Chris Forbes
301b71557b i965/vec4: Add support for non-const sampler indices in generator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:32 +12:00
Chris Forbes
86dc34a0b0 i965: Generalize sampler state pointer mangling for non-const
For now, assume that the addressed sampler can be in any of the
16-sampler banks. If we preserved range information this far, we
could avoid emitting these instructions if the sampler were known
to be contained within one bank.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:29 +12:00
Chris Forbes
f7146d1a94 i965/vec4: Refactor generate_tex in prep for non-const samplers
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:28 +12:00
Chris Forbes
8ce3fa8e91 i965: Extract helper function for surface state pointer adjustment
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:19 +12:00
Chris Forbes
ceaf823e23 docs: Mark off ARB_gpu_shader5 UBO array indexing for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
70354ca668 i965/vec4: Add visitor support for nonconst ubo block indexing
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
a55eae9b6d i965/vec4: Generate indirect sends for nonconstant UBO array access
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
ad9fce6811 i965/fs: Add visitor support for nonconstant UBO indices
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
3fd359b10d i965/fs: Generate indirect sends for nonconstant UBO array accesses
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Chris Forbes
17e0fa9a06 i965: Adjust set_message_descriptor to handle non-sends
We're about to be using this infrastructure to build descriptors in
src1 of non-send instructions, when preparing to do an indirect send.

Don't accidentally clobber the conditionalmod field of those
instructions with SFID bits, which aren't part of the descriptor.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Chris Forbes
3512c79789 i965: Add low-level support for indirect sends
This provides a reasonable place to enforce the hardware restriction
that indirect descriptors must be in a0.0

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Kenneth Graunke
35ca288165 i965/fs: Add pass to rename registers to break live ranges.
The pass breaks live ranges of virtual registers by allocating new
registers when it sees an assignment to a virtual GRF it's already seen
written.

total instructions in shared programs: 4337879 -> 4335014 (-0.07%)
instructions in affected programs:     343865 -> 341000 (-0.83%)
GAINED:                                46
LOST:                                  1

[mattst88]: Make pass not break in presence of control flow.
            invalidate_live_intervals() only if progress.
            Fix up delta_x/delta_y.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-14 23:50:12 -07:00
Kenneth Graunke
650c331378 i965: Fix INTDIV math assertions on Broadwell.
Commit c66d928f2c ("i965: Enable INTDIV
in SIMD16 mode.") began using generate_math_gen6 to break SIMD16 INTDIV
into two SIMD8 operations.

generate_math_gen6 takes two registers - for unary operations, we pass
ARF null for the second operand.  Prior to Broadwell, real operands were
always GRF.  But now they can be IMM as well.

So, check for != ARF instead of == GRF.

+12 piglits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 23:21:34 -07:00
Kenneth Graunke
e84e074248 Revert "i965/vec4: Use MOV, not OR, to set URB write channel mask bits."
This reverts commit af13cf609f, which
appears to cause huge performance problems on Ivybridge.  I'd missed
that the FFTID bits are in the low byte.  The documentation doesn't
indicate that the URB write message header actually wants FFTID - it
just labels those bits as "Reserved."  But it appears necessary.

This does slightly more than revert the original change: originally,
Broadwell had separate code generation, which used MOV, and this patch
only changed it for Gen4-7.  Now that both are unified, reverting this
also makes Broadwell use OR.  Which should be fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 23:21:28 -07:00
Chris Forbes
417cc8b2c8 docs: Mark off ARB_derivative_control for i965.
Also update 10.3 relnotes to match.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:09 +12:00
Chris Forbes
654b7788eb i965: Enable ARB_derivative_control on Gen7+.
The extension says GL 4.0 is required. We'll meet the spirit
of that restriction by enabling on just those generations which will
soon support GL 4.0 (Gen7+), although it's technically supportable on
all generations.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:06 +12:00
Chris Forbes
a396224520 i965/fs: Support fine/coarse derivative opcodes
The quality level (fine/coarse/dont-care) is plumbed through to the
generator as a constant in src1.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:04 +12:00
Chris Forbes
587e6e7898 i965/vec4: Assert that fine/coarse derivative ops don't appear
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:03 +12:00
Chris Forbes
eba0c54f62 glsl: Mark program as using dFdy if coarse/fine variant is used
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:03:53 +12:00
Ilia Mirkin
f08d7b8fe1 nv50,nvc0: add support for fine derivatives
The quadop-based method we currently use on all chipsets already
provides the fine version of the derivatives.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-14 20:25:33 -04:00
Ilia Mirkin
88b0c6403f mesa/st: add support for emitting fine derivative opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
8ee74ce50f gallium: add opcodes/cap for fine derivative support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
v2: Reuse opcode gaps as suggested by Marek
2014-08-14 20:25:32 -04:00
Ilia Mirkin
3fa384db0c mesa/program: add new derivative unops to the unexpected list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
f80c6847e9 glsl: add ARB_derivative control support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
4a9c36c985 mesa: add ARB_derivative_control extension bit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
e474cb4027 mesa: add ARB_texture_barrier support
This extension is identical to NV_texture_barrier. Alias
glTextureBarrier to the existing glTextureBarrierNV and use the existing
NV_texture_barrier extension bit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:25:32 -04:00
Marek Olšák
c3bd130784 docs: document radeonsi BPTC support, sort extensions in 10.3 release notes 2014-08-15 02:05:05 +02:00
Glenn Kennard
f23ee74791 r600g: Implement BPTC texture support
Requires Evergreen/Cayman

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 01:55:13 +02:00
Kristian Høgsberg
221d9c3e9c i965: Rename intelValidateState to intel_update_state
This matches the name of the dd hook.  Also convert a couple of nearby
dd implementations to lowercase + underscore as is now the standard.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 13:57:26 -07:00
Kristian Høgsberg
416dd873e8 i965: Assign PS kernel start pointers when we decide which kernels to use
Right now we decide which kernels to use and the GRF start offsets in
one place and emit the kernel pointers later.  The logic of how to map
8, 16 and 32 kernels to kernel start pointers follows the same logic as which
GRF start offsets to use, so lets figure out these two things in one place.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-08-14 13:57:26 -07:00
Grigori Goronzy
d7d8260f70 radeonsi: implement BPTC texture support
Passes all piglit tests.

v2: rebased

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
87a8ed9389 radeonsi: fix buffer invalidation of unbound texture buffer objects
This maintains a list of all TBOs in a pipe_context.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
79f28cdb98 r600g: implement invalidation of texture buffer objects
This fixes piglit spec/ARB_texture_buffer_object/data-sync.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
da9c3ed304 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>
2014-08-14 20:45:03 +02:00
Marek Olšák
d52202141e r600g: clear constant buffer sizes at the beginning of CS
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-14 20:45:03 +02:00
Pekka Paalanen
08264e5dad 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>
2014-08-14 21:30:57 +03:00
Pekka Paalanen
972e87ca30 i965: fix compiler error in union initiliazer
gcc 4.6.3 chokes with the following error:

brw_vec4.cpp: In member function 'int brw::vec4_visitor::setup_uniforms(int)':
brw_vec4.cpp:1496:37: error: expected primary-expression before '.' token

Apparently C++ does not do named initializers for unions, except maybe
as a gcc extension, which is not present here.

As .f is the first element of the union, just drop it. Fixes the build
error.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 21:30:57 +03:00
Anuj Phogat
9b9dd22f44 i965: Bail on FS copy propagation for scratch writes with source modifiers
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 11:03:00 -07:00
Anuj Phogat
7c1ea00eaf 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>
2014-08-14 11:03:00 -07:00
Aras Pranckevicius
2b837576eb glsl: Fixed vectorize pass vs. texture lookups.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82574
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 09:40:33 -07:00
Brian Paul
088106fa79 ra: move declarations before code to fix MSVC build
Trivial.
2014-08-14 08:53:45 -06:00
Brian Paul
bfb6b76665 svga: remove some unneeded INLINE qualifiers
Trivial.
2014-08-14 08:53:45 -06:00
Emil Velikov
478f82737c docs/autoconf: update to better reflect reality
* --enable-{32,64}-bit is done. Use --build and --host instead.
 * Configure does not add "-g -O2" to C{,XX}FLAGS.
 * Pkg-config has been mandatory for a while now.
 * Avoid using LDFLAGS, refer to pkg-config.
 * --with-expat is deprecated. Use pkg-config.

v2:
 * Note that CC/CXX will need to be set for multilib builds.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-08-14 15:45:23 +01:00
Jose Fonseca
d4a1f3fd27 scons: do not include headers from the sources lists
The SCons documentation is not explicit on the topic yet building mesa
with SCons and MSVC is known to have problems when headers are listed.
So be safe just drop them for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82534
Tested-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-14 15:38:04 +01:00
Emil Velikov
395ce0b0fa configure.ac: remove enable 32/64 bit hacks
These two were added ages ago, with an explicit comment "Hacks ..."
They have been insufficient for years and maintainers needed to
explicitly handle the build themselves.

Rather than lying and pretending that it works, just kill this hack and
let maintainers build things the way it should be done for their
distribution.

Document the removal in the release notes.

Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 15:37:33 +01:00
Emil Velikov
957a28e63c Revert "configure: Fix --enable-XX-bit flags by moving LT_INIT where it should"
This reverts commit 2af28040d6.

The commit was resolving an issue where libtool will not setup the
environment correctly when one explicitly provides --enable-{32,64}-bit
at configure time. It was caused due to the "-m32,64" C{,XX}FLAGS being
set too late relative to LT_INIT.

At the same time this cases the enable_static to be incorrectly set,
amongst others leading to build issues. Rather than being smart and
trying to handle 32/64 bit build ourselves it may be better to delegate
it to the builder/maintainer. The latter should now know better which is
the correct(most appropriate) method.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82536
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82546
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
2014-08-14 15:36:49 +01:00
Neil Roberts
2c50212b14 i965: Store uniform constant values in a gl_constant_value instead of float
The brw_stage_prog_data struct previously contained an array of float pointers
to the values of parameters. These were then copied into a batch buffer to
upload the values using a regular assignment. However the float values were
also being overloaded to store integer values for integer uniforms. This can
break if x87 floating-point registers are used to do the assignment because
the fst instruction tries to fix up invalid float values. If an integer
constant happened to look like an invalid float value then it would get
altered when it was copied into the batch buffer.

This patch changes the pointers to be gl_constant_value instead so that the
assignment should end up copying without any alteration. This also makes it
more obvious that the values being stored here are overloaded for multiple
types.

There are some static asserts where the values are uploaded to ensure that the
size of gl_constant_value is the same as a float.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81150
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 11:54:48 +01:00
Christian König
6fb42ee7a6 st/vdpau: add device reference counting
This fixes an issue with flash where it tries to destroy a decoder
after already destroying the device associated with the decoder.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-14 11:57:07 +02:00
Chris Forbes
c1df492d03 mesa: Make ARB_gpu_shader5 core-profile-only
Requires GLSL 1.50 or higher, which we only support in the core profile.

V2: Fix broken alignment

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 21:32:33 +12:00
Ilia Mirkin
a89353381a nouveau: force luminance clear colors to have the same g/b values as r
Fixes the LUMINANCE_ALPHA formats of fbo-clear-formats piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-14 02:05:06 -04:00
Kenneth Graunke
c66d928f2c i965: Enable INTDIV in SIMD16 mode.
All we need to do is decompose this to two SIMD8 instructions, like we
do in many other cases.  We even already have code for that.

I apparently just botched this last time I tried, and it was easy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 21:19:07 -07:00
Kenneth Graunke
24878f31c4 i965/fs: Drop "do dual source blending" generator parameter.
When dual source blending, the visitor already stores a flag in
brw_wm_prog_data (dual_src_blend) for the state upload code to use.
The generator also receives this, so there's no need to pass an
additional flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 21:19:07 -07:00
Jason Ekstrand
a8379a405a mesa/texstore: Don't use the _mesa_swizzle_and_convert if we need transfer ops
The _mesa_swizzle_and_convert path can't do transfer ops, so we should bail
if they're needed.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-13 19:43:33 -07:00
Dave Airlie
f1ef4be4be docs: update ARB_vertex_attrib_64bit status
I started this as well on top of my fp64 stuff.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:49:55 +10:00
Dave Airlie
c63233424b docs/GL3.txt: add GLES 3.1 section
This just cherry-pick the extensions into a list for GLES 3.1

I'm not actually sure if this list if complete or correct, maybe someone
else can tell me what I missed, and I'm not 100% sure on multi_draw_indirect.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:49:15 +10:00
Dave Airlie
1cfcd0164e hud: don't overrun malloced arrays
==17630== Invalid read of size 4
==17630==    at 0x400AE10: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17630==    by 0x49024A2: u_upload_data (u_upload_mgr.c:253)
==17630==    by 0x49050E1: u_vbuf_draw_vbo (u_vbuf.c:980)
==17630==    by 0x487DE29: cso_draw_vbo (cso_context.c:1425)
==17630==    by 0x487DEA0: cso_draw_arrays (cso_context.c:1445)
==17630==    by 0x48A3B0E: hud_draw_colored_prims.constprop.6 (hud_context.c:123)
==17630==    by 0x48A4810: hud_draw (hud_context.c:266)
==17630==    by 0x48763F7: dri_flush (dri_drawable.c:483)
==17630==    by 0x4057510: dri2Flush.constprop.4 (dri2_glx.c:559)
==17630==    by 0x405789E: dri2SwapBuffers (dri2_glx.c:851)
==17630==    by 0x402C531: glXSwapBuffers (glxcmds.c:842)
==17630==    by 0x8049716: ??? (in /usr/bin/glxgears)
==17630==  Address 0x4426b2c is 4 bytes after a block of size 1,008 alloc'd
==17630==    at 0x4006B11: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17630==    by 0x48A4CE7: hud_pane_add_graph (hud_context.c:625)
==17630==    by 0x48A68F0: hud_pipe_query_install (hud_driver_query.c:175)
==17630==    by 0x48A6A30: hud_driver_query_install (hud_driver_query.c:207)
==17630==    by 0x48A5835: hud_create (hud_context.c:791)
==17630==    by 0x48756CB: dri_create_context (dri_context.c:165)
==17630==    by 0x4871CD4: driCreateContextAttribs (dri_util.c:435)
==17630==    by 0x4871E06: driCreateNewContext (dri_util.c:464)
==17630==    by 0x4056A22: dri2_create_context (dri2_glx.c:223)
==17630==    by 0x402CF68: CreateContext (glxcmds.c:299)
==17630==    by 0x402D265: glXCreateContext (glxcmds.c:430)
==17630==    by 0x804B136: ??? (in /usr/bin/glxgears)

This is due to second vertex element being specified, and the upload
tries to fetch over the end. However the pane rendering only requires
a single vertex element, so specify only one.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:46:32 +10:00
Roland Scheidegger
b6d29de2c4 mesa: fix texstore with GL_COLOR_INDEX data
This got broken by 3dbf5bf657.
GL_COLOR_INDEX data is still supported (in legacy contexts), but the new
texstore_swizzle path cannot handle it (and didn't detect this).
Unfortunately there's no piglit test trying to specify textures with a
GL_COLOR_INDEX source format, and I don't really understand how all the color
map stuff which is used by this works, but this caused conform failures
(with a reported mesa implementation error when trying to figure out the color
mapping).

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-14 02:16:23 +02:00
Andreas Boll
64c379a3a8 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>
2014-08-13 23:28:23 +02:00
Tom Stellard
866dae85c8 r300g: Fix bug in build_loop_info()/compiler v2
Fixes piglit glean "do-loop with continue and break" on RS690

It's based on Tom Stellard patch and improved to handle CMP instruction.

[v2] handle CMP instruction

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
2014-08-13 14:37:03 -04:00
Tom Stellard
ed3f7eadad 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>
2014-08-13 14:20:22 -04:00
Tom Stellard
a15088338e radeonsi/compute: Stop leaking the input buffer
We were leaking the input buffer used for kernel arguments and since
we were allocating it using si_upload_const_buffer() we were leaking
1 MB per kernel invocation.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:18:35 -04:00
Tom Stellard
38fccc37c1 radeonsi/compute: Whitespace fixes
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:17:02 -04:00
Tom Stellard
1e2e550671 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>
2014-08-13 14:17:02 -04:00
Tom Stellard
05e9681d55 radeonsi/compute: Update reference counts for buffers in si_set_global_binding()
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:17:02 -04:00
Tom Stellard
72969e0efb radeon/compute: Report a value for PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:11:44 -04:00
Tom Stellard
77ea58ca81 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>
2014-08-13 14:11:43 -04:00
Connor Abbott
e78a01d5e6 ra: optimistically color only one node at a time
Before, when we encountered a situation where we had to optimistically
color a node, we would immediately give up and push all the remaining
nodes on the stack in the order of their index - which is a random, and
potentially not optimal, order. Instead, choose one node to
optimistically color in ra_select(), and then once we've optimistically
colored it, keep on going as normal in the hopes that we've opened up
more avenues for the normal select phase to make progress. In cases with
high register pressure, this helps make the order we push things on the
stack much better, and therefore increase the chance that we can allocate
successfully.

total instructions in shared programs: 4545447 -> 4545401 (-0.00%)
instructions in affected programs:     1353 -> 1307 (-3.40%)
GAINED:                                124
LOST:                                  6

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:37 -07:00
Connor Abbott
03f4084d28 ra: don't consider nodes for spilling we don't need to
Previously, we would consider any optimistically colored nodes for
spilling. However, spilling any optimistically colored nodes below the
node that we failed to color on the stack wouldn't help us make
progress, since it wouldn't help with allowing us to find a color for
the node currently failing to get colored. Only consider nodes
which were above the failing node on the stack for spilling, which
simplifies the logic, and comment the code better so people know what's
going on here.

No shader-db changes with BRW_MAX_GRF reduced to 90 (or with the normal
number of GRF's).

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:30 -07:00
Connor Abbott
567e2769b8 ra: make the p, q test more efficient
We can store the q total that pq_test() would've calculated in the node
itself, updating it when we add a node to the stack. This way, we only
have to walk the adjacency list when we push a node on the stack (i.e.
when the p, q test succeeds) instead of every time we do the p, q test.

No difference in shader-db run times, but I'm keeping this in because
the q total that it calculates will also be used in the next few commits.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:22 -07:00
Connor Abbott
9a0b52e7c1 ra: cleanup the public API
Previously, there were 3 entrypoints into parts of the actual allocator,
and an API called ra_allocate_no_spills() that called all 3. Nobody
would ever want to call any of the 3 entrypoints by themselves, so
everybody just used ra_allocate_no_spills(). So just make them static
functions, and while we're at it rename ra_allocate_no_spills() to
ra_allocate() since there's no equivalent "with spills," because the
backend is supposed to handle spilling.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-13 11:43:05 -07:00
Ilia Mirkin
d72d67832b nouveau: only try to get new storage if there are any levels
This would try to allocate 0-sized bo's when the max level was below the
base level.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-13 10:09:01 -04:00
Ilia Mirkin
ddcbea91f1 nouveau: add emacs dir-locals file for tabs/8-space indents
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-13 09:59:04 -04:00
Ilia Mirkin
8049e5a1f6 nvc0: increase GLSL level to 400 to enable ARB_gpu_shader5
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-13 09:59:04 -04:00
Ilia Mirkin
6f1edf3cbf mesa/st: enable ARB_gpu_shader5 if the reported GLSL version >= 400
The ARB_gpu_shader5 extension is made up of a lot of small sub-parts.
Instead of adding PIPE_CAP's for each of these, just rely on the GLSL
version reported by the pipe driver. The remaining extensions lend
themselves naturally to being checked through a single CAP.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-13 09:59:04 -04:00
Emil Velikov
52901ec261 android: add CleanSpec.mk
The file contains rules that are executed on incremental builds. This
way one can avoid doing a full clean and ensure that the new object
(library) is correctly build.

Inspired by the work of Chih-Wei Huang, from the Android-x86 project.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
38df9f8a06 android: megadriver_stub: prefix static libraries with libmesa_
Will make it easier on us as CleanSpec.mk comes along and improves
consistency across the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
73121a34d4 android: loader: prefix static libraries with libmesa_*
Will make it easier on us as CleanSpec.mk comes along and improves
consistency across the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
db4d7229bc android: dri/i9*5: remove used _INCLUDES variable
No longer needed as of last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
725373275c android: drivers/dri: add $(mesa_top)/src to the includes list
Will allow us to nuke an include or two from the drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
48307eb813 android: dri: use the installed libdrm headers
Saves us a few lines and brings us closer to the automake build.
Drop DRM_TOP as it's not longer used.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
c1cc3f2f19 android: gallium: use the installed libdrm headers
Saves us a few lines and brings us closer to the automake build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
5f3022e97f android: loader: use the installed libdrm headers
One step closer to the way we handle automake builds.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
db064b7054 android: egl/dri2: use the installed libdrm headers
Trying to get rid of the hardcoded dependency of DRM_TOP which
expects that mesa is localted in /external/drm. Will

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
5facd003a0 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>
2014-08-13 00:46:56 +01:00
Emil Velikov
fa4aeb3c65 automake: mesa: whitespace fixes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
b3121bfd41 mesa: guard better when building with sse4.1 optimisations
When the compiler is not capable/does not accept -msse4.1 while the target
has the instruction set we'll blow up as _mesa_streaming_load_memcpy is
going to be undefined.

To make sure that never happens, wrap the runtime cpu check+caller in an
ifdef thus do not compile that hunk of the code.

Fix the android build by enabling the optimisation and adding the define
where applicable.

v2: autoconf conditionals end with "fi" rather than endif.
v3: Wrap the definition and call to intel_miptree_{un,}map_movntdqa in
if defined(USE_SSE41). Spotted by Matt.

Cc: Matt Turner <mattst88@gmail.com>
Cc: Adrian Negreanu <adrian.m.negreanu@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:55 +01:00
Emil Velikov
07f583186d 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>
2014-08-13 00:46:55 +01:00
Emil Velikov
dfa6dc5eb8 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>
2014-08-13 00:46:55 +01:00
Emil Velikov
51a9a09ba8 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>
2014-08-13 00:46:55 +01:00
Emil Velikov
2e74818374 android: targets/egl-static: add correct include for DRM headers
Android build never really installs the headers, as such we need to
explicitly add their location in the source tree otherwise it will
fail to find them.

v2: Android now installs the headers, so let's use that ;)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
b72b826ef8 scons: group state-trackers' and targets' scons
Both share the identical dependencies, as such we can simplify
the scons script.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
ec668cbf8b android: reorder gallium SUBDIRS
To be closer to its automake counterpart.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
b75e0d7e25 automake: handle gallium SUBDIRs in gallium/Makefile
Considering the way we've been consolidating things it makes
sense to add the final two (aux and tests) in here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
7af25d17a5 automake: compact gallium/target/Makefile into gallium/Makefile
Yet another makefile less to worry about.

v2: Add state_trackers and targets on a single SUBDIRS line.
Requested by Matt.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
eeb56b6b43 automake: merge gallium/state_trackers/Makefile into gallium/Makefile
One makefile less, with the potential of further compacting the
automake build.

v2: Rebase on top of vc4 changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:53 +01:00
Emil Velikov
fd7da27a43 automake: compact gallium/drivers and gallium/winsys makefiles
Rather than having two separate almost empty and identical makefiles,
compact them thus improving the configure and build time.
Additionally this makes the automake build symmetrical to the scons
and android one.

v2: Rebase on top of vc4, compact drivers + winsys on a single line.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:53 +01:00
Emil Velikov
792041ebe5 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>
2014-08-13 00:46:53 +01:00
Emil Velikov
bf05e06757 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>
2014-08-13 00:46:52 +01:00
Emil Velikov
458d03a4a4 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>
2014-08-13 00:46:52 +01:00
Paulo Sergio Travaglia
aae453afe8 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>
2014-08-13 00:46:52 +01:00
Paulo Sergio Travaglia
5bbfa308c9 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>
2014-08-13 00:46:52 +01:00
Emil Velikov
825fa2873f 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>
2014-08-13 00:46:52 +01:00
Emil Velikov
6b510c6338 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>
2014-08-13 00:46:52 +01:00
Emil Velikov
b26017fad8 egl/main: Bring in the Makefile.sources
Rather than having the sources list duplicated across all three
build systems, define it once and use it whenever needed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:52 +01:00
Ilia Mirkin
2787bff8dd nvc0: add BPTC format support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
ffd706dac0 mesa/st: add BPTC formats, expose ARB_texture_compression_bptc
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
19563f0880 softpipe,llvmpipe: mark BPTC formats as unsupported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
43c038f4a6 gallium: add basic support for BPTC formats
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
82903acf5e docs: add GL4.5 section
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-12 18:56:22 -04:00
Emil Velikov
5e5f754f5b configure.ac: drop enable_dri check in gallium_gbm
A while back we've mandated that gbm requires enable_dri,
thus this check is no longer required.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Emil Velikov
1d1ec76bdf 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>
2014-08-12 23:36:06 +01:00
Emil Velikov
16873a6e62 st/dri: define GALLIUM_SOFTPIPE when building kms_swrast
To avoid unresolved symbols in the DRI modules with earlier commit we
wrapped the innards of dri_kms_init_screen() in a
DRI_TARGET/GALLIUM_SOFTPIPE ifdef.

At the same time we forgot to adds the defines to the st/dri build
systems, breaking kms_swrast and gnome-continuous.

Drop the DRI_TARGET define, we're already in st/DRI.

Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reported-by: Vadim Rutkovsky <vrutkovs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Alexandre Demers
2af28040d6 configure: Fix --enable-XX-bit flags by moving LT_INIT where it should
Moving LT_INIT after setting completely (AM_)C(XX)FLAGS and LDFLAGS.
LT_INIT needs them as they are expected to be used all along
the compilation when the macro runs its tests to determine among other
things the host type.

For info, see http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50754
Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Tested-by: Tapani Palli <lemody@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Emil Velikov
469416f988 c11/threads: correct assertion
We should assert when either the function or the flag pointer
is null or we'll end up with a null reference a few lines later.

Currently unused by mesa thus it has gone unnoticed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 23:36:05 +01:00
Brian Paul
07109cfd99 docs: now distributing the GL/glcorearb.h header
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 15:55:41 -06:00
Brian Paul
25774859f8 mesa: pull Khronos glcorearb.h header into include/GL/
Apps that only want to use core functionality should #include this
header.  This version covers everything up to OpenGL 4.5.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 15:55:41 -06:00
Eric Anholt
c8e0dd2a2c vc4: Drop the dump_fbo() routine.
Now that eglkms is working, and some tests are working under
PIGLIT_PLATFORM=gbm, I don't think I need this any more.
2014-08-12 14:21:56 -07:00
Eric Anholt
8106722bbc vc4: Claim the GL 2.1 minimum for 3D textures.
We don't actually do them (or even fake them) currently, but it does get
us a bunch of unrelated glean glsl1 tests passing, which previously would
error out due to glean assuming the minimums on a 3D texture that 2 of the
subtests use.
2014-08-12 14:19:49 -07:00
Eric Anholt
e1ce610899 vc4: Declare what vertex formats we actually support.
We will support more than this eventually, but for now this makes u_vbuf
format-convert a few things (32-bit snorm and scaled, doubles) for us.
2014-08-12 14:19:49 -07:00
Eric Anholt
8e504ce420 vc4: Stash some debug code for format support checks.
This can be useful for looking at context init setup and texture format
choices, and there's no reason for the silly retval computation we do if
you're not going to have this code (mostly from freedreno) around.
2014-08-12 14:03:35 -07:00
Eric Anholt
af35afed06 vc4: Texture format support has nothing to do with VBO format support.
This was inherited from freedreno, but doesn't apply to us.
2014-08-12 14:03:35 -07:00
Eric Anholt
3e9a09415e vc4: Fix off-by-one in texture maximum levels.
It's 2048x2048 that's the max, not 1024x1024.
2014-08-12 14:03:34 -07:00
Eric Anholt
b9eb3d4bee vc4: Add support for the FLR opcode. 2014-08-12 14:03:34 -07:00
Kenneth Graunke
8c229d306b i965: Delete the Gen8 code generators.
We now use the brw_eu_emit.c code instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
f17bfc9ba9 i965: Never use the Gen8 code generators.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
074d472398 i965: Switch to the EU emit layer for code generation on Broadwell.
Everything should be in place to unify code generation between Gen4-7
and Gen8+.  We should be able to drop the Gen8 generators at this point.

However, leave them hooked up for a brief moment, for testing and
comparison purposes.  Set GEN8=1 to use the old Gen8+ code generator
paths.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
db6ffa29c8 i965: Retype atomics to UD in Gen8 code generation.
Kind of a moot point since we're deleting Gen8 code generation, but
this at least helps make it match the Gen4-7 code.  It's probably more
reasonable than using float.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
04f5b2f4e4 i965/vp: Use the sampler for pull constant loads on Gen7/7.5.
This improves performance in Trine 2 at 1280x720 (windowed) on "Very
High" settings by 30% (in the interactive menu) to 45% (in the forest
by the giant frog) on Haswell GT3e.

It also now generates the same assembly on Gen7 as it does on Gen8,
which always used the sampler for both types.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
f7e9756201 i965/vec4: Drop gen <= 7 assertion in pull constant load handling.
I don't see any reason for this to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
ce90fd9676 i965/eu: Set src0 file to IMM on Gen8+ flow control instructions.
According to the documentation, we need to set the source 0 register
type to IMM for flow control instructinos that have both JIP and UIP.
Out of paranoia, just make all flow control instructions use IMM;
there's no benefit to using ARF anyway, and it could trouble that's
difficult to diagnose.

See commit 9584959123, which did the
analogous change in the gen8_generator code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
d8ef0eab5a i965/eu: Refactor brw_WHILE to share a bit more code on Gen6+.
We're going to add a Gen8+ case shortly, which would need to duplicate
this code again.  Instead, share it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
aafdf9eef4 i965/eu: Emulate F32TO16 and F16TO32 on Broadwell.
When we combine the Gen4-7 and Gen8+ generators, we'll need to handle
half float packing/unpacking functions somehow.  The Gen8+ generator
code today just emulates the behavior of the Gen7 F32TO16/F16TO32
instructions, including the align16 mode bugs.

Rather than messing with fs_generator/vec4_generator, I decided to just
emulate the instructions at the brw_eu_emit.c layer.

v2: Change gen >= 7 asserts to gen == 7 (suggested by Chris Forbes).
    Fix regressions on Haswell in VS tests due to type assertions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
849046b842 i965/vec4: Port Gen8 SET_VERTEX_COUNT handling to vec4_generator.
Broadwell requires the number of vertices written by the geometry shader
to be specified in a separate register, as part of the terminating
message's payload.

This also means GS_OPCODE_THREAD_END needs to increment mlen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
17c17b87f9 i965/vec4: Switch to MOV, not OR, for GS_OPCODE_THREAD_END on Gen8.
Either should work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
af13cf609f i965/vec4: Use MOV, not OR, to set URB write channel mask bits.
g0.5 has nothing of value to contribute to m0.5.  In both the VS and GS
payload, g0.5 contains the scratch space pointer - which is definitely
not of any use.  The GS payload also contains FFTID, but the URB write
message header doesn't want FFTID.

The only reason I used OR was because Eric originally requested it.
On Broadwell, I used MOV, and that's worked out fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
efc818e3a4 i965/fs: Don't set flag_subreg_nr = 1 on predicated FB write setup.
On Haswell, we implement "discard" via predicated SEND messages, using
f0.1 instead of f0.0.  To accomplish this, we set inst->flag_subreg to 1
on the FS_OPCODE_FB_WRITE.

Most instructions using fs_inst::flag_subreg expand to a single assembly
instruction.  However, FS_OPCODE_FB_WRITE can generate several MOVs for
setting up header information.  We don't want to set flag_subreg on
those, so override the default state back to 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
2e180e4c09 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>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
7b6b61ba83 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>
2014-08-12 13:39:24 -07:00
Jason Ekstrand
97d57f1142 gallium/r300: Fix a link error in the tests
The link error occurs because the static libraries are linked in the wrong
order.  This fixes it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82483
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-08-12 11:35:07 -07:00
Matt Turner
e005c1148d i965: Return NONE from brw_swap_cmod on unknown input.
Comparing ~0u with a packed enum (i.e., 1 byte) always evaluates to
false. Shouldn't gcc warn about this?

Reported-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-12 11:09:45 -07:00
Neil Roberts
ab66b19669 docs: Update release notes and GL3.txt for GL_ARB_texture_compression_bptc
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
a018a3f3f5 mesa/meta: Support decompressing floating-point formats
Previously the Meta implementation of glGetTexImage would fall back to
_mesa_get_teximage if the texturing is not using an unsigned normalised
format. However in order to support the half-float formats of BPTC textures we
can make it render to a floating-point renderbuffer instead. This patch makes
decompression_state have two FBOs, one for the GL_RGBA format and one for
GL_RGBA32F. If a floating-point texture is encountered it will try setting up
a floating-point FBO. It will now also check the status of the FBO and fall
back to _mesa_get_teximage if the FBO is not complete.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
817051ab5b swrast: Enable GL_ARB_texture_compression_bptc
Enables BPTC texture compression on the software rasterizer.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
9782b8a80c i965: Enable the GL_ARB_texture_compression_bptc extension
Enables the BPTC extension on Gen>=7 and adds the necessary format mappings to
get the right surface type value.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
88a8830390 mesa/main: Modify generate_mipmap_compressed to cope with float textures
Once we add BPTC texture support we will need to generate mipmaps for
compressed floating point textures too. Most of the code seems to already be
there but it just needs a few extra lines to get it to use GL_FLOAT instead of
GL_UNSIGNED_BYTE as the type for the temporary buffers.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
17cde55c53 mesa: Add texstore functions for BPTC-compressed textures
This adds compressors for all four of the BPTC compressed-texture formats. The
compressor is written from scratch and takes a very simple approach. It always
uses a single mode of the BPTC format (4 for unorm and 3 for half-floats) and
picks the two endpoints by dividing the texels into those which have more or
less than the average luminance of the block and then calculating an average
color of the texels within each division.

It's probably not really sensible to try to use BPTC compression at runtime
because for example with the Nvidia offline compression tool it can take in
the order of an hour to compress a full-screen image. With that in mind I
don't think it's worth having a proper compressor in Mesa and this approach
gives reasonable results for a usage that is basically a corner case.

v2: Always use the custom compressor, even for the unorm formats. Fix the
    quantization step for the half-float format compressor. Fixed a typo which
    was breaking the right-hand edge of half-float textures with a width that
    isn't a multiple of four.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
442bcd7fd3 mesa: Add texel fetch functions for BPTC-compressed textures
Adds functions to fetch from any of the four BPTC-compressed formats.

v2: Set the alpha component to 1.0 when fetching from the half-float formats
    instead of leaving it uninitialised. Don't linearize the alpha component
    when fetching from sRGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
7e78033c11 mesa: Add the format enums for BPTC-compressed images
This adds the following four Mesa image format enums which correspond to the
four BPTC compressed texture formats:

 MESA_FORMAT_BPTC_RGBA_UNORM
 MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM
 MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT
 MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT

It also updates the format information functions to handle these and the
corresponding GL enums.

v2: Also modify _mesa_get_format_color_encoding, _mesa_get_srgb_format_linear
    and _mesa_get_uncompressed_format

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
cc9c30b8a7 mesa/format_info: Add support for the BPTC layout
Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC depend
on the mode but as it only has to be an approximation this sets it to 8 for
the two UNORM formats and 16 for the two half-float formats. These represent
the minimum number of bits of variation that can be generated by the
interpolation of the two formats.

This doesn't quite match what we do for S3TC which only returns 4 even though
it can similarly generate 8 bits from the interpolation. However it does match
what we return for ETC2. For reference, NVidia seems to return 8 bits for the
UNORM formats and 32 bits for the half-float formats.

v2: Change the number of bits to 8/8/8/8 for the UNORM formats and 16/16/16
    for the half-float formats.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-12 18:23:38 +01:00
Neil Roberts
84218b598f mesa/format_info: Add support for compressed floating-point formats
If the name of a compressed texture format has ‘FLOAT’ in it it will now set
the data type of the format to GL_FLOAT. This will be needed for the BPTC
half-float formats.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Neil Roberts
0c6e230eb1 mesa: Fix the base format for GL_COMPRESSED_RGB_BPTC_*_FLOAT_ARB
The signed and unsigned half-float BPTC-compressed formats were being reported
as having a base format of GL_RGBA but they don't store an alpha channel so it
should be GL_RGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Neil Roberts
5ceb4bff33 mesa: Add the GL_ARB_texture_compression_bptc extension
This adds a boolean in the gl_extensions struct for
GL_ARB_texture_compression_bptc as well as an entry in extension_table.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Andreas Boll
36771dc60f winsys/radeon: fix nop packet padding for hawaii
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>
2014-08-12 12:16:06 -04:00
Brian Paul
fa5b76e3a2 mesa: regenerate gl_mangle.h
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
0a96e7adaa mesa: update wglext.h to version 20140810
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
eeb7fc8b7d mesa: update glxext.h to version 20140810
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
b7d36efe93 mesa: update glext.h to version 20140810
This brings in the new OpenGL 4.5 features.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:44 -06:00
Charmaine Lee
0c065270c0 svga: Add a limit to the maximum surface size
This patch adds a limit to the maximum surface size which is
based on the maximum size of a single mob. If this value is not
available, the maximum surface size is by default set to 128 MB.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-12 08:03:24 -06:00
José Fonseca
d839be24b3 mesa/st: Move declaration to top of block.
To fix MSVC build failure.

Trivial.
2014-08-12 14:25:37 +01:00
Ilia Mirkin
6174f49170 mesa/st: add support for dynamic sampler offsets
Replace the plain sampler index with a register reference to a sampler.
We also need to keep track of the sampler array size when there is a
relative reference so that we can mark the whole array used.

To facilitate implementation, we add a separate ADDR register that
exclusively handles the sampler relative address. Other approaches would
be more invasive.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 08:52:14 -04:00
Christian König
83012b5085 radeon/uvd: fix gpu_address for video surfaces
We need to get the new gpu_address as well when
reallocating the cs buffer.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2014-08-12 11:53:52 +02:00
Chris Forbes
3b48f6a4c0 mesa: Add a new function for getting the nonconst sampler array index
If the array index is not a constant expression, the existing support
will assume a zero offset (giving us the sampler index of the base of
the array).

For dynamically uniform indexing of sampler arrays, we need both that
and the indexing expression.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:18:55 +12:00
Chris Forbes
1b4761bc27 glsl: Allow dynamically uniform sampler array indexing with 4.0/gs5
V2: Expand comment to explain what dynamically uniform expressions are
about.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:17:56 +12:00
Ilia Mirkin
f525bd01d1 nvc0/ir: describe the tex arguments for fermi/kepler
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Ilia Mirkin
b3cbd86224 nvc0/ir: add kepler+ support for indirect texture references
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Ilia Mirkin
af3619e880 nvc0/ir: add base tex offset for fermi indirect tex case
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Kenneth Graunke
f73594778b i965: Revert part of f5cc3fdcf1.
Fixes non-termination in various Piglit tests.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-11 15:07:17 -07:00
Eric Anholt
602a3f92d4 vc4: Flip which primitives are considered front-facing.
This mostly fixes glxgears rendering.
2014-08-11 14:47:54 -07:00
Eric Anholt
f097516505 vc4: Don't forget to set the depth clear value in the packet.
This gets glxgears partially rendering again.
2014-08-11 14:47:54 -07:00
Eric Anholt
e63598aecb vc4: Add support for gl_FragCoord.
This isn't passing all tests (glsl-fs-fragcoord-zw-ortho, for example),
but it does get a bunch more tests passing.

v2: Rebase on helpers change.
2014-08-11 14:47:54 -07:00
Eric Anholt
d34fbdda12 vc4: Refactor shader input setup again.
This makes some space for handling special inputs like fragcoords.
2014-08-11 14:47:54 -07:00
Eric Anholt
a7faca5d27 vc4: Clean up the tile alloc buffer size.
This prevents some simulator assertion failures, but it does mean (since
I've dropped the "* 16" padding) that on real hardware you need a kernel
that does overflow memory management (currently, "drm/vc4: Add support for
binner overflow memory allocation." in my kernel tree).
2014-08-11 14:47:51 -07:00
Eric Anholt
7050ab510d vc4: Clarify some values implicitly chosen for binning config.
These #defines are 0, but it should help make math above make more sense.
2014-08-11 14:45:32 -07:00
Eric Anholt
ed5cb5d7d5 vc4: Improve simulator memory allocation.
This should reduce a bunch of spurious failures in sim.
2014-08-11 14:45:32 -07:00
Eric Anholt
f5f8dd29c3 vc4: Handle stride==0 in VBO validation 2014-08-11 14:45:32 -07:00
Eric Anholt
0f034055f9 vc4: Stash some debug code for looking at what BOs are at what hindex.
When you're debugging validation, it's nice to know what the BOs are for.
2014-08-11 14:45:32 -07:00
Eric Anholt
8ebfa8fdb2 vc4: Use GEM under simulation even for non-winsys BOs.
In addition to reducing sim-specific code, it also avoids our local handle
allocation conflicting with the host GEM's handle numbering, which was
causing vc4_gem_hindex() to not distinguish between winsys BOs and the
same-numbered non-winsys bo.
2014-08-11 14:45:32 -07:00
Eric Anholt
cdc208bdaf vc4: Don't forget to unmap the GEM BO when freeing.
Otherwise it'll stick around forever.
2014-08-11 14:45:32 -07:00
Eric Anholt
d2cc7f97df vc4: Add validation of raster-format textures.
... and reject everything else, for now.

v2: Rebase on v2 of the rendering config validation change.
2014-08-11 14:45:32 -07:00
Eric Anholt
b384d16733 vc4: Drop VC4_PACKET_PRIMITIVE_LIST_FORMAT.
It's not relevant to our command streams any more.

v2: Fix indentation and a typo in the comment.
2014-08-11 14:45:32 -07:00
Eric Anholt
3aba1b124f vc4: Add validation that vertex indices don't overflow VBO bounds. 2014-08-11 14:45:32 -07:00
Eric Anholt
5692122147 vc4: Fix the shader record size for extended strides.
It turns out they aren't packed when attributes are missing, according to
both docs and simulation.
2014-08-11 14:45:32 -07:00
Eric Anholt
aaff32ded0 vc4: Fix the shader record size for extended strides.
It turns out they aren't packed when attributes are missing, according to
both docs and simulation.

v2: Drop unused variable.
2014-08-11 14:45:31 -07:00
Eric Anholt
9f24e4e6ed vc4: Add a bunch of validation of render mode configuration.
v2: Fix a build break after some previous rebase.
2014-08-11 14:45:31 -07:00
Eric Anholt
ff4748491b vc4: Store the (currently always linear) tiling format in the resource. 2014-08-11 14:45:31 -07:00
Eric Anholt
0bc2aed90f vc4: Add a bunch of validation of the binning mode config. 2014-08-11 14:45:31 -07:00
Eric Anholt
b6caa9556c vc4: Validate that the same BO doesn't get reused for different purposes.
We don't care if things like vertex data get smashed by render target
data, but we do need to make sure that shader code doesn't get rendered
to.

v2: Fix overflowing read of gl_relocs[] that incorrect flagged of some
    VBOs as shader code.
2014-08-11 14:45:31 -07:00
Eric Anholt
fa26d334cb vc4: Use the packet #defines in the kernel validation code. 2014-08-11 14:45:31 -07:00
Eric Anholt
5969f9b79c vc4: Rename GEM_HANDLES to be in a namespace.
It's not a real VC4 hardware packet, but I've put in a comment to explain
it.
2014-08-11 14:45:31 -07:00
Eric Anholt
27b8a0a025 vc4: Clean up TMU write validation.
The comment conflicted with the support in the code, so I moved the TMU
write validation to where the comment was, and dropped some dead arguments
from the functions while changing their signatures.
2014-08-11 14:45:31 -07:00
Eric Anholt
7969a15325 vc4: Update a comment about shader validation 2014-08-11 14:45:31 -07:00
Eric Anholt
99070c6daa vc4: Add proper translation from Zc to Zs for vertex output.
This fixes the remaining failure in depthfunc.
2014-08-11 14:45:31 -07:00
Eric Anholt
4160ac5ee4 vc4: Add support for depth clears and tests within a tile.
This doesn't load/store the Z contents across submits yet.  It also
disables early Z, since it's going to require tracking of Z functions
across multiple state updates to track the early Z direction and whether
it can be used.

v2: Move the key setup to before the search for the key.
2014-08-11 14:45:31 -07:00
Eric Anholt
2259cc5aeb vc4: Avoid flushing when mapping buffers that aren't in the batch.
This should prevent a bunch of unnecessary flushes for things like
updating immediate vertex data.
2014-08-11 14:45:31 -07:00
Eric Anholt
6b2583412f vc4: Drop the flush at the end of the draw
Now we actally get multiple draw calls per submit.
2014-08-11 14:45:31 -07:00
Eric Anholt
c047f13603 vc4: Align following shader recs to 16 bytes.
Otherwise, the low address bits will end up being interpreted as attribute
counts.
2014-08-11 14:45:31 -07:00
Eric Anholt
766ca5c7a5 vc4: Fix a potential src buffer overflow in shader rec validation. 2014-08-11 14:45:31 -07:00
Eric Anholt
027d730aff vc4: Keep a reference to BOs queued for rendering.
Otherwise, once we're not flushing at the end of every draw, we'll free
things like gallium resources, and free the backing GEM object, before
we've flushed the rendering using it to the kernel.
2014-08-11 14:45:30 -07:00
Eric Anholt
771d86abd6 vc4: Compute the proper end address of the relocated command lists.
render_cl_size/bin_cl_size includes relocations, while the hardware buffer
doesn't.  If you don't emit a HALT packet, the command parser continues
until the end register's value.  We can't allow executing unvalidated
buffer contents (and it's actually harmful in the render lists Mesa is
emitting, since VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF doesn't trigger a
halt).
2014-08-11 14:45:30 -07:00
Eric Anholt
c58f35393e vc4: Walk tiles horizontally, then vertically.
I was confused looking at my addresses in dumps because I was seeing the
tile branch offsets jumping all over.
2014-08-11 14:45:30 -07:00
Eric Anholt
165ca6b5ad vc4: Track clears veresus uncleared draws, and the clear color.
This is a step toward queueing more than one draw per frame.

Fixes piglit attribute0 test, since we get a working clear color now.
2014-08-11 14:45:30 -07:00
Eric Anholt
9c631f30c9 vc4: Move the rest of RCL setup to flush time.
We only want to set up render target config and clear colors once per
frame.
2014-08-11 14:45:30 -07:00
Eric Anholt
100e5679c7 vc4: Move render command list calls to vc4_flush() 2014-08-11 14:45:30 -07:00
Eric Anholt
fbaac8407a vc4: Move bin command list ending commands to vc4_flush() 2014-08-11 14:45:29 -07:00
Eric Anholt
5e062cb2b4 vc4: Rename fields in the kernel interface.
I decided I didn't like "len" compared to "size", and I keep typing
shader_rec instead of shader_record[s] elsewhere, so make it consistent.
2014-08-11 14:45:28 -07:00
Eric Anholt
2b16b3d75f vc4: Fix things to validate more than one shader state in a submit. 2014-08-11 14:45:28 -07:00
Eric Anholt
a8f2bf0f51 vc4: Rewrite the kernel ABI to support texture uniform relocation.
This required building a shader parser that would walk the program to find
where the texturing-related uniforms are in the uniforms stream.

Note that as of this commit, a new kernel is required for rendering on
actual VC4 hardware (currently that commit is named "drm/vc4: Introduce
shader validation and better command stream validation.", but is likely to
be squashed as part of an eventual merge of the kernel driver).
2014-08-11 14:45:28 -07:00
Eric Anholt
6a5ece12aa vc4: Add docs for the drm interface 2014-08-11 14:45:28 -07:00
Eric Anholt
11fbee3201 vc4: Add load/store to the validator 2014-08-11 14:40:45 -07:00
Eric Anholt
a3cd3c0d19 vc4: Switch simulator to using kernel validator
This ensures that when I'm using the simulator, I get a closer match to
what behavior on real hardware will be.  It lets me rapidly iterate on the
kernel validation code (which otherwise has a several-minute turnaround
time), and helps catch buffer overflow bugs in the userspace driver
faster.
2014-08-11 14:40:45 -07:00
Eric Anholt
a02c658908 vc4: Drop pointless shader state struct 2014-08-11 14:40:45 -07:00
Eric Anholt
857dcc09fa vc4: Add support for texture rectangles
v2: Rebase on helpers change.
2014-08-11 14:40:45 -07:00
Eric Anholt
66c6c40127 vc4: Add support for texturing (under simulation)
Only rgba8888 works, and only a single texture unit, and it's only under
simulation because I haven't built the kernel interface yet.

v2: Rebase on helpers.
v3: Fold in the don't-break-the-arm-build fix.
2014-08-11 14:40:45 -07:00
Eric Anholt
d5a6e3dd9b vc4: Drop PIPE_SHADER_CAP_MAX_ADDRS
Fixes the build since c10332bbb8
2014-08-11 14:40:42 -07:00
Marek Olšák
c10332bbb8 gallium: remove PIPE_SHADER_CAP_MAX_ADDRS
This limit is fixed in Mesa core and cannot be changed.
It only affects ARB_vertex_program and ARB_fragment_program.

The minimum value for ARB_vertex_program is 1 according to the spec.
The maximum value for ARB_vertex_program is limited to 1 by Mesa core.

The value should be zero for ARB_fragment_program, because it doesn't
support ARL.

Finally, drivers shouldn't mess with these values arbitrarily.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
718d4b97ef st/mesa: compute supported GL versions at DRIscreen creation
This computes all GL versions before any context is created.
It's a requirement for GLX_MESA_query_renderer.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
fceadfe7ef gallium: pass st_config_options to query_versions
So move it from dri_context to dri_screen.
This will be needed for version computations.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
f1f5366629 mesa: return version 0 if the computed core profile version is too low
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
7207830047 mesa: add _mesa_get_version, a ctx-independent variant of _mesa_compute_version
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
537cbb7e1a mesa: add a context-independent variant of _mesa_override_gl_version
v2: changed GLboolean -> bool

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
ee9a2b1ae9 mesa: make _mesa_init_constants context-independent and public
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
858452e542 mesa: make _mesa_init_extensions context-independent
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
35e755faa7 st/mesa: make st_init_limits context-independent
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
002211f9ee mesa: move ShaderCompilerOptions into gl_constants
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
5c69173907 st/mesa: make st_init_extensions context-independent
Setting Const.MaxSamples needed a rework, so that it doesn't call
st_choose_format, which depends on st_context.

Other than that, there is no change in functionality.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
d9a6f4360a mesa: make _mesa_override_glsl_version context-independent
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
c6cbde5008 gallium/stapi: move setting GL versions to the state tracker
All flags are set for st/mesa, so the state tracker doesn't have to check
them.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
0127d26e6c st/mesa: convert the ETC1 format to an uncompressed one if unsupported
I don't know of any hardware which supports it.
With this, GL_OES_compressed_ETC1_RGB8_texture is supported if RGBA8
is supported.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-08-11 21:53:57 +02:00
Marek Olšák
547e2880bc st/mesa: add st_context parameter to st_mesa_format_to_pipe_format
This will be used by the next commit.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-08-11 21:53:57 +02:00
Marek Olšák
3d56732c1f st/mesa: advertise ARB_ES3_compatibility if GLSL 3.30 and ETC2 are supported 2014-08-11 21:53:57 +02:00
Marek Olšák
463b0ea1f6 st/mesa: add support for ETC2 formats
The formats are emulated by translating them into plain uncompressed
formats, because I don't know of any hardware which supports them.

This is required for GLES 3.0 and ARB_ES3_compatibility (GL 4.3).
2014-08-11 21:53:57 +02:00
Marek Olšák
ddc8003c61 mesa: add helper _mesa_is_format_etc2
v2: renamed GLboolean -> bool

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-11 21:53:57 +02:00
Brian Paul
f24be73401 mesa: add missing GLAPIENTRY in copyimage.c
Fixes MinGW build.  Trivial.
2014-08-11 12:59:47 -06:00
Jason Ekstrand
f5cc3fdcf1 i965/cse: Don't eliminate instructions with side-effects
This casues problems when converting atomics to use the GRF.  Sometimes the atomic operation would get eaten by CSE when it shouldn't.

v2: Roll the has_side_effects check into is_expression

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-11 11:40:32 -07:00
Jason Ekstrand
34ee3f5a34 docs/GL3: Mark ARB_copy_image as implemented on i965 2014-08-11 11:26:14 -07:00
Jason Ekstrand
410fea8dd9 i965: Add support for ARB_copy_image
This, together with the meta path, provides a complete implemetation of
ARB_copy_image.

v2: Add a fallback memcpy path for when the texture is too big for the
    blitter
v3: Properly support copying between two places on the same texture in the
    memcpy fallback
v4: Properly handle blit between the same two images in the fallback path
v5: Properly handle blit between the same two compressed images in the
    fallback path
v6: Fix a typo in a comment

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-08-11 11:26:14 -07:00
Jason Ekstrand
8ad7c1903d mesa/meta: Add a partial implementation of CopyImageSubData
This provides an implementation of CopyImageSubData that works if both
textures are uncompressed.  This implementation works by using a
combination of texture views and BlitFramebuffer.  If one of the textures
is compressed, it returns false and the driver is expected to provide a
fallback.

v2: Don't leak fbo's

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>

v3: Change glGen/DeleteTextures to _mesa_Gen/DeleteTextures
2014-08-11 11:26:00 -07:00
Jason Ekstrand
80a8b020c0 mesa/meta: Make _mesa_meta_bind_fbo_image also take a framebuffer target
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-08-11 11:20:23 -07:00
Jason Ekstrand
41b6460e08 mesa: Add GL API support for ARB_copy_image
This adds the API entrypoint, error checking logic, and a driver hook for
the ARB_copy_image extension.

v2: Fix a typo in ARB_copy_image.xml and add it to the makefile
v3: Put ARB_copy_image.xml in the right place alphebetically in the
    makefile and properly prefix the commit message
v4: Fixed some line wrapping and added a check for null
v5: Check for incomplete renderbuffers

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>

v6: Update dispatch_sanity for the addition of CopyImageSubData
2014-08-11 11:20:23 -07:00
Matt Turner
23d782067a i965/fs: Keep track of the register that hold delta_x/delta_y.
They're needed in register allocation. Fixes a regression since
afe3d155.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78875
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 10:40:01 -07:00
Matt Turner
41bdad59ab i965: Mark branch unreachable in sampler state code.
Silences some uninitialized variable warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 10:40:01 -07:00
Brian Paul
904ed3b315 mesa: simplify _mesa_update_draw_buffers()
There's no need to copy the array of DrawBuffer enums to a temp array.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:51 -06:00
Brian Paul
39b40ad144 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>
2014-08-11 09:44:51 -06:00
Brian Paul
dd8f15a553 mesa: whitespace, 80-column wrapping in program.c
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
d8f7577d5f mesa: simplify/rename _mesa_init_program_struct()
No need to return a value.  Remove unused ctx parameter.  Remove
_mesa_ prefix since it's static.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
53b13b2ead st/mesa: use PRId64 for printing 64-bit ints
v2: use signed types/formats

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
80fa7fd23e mesa: use PRId64 for printing 64-bit ints
Silences MinGW warnings:
 warning: unknown conversion type character ‘l’ in format [-Wformat]
 warning: too many arguments for format [-Wformat-extra-args]

v2: use signed types/formats

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:44 -06:00
Brian Paul
a5743fdf7d mesa: define and use ALL_TYPE_BITS in varray.c code
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:37:50 -06:00
Brian Paul
288f887622 mesa: add comment that GL_CLIP_DISTANCE0 == GL_CLIP_PLANE0 in enable.c
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:37:50 -06:00
Maarten Lankhorst
4c16e6a8e0 configure.ac: Do not require llvm on x32
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2014-08-11 13:16:11 +02:00
Neil Roberts
1b417ea784 i965: Don't check for format differences when using the blorp blitter
Previously the blorp blitter wouldn't be used if the source and destination
buffer had a different format other than swizzling between RGB and BGR and
adding or removing a dummy alpha channel. However there's no reason why the
blorp code path can't be used to do almost all format conversions so this
patch just removes the checks. However it does explicitly disable converting
to/from MESA_FORMAT_Z24_UNORM_X8_UINT because there is a similar check
brw_blorp_copytexsubimage.

This doesn't cause any Piglit test regressions at least on Ivybridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 11:24:46 +01:00
Kenneth Graunke
9276ef6f41 i965/eu: Allow math on immediates on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
db64c2eee2 i965/eu: Update jump distance scaling for Broadwell.
Broadwell measures jump distances in bytes, so we need to scale by 16.

v2: Update the function in brw_eu.h, not in brw_eu_emit.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
82ddd517af i965/eu: Refactor jump distance scaling to use a helper function.
Different generations of hardware measure jump distances in different
units.  Previously, every function that needed to set a jump target open
coded this scaling, or made a hardcoded assumption (i.e. just used 2).

Most functions start with the number of instructions to jump, and scale
up to the hardware-specific value.  So, I made the function match that.

Others start with a byte offset, and divide by a constant (8) to obtain
the jump distance.  This is actually 16 / 2 (the jump scale for Gen5-7).

v2: Make the helper a static inline defined in brw_eu.h, instead of
    an actual function in brw_eu_emit.c (as suggested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
a1c899c718 i965/eu: Set UIP on ELSE instructions on Broadwell.
Broadwell adds UIP on ELSE instructions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
7d41170b62 i965/eu: Make it clear that brw_patch_break_count only runs on Gen4-5.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
0457464c33 i965/eu: Make it clear that brw_find_loop_end only runs on Gen6+.
It has Gen6+ knowledge baked in, and indeed is only called for Gen6+,
but it wasn't immediately obvious that this was the case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
0d6adce469 i965/eu: Port Broadwell CMP destination type hack to brw_eu_emit.c.
See gen8_generator::CMP().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
49519a1b63 i965/eu: Explicitly disable instruction compaction on Broadwell for now.
Until now, it's been off implicitly: we never call the compactor
function.  When we merge the generators, we'll start calling it, so we
should make it do nothing.

Matt will enable instruction compaction properly later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:33 -07:00
Kenneth Graunke
8609df97a0 i965/eu: Use Haswell atomic messages on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:03:45 -07:00
Kenneth Graunke
e1bd2ca28a i965/eu: Change gen == 7 to gen >= 7 in a couple brw_eu_emit.c cases.
Broadwell is going to use the brw_eu_emit.c code soon.  We want to get
the fake MRF handling and URB HWord channel mask handling.

We don't need the CMP thread switch workaround, though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:01:52 -07:00
Ben Widawsky
38e181bad2 i965/clip: Removing scissor atom
Now that we no longer use ctx->DrawBuffer->_Xmin and related fields to
program the screen-space viewport extents, we don't depend on any
scissoring state.  So we can drop the +_NEW_SCISSOR dependency.

On GEN8, a change in scissor state does not effect anything for the
clipper/sf hardware state. The hardware will always do the right thing
once the viewport extents are programmed. We can therefore remove the
unecessary state emission.

Ken originally spotted this.

v2: Reword the commit message. Remove spurious hunk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
f6725d627c i965/guardband: Enable for all viewport dimensions (GEN8+)
The goal of guardband clipping is to try to avoid 3d clipping because it
is an expensive operation. When guardband clipping is disabled, all
geometry that intersects the viewport is sent to the FF 3d clipper.
Objects which are entirely enclosed within the viewport are said to be
"trivially accepted" while those entirely outside of the viewport are,
"trivially rejected".

When guardband clipping is turned on the above behavior is changed such
that if the geometry is within the guardband, and intersects the
viewport, it skips the 3d clipper. Prior to GEN8, this was problematic
if the viewport was smaller than the screen as it could allow for
rendering to occur outside of the viewport. That could be mitigated if
the programmer specified a scissor region which was less than or equal
to the viewport - but this is not required for correctness in OpenGL. In
theory you could be clever with the guardband so as not to invoke this
problem. We do not do this, and have no data that suggests we should
bother (nor the converse data).

With viewport extents in place on GEN8, it should be safe to turn on
guardband clipping for all cases

While here, add a comment to the code which confused me thoroughly.

v2: Update grammar in commit message. Reword comments based on Ken's
suggestion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
1a20e38ccf i965: Simplify viewport extents programming on GEN8
Viewport extents are a 3rd rectangle that defines which pixels get
discarded as part of the rasterization process. The actual pixels drawn
to the screen are an intersection of the drawing rectangle, the viewport
extents, and the scissor rectangle. It permits the use of guardband
clipping in all cases (see later patch). The actual pixels drawn to the
screen are an intersection of the drawing rectangle, the viewport
extents, and the scissor rectangle.

Scissor rectangle is not super important for this discussion as it should
always help do the right thing provided the programmer uses it.

switch (viewport dimensions, drawrect dimension) {
   case viewport > drawing rectangle: no effects; break;
   case viewport == drawing rectangle: no effects; break;
   case viewport < drawing rectangle:
      Pixels (after the viewport transformation but before expensive
      rastersizing and shading operations) which are outside of the
      viewport are discarded.
}

I am unable to find a test case where this improves performance, but in
all my testing it doesn't hurt performance, and intuitively, it should
not ever hurt performance. It also permits us to use the guardband more
freely (see upcoming patch).

v2: Updating commit message.

v3: Commit message updates requested by Ken

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
109d420f42 i965/guardband: Improve comments for guardband clipping
While working in this part of the code I had a great deal of trouble
understanding what it was trying to do, and matching it with the spec.
(mostly due bad wording in the PRM). To help future people, I've cleaned
up the wording and provided some ascii art.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-10 17:13:36 -07:00
Kenneth Graunke
31f1cbc24d i965: Support the allow_glsl_extension_directive_midshader option.
This adds support for Marek's new driconf parameter, which avoids
totally white rendering in Unigine Valley (which attempts to enable
the GL_ARB_sample_shading extension in an illegal place).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75664
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-10 16:22:31 -07:00
Connor Abbott
b6df68ba56 i965/fs: set virtual_grf_count in assign_regs()
This lets us call dump_instructions() after register allocation without
failing an assertion.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-08-10 15:00:53 -07:00
Connor Abbott
58007aec41 i965/fs: don't read from uninitialized memory while assigning registers
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-08-10 15:00:52 -07:00
Matt Turner
59a26a0554 i965/fs: Fix bad whitespace. 2014-08-10 15:00:52 -07:00
Niels Ole Salscheider
3d5e247de6 gallium/radeon: Set gpu_address to 0 if r600_virtual_address is false
Without this patch I get the following during DMA transfers:
[drm:radeon_cs_ib_chunk] *ERROR* Invalid command stream !
radeon 0000:01:00.0: CP DMA dst buffer too small (21475829792 4096)

This is a fixup for e878e154cd.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-10 12:54:34 +02:00
Marek Olšák
a65611f70a radeonsi: simplify constant buffer upload for big endian
Point util_memcpy_cpu_to_le32 to a buffer storage directly.

v2: simplify more

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-10 12:52:13 +02:00
Marek Olšák
b1843a2d2a winsys/radeon: fix compile warnings 2014-08-09 23:48:41 +02:00
Marek Olšák
b5f877ef7e r600g/compute: fix compile warnings
Trivial.
2014-08-09 23:41:16 +02:00
Marek Olšák
3d06952d9e r300g: handle new shader caps
Trivial.
2014-08-09 23:41:16 +02:00
Marek Olšák
955505f6ff 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 9b046474c9
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>
2014-08-09 23:41:16 +02:00
Marek Olšák
00ddf7a016 gallium/radeon: remove r600_resource_va
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:16 +02:00
Marek Olšák
8c235465cd gallium/radeon: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:16 +02:00
Marek Olšák
f6c392a270 r600g: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
1c03a690bf radeonsi: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
e878e154cd gallium/radeon: store VM address in r600_resource
This will help to get rid of the buffer_get_virtual_address calls.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
43b5c34cc3 r600g: remove useless r600_resource_va calls
R600-R700 don't support virtual memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
0e229b8c5a radeonsi: always prefer SWITCH_ON_EOP(0) on CIK
The code is rewritten to take known constraints into account, while always
using 0 by default.

This should improve performance for multi-SE parts in theory.

A debug option is also added for easier debugging. (If there are hangs,
use the option. If the hangs go away, you have found the problem.)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

v2: fix a typo, set max_se for evergreen GPUs according to the kernel driver
2014-08-09 23:41:15 +02:00
Marek Olšák
515269b3a7 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>
2014-08-09 23:41:15 +02:00
Marek Olšák
085a861545 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>
2014-08-09 23:41:15 +02:00
Marek Olšák
0b5d88a518 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>
2014-08-09 23:41:15 +02:00
Marek Olšák
56286834b8 st/mesa: fix DrawPixels(GL_STENCIL_INDEX)
This is a bug which was probably uncovered recently by Jason's commits
and broke this.

The problem is _mesa_base_tex_format(GL_STENCIL_INDEX) returns -1.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
88e0a2f88b st/mesa: dump TGSI before calling into the driver
If the driver crashes in create_xx_shader, you want to see the shader.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-09 23:41:15 +02:00
Jon TURNEY
a2e1dc0cce 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>
2014-08-09 11:18:31 +01:00
Eric Anholt
7b4b60b7e5 vc4: Add support for the COS instruction. 2014-08-08 18:59:47 -07:00
Eric Anholt
663ffff0e7 vc4: Add support for the SIN instruction.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
d815b2490b vc4: Fix register aliasing for packing of scaled coordinates.
Fixes glean fragProg1's "ADD test" and likely many others.
2014-08-08 18:59:47 -07:00
Eric Anholt
9492eb588d vc4: Add some debug code for forcing fragment shader output color. 2014-08-08 18:59:47 -07:00
Eric Anholt
961715eab2 u_primconvert: Copy min/max_index from the original primitive.
These values are supposed to be the minimum/maximum index values used to
read from the vertex buffers.  This code either copies index values out of
the old IB (so, same min/max as the original draw call), or generates a
new IB (using index values between the start and the start + count of the
old array draw info, which just happens to be what min/max_index are set
to by st_draw.c).

We were incorrectly setting the max_index in the
converting-from-glDrawArrays case to the start vertex plus the number of
vertices generated in the new IB, which broke QUADS primitive conversion
on VC4 (where max_index really has to be correct, or the kernel might
reject your draw call due to buffer overflow).

Reviewed-by: Rob Clark <robclark@freedesktop.org> (from verbal description
             of the patch)
2014-08-08 18:59:47 -07:00
Eric Anholt
1d03692f78 vc4: Fix using and emitting the 1/W from the vertex/coord shaders.
v2: Rebase on helpers change.
2014-08-08 18:59:47 -07:00
Eric Anholt
88bc5baa00 vc4: Add support for swizzles of 32 bit float vertex attributes.
Some tests start working (useprogram-flushverts, for example) due to
getitng the right vertices now.  Some that used to pass start failing with
memory overflow during binning, which is weird (glsl-fs-texture2drect).
And a couple stop rendering correctly (glsl-fs-bug25902).

v2: Move the attribute format setup in the key from after search time to
    before the search.
v3: Fix reading of attributes other than position (I forgot to respect
    attr and stored everything in inputs 0-3, i.e. position).
2014-08-08 18:59:47 -07:00
Eric Anholt
f069367f39 vc4: Add support for the TGSI FRC opcode.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
bf542cd372 vc4: Add support for the TGSI TRUNC opcode.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
399285403a vc4: Crank up the tile allocation BO size
This avoids a simulator assertion failure with glamor.  I need to actually
support resize, though.
2014-08-08 18:59:47 -07:00
Eric Anholt
75afa64ef8 vc4: Add support for multiple attributes 2014-08-08 18:59:47 -07:00
Eric Anholt
32948ca768 vc4: Add more useful debug for the undefined-source case
We could get undefined sources in real programs from the wild, so we'll
need to turn off this debug eventually.  But for now, using undefined
sources is typically me just mistyping something.
2014-08-08 18:59:47 -07:00
Eric Anholt
6ff2129d58 vc4: Add support for the lit opcode.
v2: Fix how it was using the X channel for the real work of the opcode,
    instead of Y.  Fixes glean's LIT test.
v3: Rebase on the helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
63e49da0a5 vc4: Add support for the POW opcode
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
0e182e7d8f vc4: Refactor uniform handling.
I wanted an easy way to set up new uniforms every time, so I could handle
texture-sampler-related uniforms.

v2: Rebase on helpers change.
2014-08-08 18:59:47 -07:00
Eric Anholt
6c185bd263 vc4: Add support for the LRP opcode.
v2: Rebase on helpers, cutting out most of the code in this change.
2014-08-08 18:59:47 -07:00
Eric Anholt
ec9da314ba vc4: Add copy propagation between temps.
We put in a bunch of extra MOVs for program outputs, and this can clean
those up.  We should do uniforms, too, though.

v2: Fix missing flagging of progress when we actually optimize.  Caught by
    Aaron Watry.
2014-08-08 18:59:47 -07:00
Eric Anholt
d9d1c14430 vc4: Add dead code elimination.
This cleans up a bunch of noise in the compiled coordinate shaders (since
we don't need the varying outputs), and also from writemasked instructions
with negated src operands.
2014-08-08 18:59:47 -07:00
Eric Anholt
1d23d55ae9 vc4: Add an initial pass of algebraic optimization.
There was a lot of extra noise in my piglit shader dumps because of silly
CMPs.
2014-08-08 18:59:47 -07:00
Eric Anholt
4c53087c67 vc4: Add support for CMP.
This took a couple of tries, and this is the squash of those attempts.

v2: Fix register file conflicts on the args in the
    destination-is-accumulator case.
v3: Rebase on helper change and qir_inst4 change.
2014-08-08 18:59:47 -07:00
Eric Anholt
eea1d36915 vc4: Make scheduling of NOPs a separate step from QIR -> QPU translation.
This should also be used as a way to pair QIR instructions into QPU
instructions later.
2014-08-08 18:59:46 -07:00
Eric Anholt
c293927511 vc4: Add WIP support for varyings.
It doesn't do all the interpolation yet, but more tests can run now.

v2: Rebase on helpers.
2014-08-08 18:59:46 -07:00
Eric Anholt
db9f41ea88 vc4: Use r3 instead of r5 for temps, since r5 only has 32 bits of storage
Reserving a whole accumulator for temps is awful in the first place, but
I'll fix that later.
2014-08-08 18:59:46 -07:00
Eric Anholt
23b2bad991 vc4: Fix emit of ABS
v2: Rebase on qir helpers.
2014-08-08 18:59:46 -07:00
Eric Anholt
cf2d777fbe vc4: Add shader variant caching to handle FS output swizzle. 2014-08-08 18:59:46 -07:00
Eric Anholt
6cf86dd487 vc4: Load the tile buffer before incrementally drawing.
We will want to occasionally disable this again when we do clear support.

v2: Squash with the previous commit (I accidentally committed at two
    stages of writing the change)
2014-08-08 18:59:46 -07:00
Eric Anholt
c3f96060a8 vc4: Don't reallocate the tile alloc/state bos every frame.
This was a problem for the simulator since we don't free memory back to
it, and it would soon just run out.
2014-08-08 18:59:46 -07:00
Eric Anholt
21db430210 vc4: Add VC4_DEBUG env option
v2: Fix an accidental deletion of some characters from the copyright
    message (caught by Ilia Mirkin)
2014-08-08 18:59:46 -07:00
Eric Anholt
2e35981d4d vc4: Add support for SNE/SEQ/SGE/SLT. 2014-08-08 18:59:46 -07:00
Eric Anholt
7108c24fd0 vc4: Use the user's actual first vertex attribute.
This is hardcoded to read it as RGBA32F so far, but starts to get more
tests working.
2014-08-08 18:59:46 -07:00
Eric Anholt
427f934f9e vc4: Fix UBO allocation when no uniforms are used.
We do rely on a real BO getting allocated, so make sure we ask for a non-zero size.
2014-08-08 18:59:46 -07:00
Eric Anholt
db8712bcbc vc4: Add initial support for math opcodes 2014-08-08 18:59:46 -07:00
Eric Anholt
792d1c92df vc4: Switch to actually generating vertex and fragment shader code from TGSI.
This introduces an IR (QIR, for QPU IR) to do optimization on.  It's a
scalar, SSA IR in general.  It looks like optimization is pretty easy this
way, though I haven't figured out if it's going to be good for our weird
register allocation or not (or if I want to reduce to basically QPU
instructions first), and I've got some problems with it having some
multi-QPU-instruction opcodes (SEQ and CMP, for example) which I probably
want to break down.

Of course, this commit mostly doesn't work, since many other things are
still hardwired, like the VBO data.

v2: Rewrite to use a bunch of helpers (qir_OPCODE) for emitting QIR
    instructions into temporary values, and make qir_inst4 take the 4 args
    separately instead of an array (all later callers wanted individual
    args).
2014-08-08 18:59:46 -07:00
Eric Anholt
e59890aebb vc4: Start converting the driver to use vertex shaders.
Note: This is the cutoff point where I switched from developing primarily
on the Pi to developing o the simulator.  As a result, from this point on
the code is untested on the Pi (the kernel code I have currently wasn't
rendering anything at this commit, though the simulator renders
successfully, suggesting kernel bugs).
2014-08-08 18:59:46 -07:00
Eric Anholt
1850d0a1cb vc4: Initial skeleton driver import.
This mostly just takes every draw call and turns it into a sequence of
commands that clear the FBO and draw a single shaded triangle to it,
regardless of the actual input vertices or shaders.  I copied the initial
driver skeleton mostly from freedreno, and I've preserved Rob Clark's
copyright for those.  I also based my initial hardcoded shaders and
command lists on Scott Mansell (phire)'s "hackdriver" project, though the
bit patterns of the shaders emitted end up being different.

v2: Rebase on gallium megadrivers changes.
v3: Rebase on PIPE_SHADER_CAP_MAX_CONSTS change.
v4: Rely on simpenrose actually being installed when building for
    simulation.
v5: Add more header duplicate-include guards.
v6: Apply Emil's review (protection against vc4 sim and ilo at the same
    time, and dropping the dricommon drm bits) and fix a copyright header
    (thanks, Roland)
2014-08-08 18:59:46 -07:00
Roland Scheidegger
f017e32c0a draw: (trivial) use information about gs being present from variant key
This is a purely cosmetic change.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-09 03:52:58 +02:00
Roland Scheidegger
6d2ecdb4a6 draw: don't use clipvertex output if user plane clipping is disabled
The non-llvm path made sure that both clip and pre_clip_pos point to the data
output by position, not clipvertex, if user based clipping is disabled.
However, the llvm path did not, which apparently led to failures if
gl_ClipVertex was written but user plane clipping not enabled (bug 80183).
Why I have no idea really, but just make it match the non-llvm behavior...

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-09 03:52:58 +02:00
Chris Forbes
0f4c5a70c6 i965: Get rid of backend_instruction::sampler
The generators no longer use this.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:35 +12:00
Chris Forbes
298da9fa2a i965/vec4/Gen8: Use src1 for sampler_index instead of ->sampler field
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:33 +12:00
Chris Forbes
6be68767b9 i965/vec4/Gen4-7: Use src1 for sampler_index instead of ->sampler field
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:31 +12:00
Chris Forbes
1a3fd11aef i965/vec4: Pass sampler index in src1 for texture ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:29 +12:00
Chris Forbes
2f4e12a835 i965/vec4: Collect all emits of texture ops into one place
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:27 +12:00
Chris Forbes
db09fd5957 i965/fs/Gen8: Pass sampler_index to generate_tex
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:25 +12:00
Chris Forbes
ba5f7a361a i965/fs/Gen4-7: Pass sampler_index to generate_tex
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:23 +12:00
Chris Forbes
191bc64f82 i965/blorp: Put sampler index in src1 of texture ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:21 +12:00
Chris Forbes
a578592fd2 i965/fs: pass sampler as src1 of texture op
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:17 +12:00
Chris Forbes
f6a0192f7d i965/fs: Collect all emits of texture ops for Gen5/6 into one place
Reduces duplication, and will do so even more when we change the sampler
plumbing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:13 +12:00
Chris Forbes
d1b136fdd0 i965/fs: Collect all emits of texture ops for Gen4 into one place
Reduces duplication, and will do so even more when we change the sampler
plumbing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:11:33 +12:00
Pali Rohár
39a4cc45a4 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>
2014-08-08 19:26:39 +01:00
Emil Velikov
16826a36ef util: remove ralloc_test
The tests in an empty stub, which we're currently building twice.
If anyone is interested in expanding it (adding actual tests) they
can always bring it back.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-08 19:23:25 +01:00
Darius Goad
5492296318 gallivm: Handle MSAA textures in emit_fetch_texels
This support is preliminary due to the fact that MSAA is not
actually implemented.

However, this patch does fix the piglit test:
spec/!OpenGL 3.2/glsl-resource-not-bound 2DMS (bug #79740).

(v2 RS: don't emit 4th coord as explicit lod)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-08 18:54:08 +02:00
Roland Scheidegger
394ea139c7 draw: hack around weird primitive id input in gs
The distinction between system values and ordinary inputs is not very
obvious in gallium - further fueled by the fact that they use the same
semantic names.
Still, if there's any value which imho really is a system value, it's the
primitive id input into the gs (while earlier (tessleation) stages could read
it, it is _always_ generated by the system). For some odd reason though (which
I'd classify as a bug but seems too complicated to fix) the glsl compiler in
mesa treats this as an ordinary varying, and everything else after that
(including the state tracker and other drivers) just go along with that.
But input fetching in gs for llvm based draw was definitely limited to the
ordinary (2-dimensional) inputs so only worked with other state trackers,
the code was also additionally relying on tgsi_scan_shader filling
uses_primid correctly which did not happen neither (would set it only for
all stages if it was a system value, but only set it for the fragment shader
if it was an input value).
This fixes piglit glsl-1.50-geometry-primitive-id-restart and primitive-id-in
in llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-08 18:54:08 +02:00
Roland Scheidegger
92a059d294 draw: fix prim id float cast for non-llvm path
These values are always uints, casting them to floats does no good.
Fixes piglit glsl-1.50-geometry-primitive-id-restart tests for softpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-08 18:54:07 +02:00
Bruno Jiménez
ec73778f1f clover: Add support for CL_MAP_WRITE_INVALIDATE_REGION
OpenCL 1.2 CL_MAP_WRITE_INVALIDATE_REGION sounds a lot like
PIPE_TRANSFER_DISCARD_RANGE:

From OpenCL 1.2 spec:
    The contents of the region being mapped are to be discarded.

From p_defines.h:
    Discards the memory within the mapped region.

v2: Move the code for validating flags to the front-end as
    suggested by Francisco Jerez

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-08 18:06:14 +03:00
Chia-I Wu
8d853468bd ilo: break down the format table
The PRMs no longer have a single table for format capabilities.  Multiple
tables take up less space, and are easier to maintain.

Encode typed write information while at it.
2014-08-08 20:23:56 +08:00
Kenneth Graunke
ae95b9dd9b i965: Emit a performance warning on conditional rendering.
We have a CPU-side implementation of conditional rendering; it really
should be done on the GPU.  It's not necessarily that hard, but nobody
has gotten to fixing it yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-08 00:52:10 -07:00
Kenneth Graunke
e9a9d441f0 i965: Set ExecSize to 16 for loop instructions in SIMD16 shaders.
Previously, we explicitly set the execution size to BRW_EXECUTE_8 and
disabled compression for loop instructions.  I can't imagine how this
could be correct in SIMD16 mode.

Looking at the history, it appears that this code has used BRW_EXECUTE_8
since 2007, when we had a SIMD8 backend that supported control flow and
a separate SIMD16 backend that didn't.  Presumably, when we added SIMD16
support for shaders with control flow, we simply neglected to update it.

Note that Gen4-5 don't support SIMD16 on shaders with control flow.

This might be a candidate for stable, but would need to be rewritten
completely due to the brw_inst API changes in master.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:50 -07:00
Kenneth Graunke
e64dbd050d i965/eu: Merge brw_CONT and gen6_CONT.
The only difference is setting PopCount on Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:44 -07:00
Kenneth Graunke
e7a7b3317c i965/eu: Drop redundant brw_set_src0/brw_set_dest from gen6_CONT.
We shouldn't need to set them, then set them differently.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:34 -07:00
Juha-Pekka Heikkila
d64be94294 util: add src/util/format_srgb.c to .gitignore
format_srgb.c is generated by format_srgb.py python script, having
format_srgb.c in git ignore list will silence git complaints about
untracked file.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-08 09:49:52 +03:00
Ian Romanick
89d92fc00e mesa: Fold _mesa_uniform_merge_location_offset into its only caller
Also delete the comment before that function.  Everything in that
comment was either stale, wrong, or captured elsewhere.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:55 -07:00
Ian Romanick
1c759e32d8 mesa: Fold _mesa_uniform_split_location_offset into its only caller
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:53 -07:00
Ian Romanick
e0c867372a glsl_to_tgsi: Delete unused function set_uniform_initializer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:50 -07:00
Ian Romanick
8f81f4e185 mesa: Use MAX2 to calculate maximum uniform element
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:48 -07:00
Ian Romanick
411abcb237 mesa: Have validate_uniform_parameters return the gl_uniform_storage pointer
This simplifies all the callers, and it enables the removal of one of
the function parameters.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:45 -07:00
Carl Worth
f28a105868 glsl/glcpp: Rename one test to avoid a duplicate test number
With two tests both numbered 118, there was a confusing off-by-two difference
between the last test number and the total number of tests (as reported by
glcpp-test).

With this rename, there's only an off-by-one difference left, (which is easy
to understand given the zero-based test numbering).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
41540997fb glsl/glcpp: Fix handling of commas that result from macro expansion
Here is some additional stress testing of nested macros where the expansion
of macros involves commas, (and whether those commas are interpreted as
argument separators or not in subsequent function-like macro calls).

Credit to the GCC documentation that directed my attention toward this issue:

	https://gcc.gnu.org/onlinedocs/gcc-3.2/cpp/Argument-Prescan.html

Fixing the bug required only removing code from glcpp. When first testing the
details of expansions involving commas, I had come to the mistaken conclusion
that an expanded comma should never be treated as an argument separator, (so
had introduced the rather ugly COMMA_FINAL token to represent this).

In fact, an expanded comma should be treated as a separator, (as tested here),
and this treatment can be avoided by judicious use of parentheses (as also
tested here).

With this simple removal of the COMMA_FINAL token, the behavior of glcpp
matches that of gcc's preprocessor for all of these hairy cases.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
318369aceb glsl/glcpp: Integrate recent glcpp-test-cr-lf test into "make check"
Beyond just listing this in the TESTS variable in Makefile.am, only minor
changes were needed to make this work. The primary issue is that the build
system runs the test script from a different directory than the script
itself. So we have to use the $srcdir variable to find the test input files.

Using $srcdir in this way also ensures that this test works when using an
out-of-tree build.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
7ba74c65a7 glsl/glcpp: Fix glcpp-test to correctly extract test-specific arguments
The (optional) test-specific command-line arguments to be passed to glcpp are
embedded within the source files of some tests, and glcpp-test uses grep to
extract them.

Of course, grep is line-based and looks for the native line-separator to
determine line boundaries. So, for files using non-native line separators,
grep was getting quite confused and passing bogus arguments to glcpp.

Fix this by canonical-izing the line separators in the source file prior to
using grep.

With this commit, the glcpp-test-cr-lf tests pass entirely:

	\r:	143/143 tests pass
	\r\n:	143/143 tests pass
	\n\r:	143/143 tests pass

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
f1340745c0 glsl/glcpp: Fix line-continuation code to handle multiple newline flavors
Sometimes the newline separator is a single character, and sometimes it is two
characters. Before we can fold away and line-continuation backslashes, we
identify the flavor of line separator that is in use.

With this identified, we then correctly search for backslashes followed
immediately by the first character of the line separator.

Also, when re-inserting newlines to replace collapsed newlines, we carefully
insert newlines of the same flavor.

With this commit, almost all remaining test are fixed as tested by
glcpp-test-cr-lf:

	\r:	142/143 tests pass
	\r\n:	142/143 tests pass
	\n\r:	143/143 tests pass

(The only remaining failures have nothing to do with the actual pre-processor
code, but are due to a bug in the way the test suite uses grep to try to
extract test-specific command-line options from the source files.)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
ec69e00843 glsl/glcpp: Don't include any newline characters in #error token
Some tests were failing because the message printed by #error was including a
'\r' character from the source file in its output.

This is easily avoided by fixing the regular expression for #error to never
include any of the possible newline characters, (neither '\r' nor '\n').

With this commit 2 tests are fixed for each of the '\r' and '\r\n' cases.

Current results after the commit are:

	\r:	137/143 tests pass
	\r\n	142/143 tests pass
	\n\r:	139/143 tests pass

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
04e40fd337 glsl/glcpp: Treat CR+LF pair as a single newline
The GLSL specification says that either carriage-return, line-feed, or both
together can be used to terminate lines. Further, it says that when used
together, the pair of terminators shall be interpreted as a single line.

This final requirement has not been respected by glcpp up until now, (it has
been emitting two newlines for every CR+LF pair).

Here, we fix the lexer by using a regular expression for NEWLINE that eats
up both "\r\n" (or even "\n\r") if possible before also considering a single
'\n' or a single '\r' as a line terminator.

Before this commit, the test results are as follows:

	\r:	135/143 tests pass
	\r\n:	  4/143 tests pass
	\n\r:	  4/143 tests pass

After this commit, the test results are as follows:

	\r:	135/143 tests pass
	\r\n:	140/143 tests pass
	\n\r:	139/143 tests pass

So, obviously, a dramatic improvement.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
f4ddd026c6 glsl/glcpp: Add test script for testing various line-termination characters
The GLSL specification has a very broad definition of what is a
newline. Namely, it can be the carriage-return character, '\r', the newline
character, '\n', or any combination of the two, (though in combination, the
two are treated as a single newline).

Here, we add a new test-runner, glcpp-test-cr-lf, that, for each possible
line-termination combination, runs through the existing test suite with all
source files modified to use those line-termination characters. Instead of
using the .expected files for this, this script assumes that the regular test
suite has been run already and expects the output to match the .out
files. This avoids getting 4 test failures for any one bug, and instead will
hopefully only report bugs actually related to the line-termination
characters.

The new testing is not yet integrated into "make check". For that, some
munging of the testdir option will be necessary, (to support "make check" with
out-of-tree builds). For now, the scripts can just be run directly by hand.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
218e878b54 glsl/glcpp: Fix for macros that expand to include "defined" operators
Prior to this commit, the following snippet would trigger an error in glcpp:

	#define FOO defined BAR
	#if FOO
        #endif

The problem was that support for the "defined" operator was implemented within
the grammar, (where the parser was parsing the tokens of the condition
itself). But what is required is to interpret the "defined" operator that
results after macro expansion is performed.

I could not find any fix for this case by modifying the grammar alone. The
difficulty is that outside of the grammar we already have a recursive function
that performs macro expansion (_glcpp_parser_expand_token_list) and that
function itself must be augmented to be made aware of the semantics of the
"defined" operator.

The reason we can't simply handle "defined" outside of the recursive expansion
function is that not only must we scan for any "defined" operators in the
original condition (before any macro expansion occurs); but at each level of
the recursive expansion, we must again scan the list of tokens resulting from
expansion and handle "defined" before entering the next level of recursion to
further expand macros.

And of course, all of this is context dependent. The evaluation of "defined"
operators must only happen when we are handling preprocessor conditionals,
(#if and #elif) and not when performing any other expansion, (such as in the
main body).

To implement this, we add a new "mode" parameter to all of the expansion
functions to specify whether resulting DEFINED tokens should be evaluated or
ignored.

One side benefit of this change is that an ugly wart in the grammar is
removed. We previously had "conditional_token" and "conditional_tokens"
productions that were basically copies of "pp_token" and "pp_tokens" but with
added productions for the various forms of DEFINED operators. With the new
code here, those ugly copy-and-paste productions are eliminated from the
grammar.

A new "make check" test is added to stress-test the code here.

This commit fixes the following Khronos GLES3 CTS tests:

	conditional_inclusion.basic_2_vertex
	conditional_inclusion.basic_2_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
a48ff781c1 glsl/glcpp: Swallow empty #pragma directives.
Previously, we were passing these through, just like any other pragma. But the
downstream compiler was tripping up on them. It seems easier to swallow these
in the preprocessor and not pass them on at all rather than fixing the
downstream compiler.

This fixes the following Khronos GLES3 CTS tests:

	preprocessor.pragmas.pragma_vertex
	preprocessor.pragmas.pragma_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
bf9bce5bea glsl/glcpp: Fix #pragma to not over-increment the line-number count
Previously, the #pragma directive was swallowing an entire line, (including
the final newline). At that time it was appropriate for it to increment the
line count.

More recently, our handling of #pragma changed to not include the newline. But
the code to increment yylineno stuck around. This was causing __LINE__ to be
increased by one more than desired for every #pragma.

Remove the bogus, extra increment, and add a test for this case.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
9a54b07651 glsl/glcpp: Add testing for null directives with spaces and comments
This new "make check" test stresses out the support from the last two commits,
(to esnure that '#' is correctly interpreted as the null directives,
regardless of any whitespace or comments on the same line).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
c0127c30dd glsl/glcpp: Fix NULL directives when followed by a single-line comment
This is the fix for the following line:

	#  // comment to ignore here

According to the translation-phase rules, the comment should be removed before
the preprocessor looks to interpret the null directive.

So in our implementation we must explicitly look for single-line comments in
the <HASH> start condition as well.

This commit fixes the following Khronos GLES3 CTS tests:

	null_directive_vertex
	null_directive_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
e84e159caa glsl/glcpp: Add tests for #define followed by comments
This simply tests the previous commit, (that #define followed by a comment
will still generate the expected "#define without macro name" error message).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
b4b2a5c3f3 glsl/glcpp: Allow single-line comments immediately after #define
We were already correctly supporting single-line comments in case like:

	#define FOO bar // comment here...

The new support added here is simply for the none-too-useful:

	#define // comment instead of macro name

With this commit, this line will now give the expected "#define without
macro name" error message instead of the lexer just going off into the
weeds.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
b76482e731 glsl/glcpp: Add test for "#define without macro name"
This ensures that the previous commit indeed generates the expected error
message when a "#define" directive is not followed by anything except for a
newline.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:28 -07:00
Carl Worth
a196ab1f8a glsl/glcpp: Add explicit error for "#define without macro name"
Previously, glcpp would emit an error like this if <EOF> happened to occur
immediately after the "#define", but in general would just get confused,
(leading to un-helpful error messages).

To fix things to generate a clean error message, we do a few things:

	1. Don't require horizontal whitespace immediately after #define

	2. Add a production for the error case, (DEFINE_TOKEN followed
	   immediately by a NEWLINE token).

	3. Make the lexer reset to the <INITIAL> state after every NEWLINE.

This 3rd point prevents the lexer from getting so confused and generating
further spurious errors in the file because it was stuck in the <DEFINE> start
condition.

We also drop the similar error message from the <EOF> rule since the
newly-added rule will have already printed the error message.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:28 -07:00
Matt Turner
b6ab52b7f9 docs: List GL+GLSL versions as parts of a whole.
Listing the GLSL version as an individual component of a GL version,
separate from the extensions isn't really right. The GLSL changes are
(almost?) entirely comprised of changes listed in the extensions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-07 16:00:24 -07:00
Matt Turner
bbd5dd5226 i965/vec4: Remove unused emit_bool_comparison method.
Apparently unused since it was added in commit af3c9803.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-07 16:00:24 -07:00
Matt Turner
50d5fc192b mesa: Drop USE_IEEE define.
I think OpenVMS was the only platform that Mesa ran on that used a
non-IEEE representation for floats. We removed OpenVMS support a while
back, and this should alleviate the need to continue updating the
this-platform-uses-IEEE list.

The one bit of this patch that needs review is the IS_INF_OR_NAN,
because I'm not sure if MSVC supports isfinite.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82268
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-07 16:00:24 -07:00
Ian Romanick
4837b130a7 mesa: Group gl_system_value values by the stage where they exist
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:59 -07:00
Ian Romanick
5d7275c350 glsl_to_tgsi: Assert that the _mesa_sysval_to_semantic mapping is correct
Future patches will rearrange the values in gl_system_value, and I want
to catch errors.  Designated initializers would make all of this
unnecessary.

v2: Don't use STATIC_ASSERT.  Not only does it not work, but GCC doesn't
tell you that it's not going to work.  Thanks for nothing!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:57 -07:00
Ian Romanick
21ef7f58e3 mesa/st: Only one copy of mesa_sysval_to_semantic
Future patches will necessitate changes to the table, and I only want to
update one.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:55 -07:00
Ian Romanick
1c887ae6e2 glsl_to_tgsi: Constify mesa_sysval_to_semantic
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:53 -07:00
Kenneth Graunke
b7679639bc 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>
2014-08-07 13:22:52 -07:00
Tapani Pälli
151fb1e808 glsl: support unsigned increment in ir_loop controls
Current version can create ir_expression where operands have
different base type, patch adds support for unsigned type.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
https://bugs.freedesktop.org/show_bug.cgi?id=80880
2014-08-07 07:31:49 +03:00
Jason Ekstrand
787bac3808 mesa/formats: Fix the size of ETC2_SRGB8_PUNCHTHROUGH_ALPHA1
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-06 15:15:53 -07:00
Jason Ekstrand
bb89d82ac4 mesa/formats: Use the correct swizzle parameter for the 11-bit EAC formats
Red-only formats should be x001 and RG formats should be xy01.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-06 15:15:44 -07:00
Roland Scheidegger
6e9005e8b0 draw: fix clipvertex trouble if position comes from gs
If the vertex shader has no position but the gs has, the clipvertex output
was -1 (because it's the same as vs position in this case if there's no
explicit clipvertex output). This caused crashes (or assertion failures) in
clipping since in the end position (which came from gs) was different from
cv (-1) and we then tried to use the bogus cv input.
Rather than just test for -1 cv value in clipping, make it explicitly return
the position output of the gs instead which seems cleaner (since we really
don't want to use the clipvertex value from the vs (it could be a valid value
in the (unsupported) case of vs writing clipvertex but still using a gs).
This fixes piglit shader_runner clip-distance-out-values.shader_test.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-08-06 18:01:33 +02:00
Roland Scheidegger
11bd6f0e9b draw: don't run pipeline stages when gs has no position output
The clip stage may crash if there's no position output, for this reason
code was added to avoid running the pipeline stages in this case
(c7c7186045). However, this failed to actually
work when there was a geometry shader, since unlike the vertex shader it did
not initialize the position output to -1, hence the code trying to detect
this didn't trigger. So simply initialize the position output to -1 just like
the vs does.
This fixes piglit glsl-1.50-transform-feedback-type-and-size (segfault->pass).
clip-distance-out-values.shader_test goes from segfault to assertion failure,
suggesting more fixes are needed, no other piglit changes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-08-06 18:01:33 +02:00
Vinson Lee
c40d7d6d94 dri/xmlconfig: s/uint/unsigned int/
This patch fixes this build error on Mac OS X.

./xmlconfig.h:61:5: error: unknown type name 'uint'; did you mean 'int'?
    uint nRanges;         /**< \brief Number of ranges */
    ^~~~
    int
./xmlconfig.h:79:5: error: unknown type name 'uint'; did you mean 'int'?
    uint tableSize;
    ^~~~
    int

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 16:52:42 -07:00
Brian Paul
1125d021de mesa include stdint.h in formats.h
To get uint8_t type, to fix MSVC build.
Trivial.
2014-08-05 13:07:46 -06:00
Jason Ekstrand
fc2b2d337e mesa/texstore: Add a generic rgba integer texture upload path
Again, we delete a lot of functions that aren't really doing anything
interesting anymore.

v2: Comment the texstore_rgba_integer function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
d267b75715 mesa/texstore: Add a generic float/normalized rgba texture upload path
This commit also removes a bunch of functions which aren't doing anything
more interesting than the general path does.

v2: Better comment the texstore_via_float function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
3dbf5bf657 mesa/texstore: Use _mesa_swizzle_and_convert when possible
This should be both faster and more accurate than our general slow-path of
converting everything to float.

v2: Add a comment to top of the texstore_swizzle function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
4c8fc26835 main/texstore: Split texture storage into three functions
This commit splits the texture storage into three functions:
texstore_depth_stencil, texstore_compressed, and texstore_rgba.  Right now
this split seems artificial since we just have one function pointer per
format and there is no difference between these three categories.  However,
this split makes it much easier to write a more general function upload
path for one of these categories than the current function pointers.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
6b912dc129 mesa/format_utils: Add a function to convert a mesa_format to an array format
This commits adds the _mesa_format_to_array function that determines if the
given format can be represented as an array format and computes the array
format parameters. This is a direct helper function for using
_mesa_swizzle_and_convert

v2: Better documentation and commit message
v3: Fixed a potential segfault from an invalid endianness swizzle

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
d55f77b503 mesa/format_utils: Add a general format conversion function
Most format conversion operations required by GL can be performed by
converting one channel at a time, shuffling the channels around, and
optionally filling missing channels with zeros and ones.  This adds a
function to do just that in a general, yet efficient, way.

v2:
 * Add better comments including full docs for functions
 * Don't use __typeof__
 * Use inline helpers instead of writing out conversions by hand,
 * Force full loop unrolling for better performance

v3: Add another set of parens around the MAX_INT macro

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
452d64986b mesa/imports: Add a _mesa_half_is_negative helper function
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
850fb0d1dc mesa/formats: Add layout and swizzle information
v2: Move the MESA_FORMAT_SWIZZLE enum to the top of the file

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
55a929955f mesa/formats: Remove IndexBits
Mesa hasn't supported color-indexed textures for some time.  This is 0 for
all texture formats, so we don't need to store it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
12610ffcf7 mesa/formats: Autogenerate the format_info structure from a CSV file
Instead of a having all of the format metadata in a gigantic hard-to-edit
array of type struct format_info, we now have a human-readable CSV file.
The CSV file also contains more format information than the format_info
struct contained so we can potentially make format_info more detailed later.

The python to generate the format information was added the previous
commit.  This commit turns it on in both automake and scons builds.

v2: Split into two commits and stuff to generate format_info.c from scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
3420565310 mesa/main: Add python code to generate the format_info structure
This adds a python script called format_info.py that is used to generate a
single format_info.c file that contains the filled-out format_info array.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
d4c780e052 mesa: Add python to parse the formats CSV file
The basic concept for the format parser was taken from the format CSV
parser in gallium/auxilliary/util.  However, this one has been altered in a
number of ways:

 * Removed big endian vs. little endian stuff (mesa doesn't need it)
 * Better documentation: Almost every method has a full docstring
 * An actual Swizzle class with methods for composition and inverses
 * Over-all cleaner (in my opinion) implementation and class interactions
 * A few bug fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
056cc47e12 mesa: Add a format description CSV file
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
1d47f67455 util/tests/hash_table: Link against libmesautil instead of libmesa
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82159

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-05 10:52:48 -07:00
Brian Paul
36de884ffd st/mesa: adjust Z coordinates for quad clearing
Specify the quad's Z position in clip coordinate space, not
normalized Z space.  Use viewport scale, translation = 0.5, 0.5.

Before, we were specifying the quad's Z position in [0,1] and using
viewport scale=1.0, translate=0.0.  That works fine, unless your
driver needs to work in clip coordinate space and needs to
reconstruct viewport near/far values from the scale/translation
factors.  The VMware svga driver falls into that category.

When we did that reconstruction we wound up with near=-1 and far=1
which are outside the limits of [0,1].  In some cases, this caused
the quad to be drawn at the wrong depth.  In other cases it was
clipped away.

Fixes some scissored depth clears with VMware driver.  This should
have no effect on other drivers.  We're already using these values
for the glBitmap and glDraw/CopyPixels code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-05 10:21:18 -06:00
Brian Paul
6719914f98 mesa: make vertex array type error checking a little more efficient
Compute the bitmask of supported array types once instead of every
time we call a GL vertex array function.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-08-05 10:18:34 -06:00
Michel Dänzer
3347c634d0 glsl_to_tgsi: Fix typo shader_program -> shader
This was a regression introduced by commit
f4b0ab7afd ('st/mesa: fix incorrect size
of UBO declarations') which caused an assertion failure while compiling
shaders of e.g. UE4 demos.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81834
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 23:34:00 +09:00
Brian Paul
8563335b65 mesa: update wglext.h to version 20140630
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:19:02 -06:00
Brian Paul
c344f45333 mesa: update glxext.h to version 20140725
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:18:58 -06:00
Brian Paul
d96607970b mesa: update glext.h to version 20140725
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:18:50 -06:00
Neil Roberts
816dbdb106 meta: Disable dithering during glBlitFramebuffer
According to the GL spec the only fragment operations that should affect
glBlitFramebuffer are “the pixel ownership test, the scissor test, and sRGB
conversion”. That implies that dithering should not be performed so we need to
disable it when implementing the blit with a render.

Before commit 05b52efbc9 the dithering state would be left as whatever the
application picks (the default being GL_TRUE) and after that commit it was
explicitly enabled. Neither of these were correct.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-05 14:48:15 +01:00
Emil Velikov
afcf5d33cf libgl-xlib: drop duplicate mesautil from scons build
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:35 +01:00
Emil Velikov
4f0f75deba llvmpipe/tests: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:32 +01:00
Emil Velikov
07a275991e gallium/tests: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:30 +01:00
Emil Velikov
692009cab1 targets/omx: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:27 +01:00
Emil Velikov
807b5467a3 targets/xvmc: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:53:43 +01:00
Jan Vesely
d0b4ac642b targets/clover: link against libmesautil.la
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-05 12:54:08 +09:00
Jan Vesely
e28136343b 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>
2014-08-05 12:52:56 +09:00
Roland Scheidegger
6b834af77e targets/dri: link with mesautil
Similar to other recent build fixes.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
9042e8863a gallium/docs: Document TEX2/TXL2/TXB2 instructions and fix up other tex doc
Add documentation for TEX2/TXL2/TXB2 tgsi opcodes. Also, the texture opcode
documentation wasn't very accurate so fix this up a bit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
c3c33756ff gallivm: fix cube map array (and cube map shadow with bias) handling
In particular need to handle TEX2/TXB2/TXL2 opcodes.
cube map shadow with bias already used TXB2 which didn't work before
at all, despite that there's by default no piglit change (but using
no_quad_lod and no_rho_opt indeed passes some more tex-miplevel-selection
tests).
The actual sampling code still won't handle cube map arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
ea05cfaaca llvmpipe: implement support for cube map arrays
This just covers the resource side of things, not the actual sampling.
Here things are trivial as cube map arrays are identical to 2d arrays in
all respects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 04:13:17 +02:00
Anuj Phogat
d308f57fe7 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>
2014-08-04 18:31:26 -07:00
Anuj Phogat
338fef61f8 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>
2014-08-04 17:19:42 -07:00
Anuj Phogat
4bab55c874 meta: Move the call to _mesa_get_format_datatype() out of switch
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:41 -07:00
Anuj Phogat
7de90890c6 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>
2014-08-04 17:19:41 -07:00
Anuj Phogat
9796a17265 meta: Initialize the variable in declaration statement
Saves one line of code :)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:20 -07:00
Anuj Phogat
c7def2257a 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>
2014-08-04 17:12:29 -07:00
Anuj Phogat
2fc4205461 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>
2014-08-04 17:12:23 -07:00
Anuj Phogat
938b3d0034 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>
2014-08-04 17:12:14 -07:00
Anuj Phogat
6df48ff27a 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>
2014-08-04 17:12:05 -07:00
Anuj Phogat
5c0d2a12f3 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>
2014-08-04 17:11:52 -07:00
Anuj Phogat
e0fe00eeac 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>
2014-08-04 17:11:44 -07:00
Anuj Phogat
2d362a6aee 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>
2014-08-04 17:11:34 -07:00
Anuj Phogat
845b5ec89f 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>
2014-08-04 17:11:25 -07:00
Anuj Phogat
3c7a0c690a 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>
2014-08-04 17:11:18 -07:00
Anuj Phogat
e27c9f3a02 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>
2014-08-04 17:11:10 -07:00
Anuj Phogat
ac2adf66c1 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>
2014-08-04 17:11:00 -07:00
Anuj Phogat
a94d78438d 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>
2014-08-04 17:10:48 -07:00
Ian Romanick
7b18983147 glsl: Rebuild the symbol table without unreachable symbols
Previously we had to keep unreachable global symbols in the symbol table
because the symbol table is used during linking.  Having the symbol
table retain pointers to freed memory... what could possibly go wrong?
At the same time, this meant that we kept live references to tons of
memory that was no longer needed.

New strategy:  destroy the old symbol table, and make a new one from the
reachable symbols.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 59 40,642,425,451       76,337,968       69,720,886     6,617,082            0
After  (32-bit): 46 40,661,487,174       75,116,800       68,854,065     6,262,735            0

Before (64-bit): 79 37,179,441,771      106,986,512       98,112,095     8,874,417            0
After  (64-bit): 64 37,200,329,700      104,872,672       96,514,546     8,358,126            0

A real savings of 846KiB on 32-bit and 1.5MiB on 64-bit.

v2: (by Kenneth Graunke) Just add the ir_function from the IR stream,
    rather than looking it up in the symbol table; they're now
    identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-04 15:48:09 -07:00
Kenneth Graunke
3d051772c8 glsl: Only create one ir_function for a given name.
Piglit's spec/glsl-1.10/linker/override-builtin-{const,uniform}-05 tests
do the following:

1. Call abs(float) - a built-in function.
2. Create a user-defined replacement for abs(float).
3. Call abs(float) again - now the user function.

At step 1, we created an ir_function which included the built-in
signature, added it to the symbol table, and emitted it into the IR
stream.

Then, when processing the function definition at step 2, we'd see that
there was already an ir_function.  But, since there were no user-defined
functions, we skipped over a bunch of code, and ended up creating a
second one.  This new ir_function shadowed the original in the symbol
table, but both ended up in the IR stream.

This results in an awkward situation where searching for an ir_function
via the symbol table, a forward linked list walk, and a reverse linked
list walk may return different ir_functions.  This seems undesirable.

This patch instead re-uses the existing ir_function, putting both
built-in and user-defined signatures in the same one.  The previous
patch's additional filtering ensures everything continues working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 15:48:06 -07:00
Kenneth Graunke
21129d4de3 glsl: Make it possible to ignore built-ins when matching signatures.
Historically, we've implemented the rules for overriding built-in
functions by creating multiple ir_functions and relying on the symbol
table to hide the one containing built-in functions.  That works, but
has a few drawbacks, so the next patch will change it.

Instead, we'll have a single ir_function for a particular name, which
will contain both built-in and user-defined signatures.  Passing an
extra parameter to matching_signature makes it easy to ignore built-ins
when they're supposed to be hidden.

I didn't add the parameter to exact_matching_signature since it wasn't
necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 15:47:06 -07:00
Kenneth Graunke
f82f2fb3dc mesa: Actually use the Mesa IR optimizer for ARB programs.
On Haswell, this cuts 1-3 instructions from 183 vertex shaders in
"Shadowrun Returns", "Shatter", and "Trine 2."  It adds 2 instructions
to a single fragment shader in "Closure."

total instructions in shared programs: 278803 -> 278546 (-0.09%)
instructions in affected programs:     41930 -> 41673 (-0.61%)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-04 15:43:56 -07:00
Ian Romanick
b48621c348 glsl: Do not add extra padding to structures
This code was attemping to align the base of the structure to the required
alignment of the structure.  However, it had two problems:

1. It was aligning the target structure member, not the base of the
structure.

2. It was calculating the alignment based on the members previous to the
target member instead of all the members of the structure.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.5
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.19
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.0
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.2
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.6
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.12

v2: Fix rebase failure noticed by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
b17a4d5dab glsl: Correctly determine when the field of a UBO is row-major
Previously if a field of an block with an instance name was marked
row-major (but block itself was not), we would think the field (and it's
sub-fields) were column-major.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.basic_types.7
ES3-CTS.shaders.uniform_block.random.basic_types.9
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs.3
ES3-CTS.shaders.uniform_block.random.nested_structs.5
ES3-CTS.shaders.uniform_block.random.nested_structs.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.7
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.9
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.4
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.0
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.4
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.7
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.8
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.12
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.14
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.15
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.16
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.1
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.8
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.9
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.10
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.11
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.13
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.14
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.15
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.16
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.17

Fixes gles3conform failures (caused by previous commits) in:

ES3-CTS.shaders.uniform_block.random.basic_types.8
ES3-CTS.shaders.uniform_block.random.basic_arrays.3
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.18
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.4

v2: Fix rebase failure noticed by Matt.

v3: Use without_array() instead of older predicates.

v4: s/GLSL_MATRIX_LAYOUT_DEFAULT/GLSL_MATRIX_LAYOUT_INHERITED/g

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v2]
2014-08-04 14:40:07 -07:00
Ian Romanick
b71f149a44 linker: Use the matrix layout information in ir_variable and glsl_type for UBO layout
Use the data that is stored in the ir_variable and the glsl_type to
determine whether or not a UBO member is row-major.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4x3
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.9

Causes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.basic_types.8
ES3-CTS.shaders.uniform_block.random.basic_arrays.3
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.18
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.4

These failures will be fixed shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
d561e79a67 glsl: Track matrix layout of variables using two bits
Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13

Causes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9

This failure will be fixed shortly.

v2: Use without_array() instead of older predicates.

v3: s/GLSL_MATRIX_LAYOUT_DEFAULT/GLSL_MATRIX_LAYOUT_INHERITED/g

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
2014-08-04 14:40:07 -07:00
Ian Romanick
68fa4cab1a glsl: Also track matrix layout information into structures
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
814d694160 glsl: Track matrix layout of structure fields using two bits
v2: Rename GLSL_MATRIX_LAYOUT_DEFAULT to GLSL_MATRIX_LAYOUT_INHERITED.
Add comments in glsl_types.h explaining the layouts.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
ab7098c8df glsl: Correctly load columns of a row-major matrix
For a row-major matrix, the next column starts at the next element.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4x3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4x3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4x3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
7f731340d2 linker: Add padding after the last field of a structure
This causes the thing following the structure to be vec4-aligned.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs.2
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.5

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
47c6fc5b04 linker: Add a last_field parameter to various program_resource_visitor methods
I also considered renaming visit_field(const glsl_struct_field *) to
entry_record and adding an exit_record method.  This would be more
similar to the hierarchical visitor.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
46356c46ea mesa: Do not list inactive block members as active
Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_packed
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_packed
ES3-CTS.shaders.uniform_block.random.scalar_types.7
ES3-CTS.shaders.uniform_block.random.basic_arrays.4
ES3-CTS.shaders.uniform_block.random.basic_arrays.6
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs.9
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.3

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
1ca25abe25 glsl: Do not eliminate 'shared' or 'std140' blocks or block members
Commit 32f32292 (glsl: Allow elimination of uniform block members)
enabled elimination of unused uniform block members to fix a gles3
conformance test failure.  This went too far the other way.

Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says:

    "All members of a named uniform block declared with a shared or
    std140 layout qualifier are considered active, even if they are not
    referenced in any shader in the program. The uniform block itself is
    also considered active, even if no member of the block is
    referenced."

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_shared
ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_std140
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_shared
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_std140
ES3-CTS.shaders.uniform_block.random.scalar_types.2
ES3-CTS.shaders.uniform_block.random.scalar_types.9
ES3-CTS.shaders.uniform_block.random.vector_types.1
ES3-CTS.shaders.uniform_block.random.vector_types.3
ES3-CTS.shaders.uniform_block.random.vector_types.7
ES3-CTS.shaders.uniform_block.random.vector_types.9
ES3-CTS.shaders.uniform_block.random.basic_types.5
ES3-CTS.shaders.uniform_block.random.basic_types.6
ES3-CTS.shaders.uniform_block.random.basic_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_arrays.2
ES3-CTS.shaders.uniform_block.random.basic_arrays.5
ES3-CTS.shaders.uniform_block.random.basic_arrays.8
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.4
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.9
ES3-CTS.shaders.uniform_block.random.nested_structs.0
ES3-CTS.shaders.uniform_block.random.nested_structs.1
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.4
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.7
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.6
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.18

v2: Whitespace and other minor fixes suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
6305caea52 glsl: Use the without_array predicate to simplify some code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-08-04 14:40:06 -07:00
Ian Romanick
22f7a46d74 glsl: Add without_array type predicate
Returns the type without any arrays.

This will be used in later patches in this series.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-04 14:40:06 -07:00
Ian Romanick
146be3ddbe glsl: Use constant_expression_value instead of as_constant
Just a few lines earlier we may have wrapped the index expression with
ir_unop_i2u expression.  Whenever that happens, as_constant will return
NULL, and that almost always happens.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-04 14:40:06 -07:00
Brian Paul
b249712643 targets/graw-gdi: link with mesautil, not mesautils
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
a3bdbef020 wmesa: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
d6a7ff6d3b osmesa: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
c4e23f039e targets/libgl-gdi: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
0ba5d8010d targets/egl-static: link with libmesautil.la
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
b0b9871f69 mesa/x86: put code in braces to silence declarations after code warning
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 15:22:48 -06:00
Jason Ekstrand
ea705a4537 src/Makefile.am: Move gtest before util
Since the ralloc test in util/tests needs gtest, we need to make sure that
the gtest subdir is loaded first.  This fixes bug #82148.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 13:21:08 -07:00
Brian Paul
9b10bc5589 util: include c99_compat.h in format_srgb.h to get 'inline' definition
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
04764f3bd9 util: include c99_compat.h in hash_table.h to get 'inline' definition
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
b035869ff8 targets/vdpau: link with libmesautil.la to fix build breakage
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
9f88893829 xlib: fix missing mesautil build breakage
Fixes the non-DRI build.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Matthew McClure
ff0cbfb3db svga: SVGA_3D_CMD_BIND_GB_SHADER needs to reserve two relocations.
With this patch, the SVGA_3D_CMD_BIND_GB_SHADER functionality will reserve
two relocations, one for the shader ID and the second for the MOB ID.

Verified with the WDDM winsys path that the number of relocations and patch
locations required is two.

Fixes Bug 1277406

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-08-04 14:06:13 -06:00
Jason Ekstrand
0236e75b2a gallium: Add libmesautil dependency to gdm and xa targets
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 12:38:01 -07:00
Jason Ekstrand
e97498ef81 mesa/main: Use the RGB <-> sRGB conversion functions in libmesautil
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:20 -07:00
Jason Ekstrand
992e1ea8e4 gallium: Move sRGB <-> RGB handling to libmesautil
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:15 -07:00
Jason Ekstrand
efa0aa8ffc util: Gather some common macros
This gathers macros that have been included across components into util so
that the include chain can be more vertical.  In particular, this makes
util stand on its own without any dependence whatsoever on the rest of
mesa.

Signed-off-by: "Jason Ekstrand" <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:10 -07:00
Kenneth Graunke
72e55bb688 util: Move the open-addressing linear-probing hash_table to src/util.
This hash table is used in core Mesa, the GLSL compiler, and the i965
driver, which makes it a good candidate for the new src/util module.

It's much faster than program/hash_table.[ch] (see commit 6991c2922f
for data), and José's u_hash_table.c has a comment saying Gallium should
probably consider switching to a linear probing hash table at some point.
So this seems like the best candidate for a shared data structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:05 -07:00
Kenneth Graunke
1e0da6233b util: Move ralloc to a new src/util directory.
For a long time, we've wanted a place to put utility code which isn't
directly tied to Mesa or Gallium internals.  This patch creates a new
src/util directory for exactly that purpose, and builds the contents as
libmesautil.la.

ralloc seemed like a good first candidate.  These days, it's directly
used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl
didn't make much sense.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): More realloc uses and some scons fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:58 -07:00
Jason Ekstrand
dcc29c18b4 mesa/SConscript: Use Makefile.sources instead of duplicating the file lists
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:52 -07:00
Emil Velikov
87e719ae98 targets/dri: resolve the scons build
With earlier commit we've conditionally enabled/added the kms_dri target
for automake builds. Unfortunately the we forgot to add the appropriate
define in the scons build, resulting in a broken library due to the
undefined symbol 'kms_swrast_create_screen'.

Reported-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Roland Scheidegger <sroland@vmware.com>
2014-08-04 18:26:35 +01:00
Jan Vesely
cf3c73cf20 mesa/st: Fix compiler warnings
both array and index are unsigned types

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 09:51:44 -06:00
Jan Vesely
6614def764 gallium: Fix compiler warning.
warning: type qualifiers ignored on function return type

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 09:51:38 -06:00
Tapani Pälli
d66acc7077 glsl: fix switch statement default case regressions
This patch fixes regressions caused by commit 48deb4d. Regressions
happened because 'run_default' var did not get initialized when default
case was the last one.

Now all the switch tests in es3conform suite are passing.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81857
2014-08-04 12:32:59 +03:00
Aaron Watry
47e5039680 st/dri: Fix driver loading if swrast isn't built
If building hardware drivers only, then kms_swrast_create_screen
won't be defined in inline_drm_helper.h and hardware drivers will
fail to dlopen as a result.

Copy the #if guards from inline_drm_helper.h to dri_kms_init_screen
to make the definition/use of the function match.

Fixes radeonsi_dri.so dlopen with the following configure:

./configure --with-dri-drivers= --with-dri-driverdir=/usr/local/lib/dri/ \
--enable-gbm --enable-gallium-gbm --enable-debug --enable-opencl \
--enable-opencl-icd --with-gallium-drivers=radeonsi \
--with-egl-platforms=drm --enable-glx-tls --enable-texture-float \
--enable-omx

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-03 12:13:47 -05:00
Ilia Mirkin
7b3d0a9a1e 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>
2014-08-03 10:05:53 -04:00
Marek Olšák
152006e149 Remove XA state tracker support for Radeon
We don't support this type of X acceleration and we never did.
Other drivers might want to do the same thing.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-03 14:00:25 +02:00
Carl Worth
179c5d4e6d docs: Import 10.2.5 release notes, add news item. 2014-08-02 22:54:26 -07:00
Ilia Mirkin
47b064fd8a mesa/st: add support for dynamic ubo selection
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
v2: fix src register, use index2D for base of 1
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-08-02 23:51:40 -04:00
Kenneth Graunke
5d90926052 i965: Delete stale "pre-gen4" comment in texture validation code.
In commit 16060c5adc, Eric changed the
code to not relayout just for baselevel changes - only if the range of
miplevels actually increases.  So this comment is now wrong.

Notably, the i915 version of the code actually does what the comment
says.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-02 05:25:06 -07:00
Kenneth Graunke
8ccae4fe28 i965: Delete sampler state structures.
We've moved to using bitshifts (like we did for surface state); nothing
uses the structures anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
b8c2538e17 i965: Replace sizeof(struct gen7_sampler_state) with the size itself.
These are the last users of struct gen7_sampler_state.

v2: Use a local sampler_state_size variable, to help distinguish the
    various 16s (suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
7da612e8d0 i965: Drop sizeof(struct brw_sampler_state) from estimated prim size.
This is the last user of the structure.

v2: Use a local variable with a sensible name so people know what 16 is.
    (Suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
3d1a4d1f5b i965: Make BLORP use brw_emit_sampler_state().
This simplifies the code, removes use of the old structures, and also
allows us to combine the Gen6 and Gen7+ code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
6b5b78b518 i965: Delete redundant sampler state dumping code.
Although the Gen4-6 and Gen7+ variants used different structure types,
they didn't use any of the fields - only the size, which is identical.
So both decoders did exactly the same thing.

Someday we should implement useful decoders for SAMPLER_STATE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
3f3e0be666 i965: Make some brw_sampler_state.c functions static again.
Now that gen7_sampler_state.c is gone, everything is once again in a
single file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
2fe2fe1fce i965: Stop using gen7_update_sampler_state; rm gen7_sampler_state.c.
The code in brw_sampler_state.c now handles all generations; we don't
need the extra Gen7+ only code anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
7679393f56 i965: Make brw_update_sampler_state use 8 bits for LOD fields on Gen7+.
This was the only actual difference between Gen4-6 and Gen7+ in terms of
the values we program.  The rest was just mechanical structure
rearrangement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
a50b640dfe i965: Make brw_update_sampler_state() use brw_emit_sampler_state().
Instead of stuffing bits directly into the brw_sampler_state structure,
we now store them in local variables, then use brw_emit_sampler_state()
to assemble the packet.  This separates the decision about what values
to use from the actual packet emission, which makes the code more
reusable across generations.

v2: Put const on a bunch of local variables and move declarations,
    as suggested by Topi Pohjolainen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
05f0796eb6 i965: Introduce a function to emit a SAMPLER_STATE structure.
This simply assembles all the SAMPLER_STATE fields into their proper bit
locations.  Making it work on all generations was easy enough; some of
the fields are even in the same place.

Not used by anything yet, but will be soon.  I made it non-static so
BLORP can use it too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
7cdb0a30fa i965: Add const to upload_default_color's sampler parameter.
It doesn't edit the value, and this lets us use const in more places.

Needed to implement Topi's review comments for the next patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-02 05:16:18 -07:00
Kenneth Graunke
b590a1237c i965: Add #defines for SAMPLER_STATE fields.
We'll use these to replace the existing structures.

I've adopted the convention that "BRW" applies to all hardware, and
"GENX" applies starting with generation X, but might be replaced by some
later generation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
eee8196782 i965: Convert wrap mode #defines to an enum.
This makes it easy to tell that they're grouped together, and also
improves gdb printing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
6afe21da62 i965: Delete gen7_upload_sampler_state_table and vtable mechanism.
brw_upload_sampler_state_table now handles all generations, so we don't
need the vtable mechanism either.

There's still a lot of code duplication; the next patches will address
that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
c2f231e181 i965: Make brw_upload_sampler_state_table handle Gen7+ as well.
This copies a few changes from gen7_upload_sampler_state_table; the next
patch will delete that function.

Gen7+ has per-stage sampler state pointer update packets, so we emit
them as soon as we emit a new table for a stage.  On Gen6 and earlier,
we have a single packet, so we delay until we've changed everything
that's going to be changed.

v2: Split 3DSTATE_SAMPLER_STATE_POINTERS_XS packet emission into a
    helper function (suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
8fbc96ca74 i965: Shift brw_upload_sampler_state_table away from structures.
The Gen4-6 and Gen7+ code is virtually identical, but both use different
structure types.  Switching to use a uint32_t pointer and operate on the
number of DWords will make it possible to share code.

It turns out that SURFACE_STATE is the same number of DWords on every
platform currently; it will be easy to handle a change there, though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
378eea9708 i965: Push computation for sampler state batch offsets up a level.
Other than this, brw_update_sampler_state only deals with a single
SAMPLER_STATE structure, and doesn't need to know which position it is
in the table.  The caller takes care of dealing with multiple surface
states.

Pushing this up a level allows us to drop the ss_index parameter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
7efa183e8f i965: Drop unused 'ss_index' parameter from gen7_update_sampler_state.
This was copied from the Gen4-6 code, but is unused.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
a381592a8e i965: Stop storing sdc_offset in brw_stage_state.
sdc_offset is produced and consumed in the same function, so there's no
need to store it in the context, nor pass pointers to it through various
call chains.

Saves 128 bytes per brw_stage_state structure, and makes the code
clearer as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
9a1a8cb84d i965: Drop the degenerate brw_sampler_default_color structure.
It's just an array of four floats, and we have an array of four floats,
so this is literally just a memcpy...but with custom structs and strange
macros to give the appearance of doing something more.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
c8e2549785 i965: Write a better file comment for brw_sampler_state.c.
The old one has been inaccurate for years.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
3f67fb4dc3 i965: Rename brw_wm_sampler_state.c to brw_sampler_state.c.
When the driver was originally written, it only supported texturing in
the pixel shader backend; vertex and geometry shader texturing came much
later.  Originally, the pixel shader was referred to as "WM" (the
Windowizer/Masker unit).  So, this code happened to only be relevant for
the WM stage, at the time.

However, sampler state really applies to all stages, so putting "wm" in
the filename doesn't make sense.  I dropped it in gen7_sampler_state.c;
at this point the asymmetry just trips people up.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
6e12035834 i965/blorp: Don't set min_mag_neq bit in Gen6 SAMPLER_STATE.
The "Min/Mag State Not Equal" bit is supposed to be set when the min/mag
filters or address rounding modes differ.  BLORP uses identical min/mag
settings, so the bit should be unset.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kevin Rogovin
e41cc45361 define GL_OES_standard_derivatives if extension is supported
Define the macro GL_OES_standard_derivatives as 1 if the extension
GL_OES_standard_derivatives is supported.

V2 [Chris]: Correct trailing whitespace

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-02 11:52:41 +12:00
Roland Scheidegger
3b69347efc llvmpipe: don't store number of layers per level
This could be recalculated, though it turns out the only use of it after
resource allocation is for calculating whole resource size (for scene size
accounting though that isn't quite ideal neither). Thus, instead just store
the whole resource size and drop it (saving a couple bytes of storage per
resource). It makes things simpler too. Note that for the accounting winsys
resources always come back with size 0 but this is unchanged (we don't actually
know the size in any case).
Also reformat llvmpipe_texture_layout (drop unneded indentation).

v2: adapt to previous changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-01 23:31:11 +02:00
Roland Scheidegger
7e7aebbbd0 llvmpipe: integrate memory allocation into llvmpipe_texture_layout
Seems pointless to just duplicate some of the calculations (the calculation
of actual memory used compared to what was predicted in llvmpipe_texture_layout
actually could have differed slightly in some cases due to different alignment
rules used though this should have been of no consequence).

v2: keep the previous mip alignment of MAX2(64, cacheline). This was added for
ARB_map_buffer_alignment - I'm not convinced it's needed for textures, but
it was supposed to be cleanup without functional change. Also replace div
with 64bit mul / comparison.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-01 23:31:11 +02:00
Roland Scheidegger
47096fbb5d llvmpipe: get rid of impossible code in alloc_image_data
Only used for non display target resources.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-01 23:31:11 +02:00
Jordan Justen
c860a379d2 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>
2014-08-01 11:13:07 -07:00
Glenn Kennard
3a9278b92c r600g: Implement gpu_shader5 textureGather
Adds 0-3 textureGather component selection and non-constant offsets

Caveat: 0 and 1 texture swizzles only work if textureGather component
select is 3 or a component that does not exist in the sampler texture
format. This is a hardware limitation, any other value returns
128/255=0.501961 for both 0 and 1.

Passes all textureGather piglit tests on radeon 6670, except for those
using 0/1 texture swizzles due to aforementioned reason.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 16:19:47 +02:00
Aditya Atluri
f455f34ab9 mesa: Add missing atomic buffer bindings and unbindings
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 15:50:26 +02:00
Michel Dänzer
150ac07b85 r600g/radeonsi: Prefer VRAM for CPU -> GPU streaming buffers
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 11:25:27 +09:00
Michel Dänzer
8898fff46c r600g/radeonsi: Reduce or even drop special treatment of persistent mappings
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 11:04:16 +09:00
Jon TURNEY
095c37e472 target-helpers: Do not build kms_dri on libdrm-less platforms.
Fix build since 3b176c441b for
dri_platform=none hosts.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-01 01:31:58 +01:00
Glenn Kennard
b1eb00cd40 r600g: gpu_shader5 gl_SampleMaskIn support
Map TGSI_SEMANTIC_SAMPLEMASK to register/component.
Enable face register when sample mask is needed by shader.
Requires Evergreen/Cayman

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:05 +02:00
Glenn Kennard
2768a56f58 r600g: Implement gpu_shader5 integer ops
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:04 +02:00
Glenn Kennard
2133a1aedf r600g: Add IMUL_HI/UMUL_HI support
Fixes fs-imulExtended, fs-imulExtended-only-msb, fs-umulExtended,
fs-umulExtended-only-msb piglit tests.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:04 +02:00
Glenn Kennard
a48b615006 r600g: Implement GL_ARB_texture_query_lod
Requires Evergreen or later

v2 (Andreas): Update relnotes/10.3

Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2014-07-31 11:51:04 +02:00
Eric Anholt
1da4bb5b97 gbm: Log at least one dlerror() when we fail to open any drivers.
We don't want to log every single error (such as all the ones where the file
wasn't even present in our list of search paths), but if you didn't find any
driver, then seeing at least one error is useful (since the common case as a
developer is a single DEFAULT_DRIVER_DIR or GBM_DRIVERS_PATH entry).

v2: Rebase on swrast changes.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:31:30 -07:00
Eric Anholt
ef81ce9909 gbm: Fix a debug log message
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:30:19 -07:00
Eric Anholt
bfb0da9fa7 gallium: Add a uif() helper function to complement fui()
I found myself often wanting this when I'm printing out a uint32_t mapping
of some GPU data, and I want to put in an interpretation of that value as
a float.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:30:19 -07:00
Vinson Lee
bf3a26266d glapi: Do not use backtrace on DragonFly.
execinfo.h is not available on DragonFly.

Fixes this build error.

  CC       glapi_gentable.lo
glapi_gentable.c:44:22: fatal error: execinfo.h: No such file or directory

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-30 21:48:09 -07:00
Roland Scheidegger
5a12155503 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>
2014-07-31 01:31:06 +02:00
Giovanni Campagna
e57ad3d38c dri: Add a new capabilities for drivers that can't share buffers
The kms-dri swrast driver cannot share buffers using the GEM,
so it must tell the loader to disable extensions relying on
that, without disabling the image DRI extension altogether
(which would prevent the loader from working at all).
This requires a new gallium capability (which is queried on
the pipe_screen and for swrast drivers it's forwarded to the
winsys), and requires a new version of the DRI image extension.

[Emil Velikov]
 - Rebased on top of gallium-dri megadrivers.
 - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook.
The can_share_buffer cap is set at InitScreen. We use a different
InitScreen (and thus value for the cap) function for kms_dri, due to
deeper differences originating from dri megadrivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:43:41 +01:00
Giovanni Campagna
3b176c441b gallium: Add a dumb drm/kms winsys backed swrast provider
Add a new winsys and target that can be used with a dri2 state tracker
and loader instead of drisw. This allows to use gbm as a dri2/image
loader and avoid the extra copy from the backbuffer to the shadow
frontbuffer.

The new driver is called "kms_swrast", and is loaded by gbm as a
fallback, because it is only useful with the gbm platform (as no buffer
sharing is possible)

To force select the driver set the environment variable
GBM_ALWAYS_SOFTWARE

[Emil Velikov]
 - Rebase on top of gallium megadriver.
 - s/text/test/ in configure.ac (Spotted by Andreas Pokorny).
 - Add scons support for winsys/sw/kms-dri and fix the build.
 - Provide separate DriverAPI, due to different InitScreen hook.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Giovanni Campagna
8430af5ebe Add support for swrast to the DRM EGL platform
Turn GBM into a swrast loader (providing putimage/getimage backed
by a dumb KMS buffer). This allows to run KMS+DRM GL applications
(such as weston or mutter-wayland) unmodified on cards that don't
have any client side HW acceleration component but that can do
modeset (examples include simpledrm and qxl)

[Emil Velikov]
 - Fix make check.
 - Split dri_open_driver() from dri_load_driver().
 - Don't try to bind the swrast extensions when using dri.
 - Handle swrast->CreateNewScreen() failure.
 - strdup the driver_name, as it's free'd at destruction.
 - s/LIBGL_ALWAYS_SOFTWARE/GBM_ALWAYS_SOFTWARE/
 - Move gbm_dri_bo_map/unmap to gbm_driiint.h.
 - Correct swrast fallback logic.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Emil Velikov
e3a3dbe940 st/gbm: don't segfault if the fail to create the screen
Whenever dd_create_screen/pipe_loader_* fails, gdrm->dev may be NULL.
Thus peeking inside the struct will lead to a crash.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Emil Velikov
d93ae21939 st/gbm: retrieve the driver-name via dd_driver_name()
... on static targets. Otherwise we'll crash badly as gdrm->dev is
NULL when we try to copy the string driver_name.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Brian Paul
85109bc507 glsl/glcpp: rename ERROR to ERROR_TOKEN to fix MSVC build
ERROR is a #define in the MSVC WinGDI.h header file.
Add the _TOKEN suffix as we do for a few other lexer tokens.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-30 08:12:03 -06:00
Ian Romanick
66decc7efa configure: Don't override user -g or -O options for debug builds
Principle of least surprise: --enable-debug should enable debugging.
Ages ago, Mesa's build system only added -g in dri-debug builds (yay for
the static Makefiles).  If you forgot to change it (or wrap the build
with custom scripts), you would often be disappointed when trying to gdb
Mesa bugs.  New developers, that may not yet have custom scripts, will
have this same issue.

I think we should enable experienced developers to do what they want,
and make things easier for new developers.  I already pass '-ggdb3 -O1'
or '-ggdb3 -Og' for CFLAGS, and I don't want configure to change them
for me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-29 15:49:27 -07:00
Carl Worth
a62354a987 glsl: Add flex options to eliminate the default rule
We've had bugs in the past where we have been inadvertently matching the
default rule.

Just as we did in the pre-processor in the previous commit, we can use:

	%option warn nodefault

in the compiler to instruct flex to not generate the default rule, and
further to warn if our set of rules could let any characters go unmatched.

With this warning active, flex actually warns that the catch-all rule we
recently added to the compiler could never be matched. Since that is all
safely determined at compile time now, we can safely drop this run-time
compiler error message, (as we do in this commit).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
bc8721f16f glsl/glcpp: Add flex options to eliminate the default rule.
We've had multiple bugs in the past where we have been inadvertently matching
the default rule, (which we never want to do). We recently added a catch-all
rule to avoid this, (and made this rule robust for future start conditions).

Kristian pointed out that flex allows us to go one step better. This syntax:

	%option warn nodefault

instructs flex to not generate the default rule at all. Further, flex will
generate a warning at compile time if the set of rules we provide are
inadequate, (such that it would be possible for the default rule to be
matched).

With this warning in place, I found that the catch-all rule was in fact
missing something. The catch-all rule uses a pattern of "." which doesn't
match newlines. So here we extend the newline-matching rule to all start
conditions. That is enough to convince flex that it really doesn't need
any default rule.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
4ebff9bca6 glsl/glcpp: Combine the two rules matching any character
Using a single rule here means that we can use the <*> syntax to match
all start conditions. This makes the catch-all rule more robust against
the addition of future start conditions, (no need to maintain an ever-
growing list of start conditions for this rul).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
80e9301d9b glsl/glcpp: Alphabetize lists of start conditions
There is no behavioral change here. It's just easier to verify that lists
of start conditions include all expected conditions when they appear in a
consistent order.

The <INITIAL> state is special, so it appears first in all lists. All others
appear in alphabetical order.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
f9c99aefea glsl/glcpp: Add a catch-all rule for unexpected characters.
In some of the recent glcpp bug-fixing, we found that glcpp was emitting
unrecognized characters from the input source file to stdout, and dropping
them from the source passed onto the compiler proper.

This was obviously confusing, and totally undesired.

The bogus behavior comes from an implicit default rule in flex, which is
that any unmatched character is implicitly matched and printed to stdout.

To avoid this implicit matching and printing, here we add an explicit
catch-all rule. If this rule ever matches it prints an internal compiler
error. The correct response for any such error is fixing glcpp to handle
the unexpected character in the correct way.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:51 -07:00
Carl Worth
4757c74c84 glsl/glcpp: Treat carriage return as equivalent to line feed.
Previously, the '\r' character was not explicitly matched by any lexer
rule. This means that glcpp would have been using the default flex rule to
match '\r' characters, (where they would have been printed to stdout rather
than actually correctly handled).

With this commit, we treat '\r' as equivalent to '\n'. This is clearly an
improvement the bogus printing to stdout. The resulting behavior is compliant
with the GLSL specification for any source file that uses exclusively '\r' or
'\n' to separate lines.

For shaders that use a multiple-character line separator, (such as "\r\n"),
glcpp won't be precisely compliant with the specification, (treating these as
two newline characters rather than one), but this should not introduce any
semantic changes to the shader programs.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:51 -07:00
Carl Worth
12d583b21a glsl/glcpp: Add test for a multi-line comment within an #if 0 block
This test is written to exercise a bug which I recently wrote, (but
fortunately caught and fixed before ever committing it).

For the curious:

  The bug happened when the NEWLINE_CATCHUP code didn't actually return the
  NEWLINE token (due to the skipping). This resulted in the lexer continuing
  on through all the subsequent rules while still in the NEWLINE_CATCHUP start
  condition, (which then triggered the internal-compiler-error catch-all
  rule).

  What is intended is for the return of the NEWLINE token to start a new
  iteration of the lexer loop, at which time the NEWLINE_CATCHUP-handling code
  will reset from the <NEWLINE_CATCHUP> to the <INITIAL> start condition.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
346d712e87 glsl/glcpp: Test that macro parameters substitute immediately after periods
At one point while rewriting the lexing rule for pre-processing numbers, I
made it a bit too aggressive and within a replacement list sucked up a
parameter name that appeared immediately after a period. This caused the
parameter name to be unreplaced when the macro was expanded.

It was in some piglit tests that I originally found this issue. Here, I'm
adding a test to "make check" to ensure that this behavior remains correct.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
285c9392ad glsl/glcpp: Add (non)-support for ++ and -- operators
These operators aren't defined for preprocessor expressions, so we never
implemented them. This led them to be misinterpreted as strings of unary
'+' or '-' operators.

In fact, what is actually desired is to generate an error if these operators
appear in any preprocessor condition.

So this commit looks like it is strictly adding support for these
operators. And it is supporting them as far as passing them through to the
subsequent compiler, (which was already happening anyway).

What's less apparent in the commit is that with these tokens now being lexed,
but with no change to the grammar for preprocessor expressions, these
operators will now trigger errors there.

A new "make check" test is added to verify the desired behavior.

This commit fixes the following Khronos GLES3 CTS test:

	invalid_op_1_vertex
	invalid_op_1_fragment
	invalid_op_2_vertex
	invalid_op_2_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
34cd293c8a glsl/glcpp: Emit error for duplicate parameter name in function-like macro
This will emit an error for something like:

	#define FOO(x,x) ...

Obviously, it's not a legal thing to do, and it's easy to check.

Add a "make check" test for this as well.

This fixes the following Khronos GLES3 CTS tests:

	invalid_function_definitions.unique_param_name_vertex
	invalid_function_definitions.unique_param_name_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
fe1e0ac852 glsl/glcpp: Add an explanatory comment for "loc != NULL" check
Just reading the code, it looked like a bug that _define_object_macro had this
check, but _define_function_macro did not. Upon further reading, that's
because the check is to allow for our builtins to be defined, (and there are
no builtin function-like macros).

Add my new understanding as a comment to help the next reader.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
18c589d20e glsl/glcpp: Drop the HASH_ prefix from token names like HASH_IF
Previously, we had a single token for "#if" but now that we have two separate
tokens, it looks much better to see:

	HASH_TOKEN IF

than:

	HASH_TOKEN HASH_IF

(Note, that for the same reason we use HASH_TOKEN instead of HASH, we also use
DEFINE_TOKEN instead of DEFINE to avoid a conflict with the <DEFINE> start
condition in the lexer.)

There should be no behavioral change from this commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Kenneth Graunke
de0b4b6607 glsl: Properly lex extra tokens when handling # directives.
Without this, in the <PP> state, we would hit Flex's default rule, which
prints tokens to stdout, rather than returning them as tokens. (Or, after the
previous commit, we would hit the new catch-all rule and generate an internal
compiler error.)

With this commit in place, we generate the desired syntax error.

This manifested as a weird bug where shaders with semicolons after
extension directives, such as:

   #extension GL_foo_bar : enable;

would print semicolons to the screen, but otherwise compile just fine
(even though this is illegal).

Fixes Piglit's extension-semicolon.frag test.

This also fixes the following Khronos GLES3 conformance tests, (and for real
this time):

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
f196eb2d39 glsl: Add an internal-error catch-all rule
This is to avoid the default, silent flex rule which simply prints the
character to stdout.

For the following Khronos GLES3 conformance tests:

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

With this commit, these tests now report Pass where they previously reported
Fail, but Mesa isn't behaving correctly yet. It's now reporting the internal
error where what is really desired is a syntax error.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
f062f0506a glsl/glcpp: Correctly parse directives with intervening comments
It's legal (though highly bizarre) for a pre-processor directive to look like
this:

	#  /* why? */ define FOO bar

This behavior comes about since the specification defines separate logical
phases in a precise order, and comment-removal occurs in a phase before the
identification of directives.

Our implementation does not use an actual separate phase for comment removal,
so some extra care is necessary to correctly parse this. What we want is for
'#' to introduce a directive iff it is the first token on a line, (ignoring
whitespace and comments). Previously, we had a lexical rule that worked only
for whitespace (not comments) with the following regular expression to find a
directive-introducing '#' at the beginning of a line:

	HASH		^{HSPACE}*#{HSPACE}*

In this commit, we switch to instead use a simple literal match of '#' to
return a HASH_TOKEN token and add a new <HASH> start condition for whenever
the HASH_TOKEN is the first non-space token of a line. This requires the
addition of the new bit of state: first_non_space_token_this_line.

This approach has a couple of implications on the glcpp parser:

	1. The parser now sees two separate tokens, (such as HASH_TOKEN and
	   HASH_DEFINE) where it previously saw one token (HASH_DEFINE) for
	   the sequence "#define". This is a straightforward change throughout
	   the grammar.

	2. The parser may now see a SPACE token before the HASH_TOKEN token of
	   a directive. Previously the lexical regular expression for {HASH}
	   would eat up the space and there would be no SPACE token.

This second implication is a bit of a nuisance for the parser. It causes a
SPACE token to appear in a production of the grammar with the following two
definitions of a control_line:

	control_line
	SPACE control_line

This is really ugly, since normally a space would simply be a token
separator, so it wouldn't appear in the tokens of a production. This leads to
a further problem with interleaved spaces and comments:

	/* ... */    /* ... */ #define /* ..*/

For this, we must not return several consecutive SPACE tokens, or else we would need an arbitrary number of new productions:

	SPACE SPACE control_line
	SPACE SPACE SPACE control_line
	ad nauseam

To avoid this problem, in this commit we also change the lexer to emit only a
single SPACE token for any series of consecutive spaces, (whether from actual
whitespace or comments). For this compression, we add a new bit of parser
state: last_token_was_space. And we also update the expected results of all
necessary test cases for the new compression of space tokens.

Fortunately, the compression of spaces should not lead to any semantic changes
in terms of what the eventual GLSL compiler sees.

So there's a lot happening in this commit, (particularly for such a tiny
feature). But fortunately, the lexer itself is looking cleaner than ever. The
only ugly bit is all the state updating, but it is at least isolated to a
single shared function.

Of course, a new "make check" test is added for the new feature, (directives
with comments and whitespace interleaved in many combinations).

And this commit fixes the following Khronos GLES3 CTS tests:

	function_definition_with_comments_vertex
	function_definition_with_comments_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
dfdf9dc082 glsl/glcpp: Rename HASH token to HASH_TOKEN
This is in preparation for the planned addition of a new <HASH> start
condition to the lexer. Both start conditions and token types are, of course,
in the same default C namespace, so a start condition and a token type with
the same name will collide. (And unfortunately, they are both apparently
implemented as equivalent numeric types so the collision is undetected at
compile time and simply leads to unpredictable behavior at run time.)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
0d5f5d127b glsl/glcpp: Don't use start-condition stack when switching to/from <DEFINE>
This commit does not cause any behavioral change for any valid program. Prior
to entering the <DEFINE> start condition, the only valid start condition is
<INITIAL>, so whether pushing/popping <DEFINE> onto the stack or explicit
returning to <INITIAL> is equivalent.

The reason for this change is that we are planning to soon add a start
condition for <HASH> with the following semantics:

	<HASH>: We just saw a directive-introducing '#'

	<DEFINE>: We just saw "#define" starting a directive

With these two start conditions in place, the only correct behavior is to
leave <DEFINE> by returning to <INITIAL>. But the old push/pop code would have
returned to the <HASH> start condition which would then cause an error when
the next directive-introducing '#' would be encountered.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
2fdc1f50c4 glsl/glcpp: Add a -d/--debug option to the standalone glcpp program
The verbose debug output from the parser is quite useful when debugging, and
having this available as a command-line option is much more convenient than
manually forcing this into the code when needed, (which is what I had been
doing for too long previously).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
8e8f8ff1b2 glsl/glcpp: Fix off-by-one error in column in first-line error messages
For the first line we were initializing the column to 1, but for all
subsequent lines we were initializing the column to 0. The column number is
advanced for each token read before any error message is printed. So the 0
value is the correct initialization, (so that the first column is reported as
column 1).

With this extremely minor change, many of the .expected files are updated such
that error messages for the first line now have the correct column number in
them.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
0742e0acd3 glsl/glcpp: Minor tweak to wording of error message
It makes more sense to print the directive name with the preceding '#'.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
f583f214d5 glsl/glcpp: Stop using a lexer start condition (<SKIP>) for token skipping.
Here, "skipping" refers to the lexer not emitting any tokens for portions of
the file within an #if condition (or similar) that evaluates to false.

Previously, the lexer had a special <SKIP> start condition used to control
this skipping. This start condition was not handled like a normal start
condition. Instead, there was a particularly ugly block of code set to be
included at the top of the generated lexing loop that would change from
<INITIAL> to <SKIP> or from <SKIP> to <INITIAL> depending on various pieces of
parser state, (such as parser->skip_state and parser->lexing_directive).

Not only was that an ugly approach, but the <SKIP> start condition was
complicating several glcpp bug fixes I attempted recently that want to use
start conditions for other purposes, (such as a new <HASH> start condition).

The recently added RETURN_TOKEN macro gives us a convenient way to implement
skipping without using a lexer start condition. Now, at the top of the
generated lexer, we examine all the necessary parser state and set a new
parser->skipping bit. Then, in RETURN_TOKEN, we examine parser->skipping to
determine whether to actually emit the token or not.

Besides this, there are only a couple of other places where we need to examine
the skipping bit (other than when returning a token):

	* To avoid emitting an error for #error if skipped.

	* To avoid entering the <DEFINE> start condition for a #define that is
          skipped.

With all of this in place in the present commit, there are hopefully no
behavioral changes with this patch, ("make check" still passes all of the
glcpp tests at least).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
09b4e12900 glsl/glcpp: Abstract a bit of common code for returning string tokens
Now that we have a common macro for returning tokens, it makes sense to
perform some of the common work there, (such as copying string values).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
828686d4eb glsl/glcpp: Drop extra, final newline from most output
The glcpp parser is line-based, so it needs to see a NEWLINE token at the end
of each line. This causes a trick for files that end without a final newline.

Previously, the lexer for glcpp punted in this case by unconditionally
returning a NEWLINE token at end-of-file, (causing most files to have an extra
blank line at the end). Here, we refine this by lexing end-of-file as a
NEWLINE token only if the immediately preceding token was not a NEWLINE token.

The patch is a minor change that only looks huge for two reasons:

	1. Almost all glcpp test result ".expected" files are updated to drop
	   the extra newline.

	2. All return statements from the lexer are adjusted to use a new
	   RETURN_TOKEN macro that tracks the last-token-was-a-newline state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
5dbdc341e8 glsl/glcpp: Add testing for EOF sans newline (and fix for <DEFINE>, <COMMENT>)
The glcpp implementation has long had code to support a file that ends without
a final newline. But we didn't have a "make check" test for this.

Additionally, the <EOF> action was restricted only to the <INITIAL> state so
it would fail to get invoked if the EOF was encountered in the <COMMENT> or
the <DEFINE> case. Neither of these was a bug, per se, since EOF in either
of these cases is an error anyway, (either "unterminated comment" or
"missing macro name for #define").

But with the new explicit support for these cases, we not generate clean error
messages in these cases, (rather than "unexpected $end" from before).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
21dda50549 glsl/glcpp: Remove some un-needed calls to NEWLINE_CATCHUP
The NEWLINE_CATCHUP code is only intended to be invoked after we lex an actual
newline character ('\n'). The two extra calls here were apparently added
accidentally because the pattern happened to contain a (negated) '\n',
(see commit 6005e9cb28).

I don't think either case could have caused any actual bug. (In the first
case, the pattern matched right up to the next newline, so the NEWLINE_CATCHUP
code was just about to be called. In the second case, I don't think it's
possible to actually enter the <SKIP> start condition after commented newlines
without any intervening newline.)

But, if nothing else, the code is cleaner without these extra calls.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
cc335c0e57 glsl/glcpp: Add support for comments between #define and macro identifier
The recent adddition of an error for "#define followed by a non-identifier"
was a bit to aggressive since it used a regular expression in the lexer to
flag any character that's not legal as the first character of an identifier.

But we need to allow comments to appear here, (since we aren't removing
comments in a preliminary pass). So we refine the error here to only flag
characters that could not be an identifier, nor a comment, nor whitespace.

We also augment the existing comment support to be active in the <DEFINE>
state as well.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
ea2e9300ec glsl/glcpp: Emit proper error for #define with a non-identifier
Previously, if the preprocessor encountered a #define with a non-identifier,
such as:

	#define 123 456

The lexer had no explicit rules to match non-identifiers in the <DEFINE> start
state. Because of this, flex's default rule was being invoked, (printing
characters to stdout), and all text was being discarded by the compiler until
the next identifier. As one can imagine, this led to all sorts of interesting
and surprising results.

Fix this by adding an explicit rule complementing the existing
identifier-based rules that should catch all non-identifiers after #define and
reliably give a well-formatted error message.

A new test is added to "make check" to ensure this bug stays fixed.

This commit also fixes the following Khronos GLES3 CTS test:

	define_non_identifier_vertex

(The "fragment" variant was passing earlier only because the preprocessor was
behaving so randomly and causing the compilation to fail. It's lucky, in fact,
that the "vertex" version succesfully compiled so we could find and fix this
bug.)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
9e45fb6f51 glsl/glcpp: Add testing for directives preceded by a space
This test simply has one of each directive, all of which are preceded by a
single space character.
2014-07-29 15:11:48 -07:00
Carl Worth
da7f226a27 glsl/glcpp: Fix to emit spaces following directives
The glcpp lexer and parser use the space_tokens state bit to avoid emitting
tokens for spaces while parsing a directive. Previously, this bit was only
being set again by the first non-space token following a directive.

This led to a bug where a space, (or a comment that should emit a space),
immediately following a directive, (optionally searated by newlines), would be
omitted from the output.

Here we fix the bug by also setting the space_tokens bit whenever we lex a
newline in the standard start conditions.
2014-07-29 15:11:48 -07:00
Marek Olšák
49e2275d0d configure.ac: require libdrm_radeon 2.4.56 because of the Hawaii fix there 2014-07-29 23:25:42 +02:00
Jason Ekstrand
3ea922dd7c 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
2014-07-29 10:50:38 -07:00
Yaakov Selkowitz
b12d5f0d00 os_process.c: Add cygwin as an expected platform
mesa/mesa/src/gallium/auxiliary/os/os_process.c:40:2: warning: #warning unexpected platform in os_process.c [-Wcpp]
 #warning unexpected platform in os_process.c
mesa/mesa/src/gallium/auxiliary/os/os_process.c:77:2: warning: #warning unexpected platform in os_process.c [-Wcpp]
 #warning unexpected platform in os_process.c

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-29 17:53:08 +01:00
Yaakov Selkowitz
d05f72d4c3 xmlconfig: Use program_invocation_short_name when building for cygwin
mesa/mesa/src/mesa/drivers/dri/common/xmlconfig.c:104:10: warning: #warning "Per application configuration won't work with your OS version." [-Wcpp]
 #        warning "Per application configuration won't work with your OS version."

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-29 17:52:57 +01:00
Brian Paul
448f14918c docs: fix date typo: July 78 -> 18 2014-07-29 09:16:23 -06:00
Brian Paul
7844263f07 svga: remove unneeded depth==1 assertion in svga_texture_view_surface()
We can create 3D texture views.  Avoids an assertion in piglit
fbo-generatemipmap-3d test and allows it to pass.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-07-29 09:16:23 -06:00
José Fonseca
66a1b3a1da 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>
2014-07-29 15:41:32 +01:00
Michel Dänzer
8d0a1a6bc0 gallium/radeon: Add some Emacs .dir-locals.el files
Based on the toplevel one but adapted to the driver/winsys coding styles.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-29 17:59:13 +09:00
Chia-I Wu
9a53f941c7 ilo: fix fb height of HiZ ops
It was set to aligned width.  It appears to be fine on GEN7+, but causes
random hangs on GEN6.
2014-07-29 10:24:59 +08:00
Tapani Pälli
76b11d15d3 glapi: add indexed blend functions (GL 4.0)
This makes some of the UE4 engine demos (Stylized, Mobile Temple)
render correctly, tested on Intel Haswell machine.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78716
2014-07-28 16:26:27 -07:00
Marek Olšák
a9528cef6b 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
71ce92200e 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
156b7e244c 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
0e7f56313d 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
3d9e87406c 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
c7407b94a8 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
2014-07-28 23:57:08 +02:00
Marek Olšák
9b046474c9 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>
2014-07-28 23:57:08 +02:00
Marek Olšák
ecbd3a545a r600g,radeonsi: add debug flags which disable tiling
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
04f2c88f45 gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZE
This new name isn't so confusing.

I also changed the gallivm limit, because it looked wrong.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: use sizeof(float[4])
2014-07-28 23:57:08 +02:00
Marek Olšák
d5bcb5e8de 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
2014-07-28 23:57:08 +02:00
Tom Stellard
5fe20592d4 util: Fix typo
Spotted by okias on IRC.
2014-07-28 16:40:05 -04:00
Chia-I Wu
cc1e1da24a ilo: correctly propagate resource renames to hardware
Not only should we mark states dirty when the underlying resource is renamed,
we should also update the CSO bo when available.
2014-07-28 23:55:55 +08:00
Chia-I Wu
fb1820355b ilo: add ilo_resource_get_bo() helper
We will need it in the following commit.
2014-07-28 23:55:55 +08:00
Tom Stellard
6f0c1f2b5f radeonsi: Use util_memcpy_cpu_to_le32()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-28 10:14:28 -04:00
Tom Stellard
f0e0737922 util: Add util_memcpy_cpu_to_le32() v3
v2:
  - Preserve word boundaries.

v3:
  - Use const and restrict.
  - Fix indentation.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-28 10:10:43 -04:00
Tom Stellard
3d636b4785 clover: Add checks for image support to the image functions v2
Most image functions are required to return a CL_INVALID_OPERATION
error when used on devices without image support.

v2:
  - Simplified the code

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 10:10:30 -04:00
Bruno Jiménez
7f96bea5bc r600g/compute: Add debug information to promote and demote functions
v2: Add information about the item's starting point and size
v3: Rebased on top of master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-28 10:10:20 -04:00
Bruno Jiménez
e7715126f7 r600g/compute: Add documentation to compute_memory_pool
v2: Rebased on top of master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-28 10:09:46 -04:00
Chia-I Wu
717e3b1ca1 ilo: unblock an inline write with a staging bo
This should allow a deeper pipeline.
2014-07-28 22:57:22 +08:00
Chia-I Wu
7395432f2e ilo: try unblocking a transfer with a staging bo
When mapping a busy resource with PIPE_TRANSFER_DISCARD_RANGE or
PIPE_TRANSFER_FLUSH_EXPLICIT, we can avoid blocking by allocating and mapping
a staging bo, and emit pipelined copies at proper places.  Since the staging
bo is never bound to GPU, we give it packed layout to save space.
2014-07-28 22:57:22 +08:00
Chia-I Wu
0a0e57b070 ilo: enable persistent and coherent transfers
Enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT and reorder caps a bit.
2014-07-28 22:57:22 +08:00
Chia-I Wu
b02e993d8c ilo: drop ptr from ilo_transfer
With the recent clean-ups, we can pass the mapped pointer around between
functions cleanly.  Drop it to make ilo_transfer smaller.
2014-07-28 22:57:22 +08:00
Chia-I Wu
b1dd54d9fe ilo: s/TRANSFER_MAP_UNSYNC/TRANSFER_MAP_GTT_UNSYNC/
It maps to drm_intel_gem_bo_map_unsynchronized(), which results in
unsynchronized GTT mapping.
2014-07-28 22:57:22 +08:00
Chia-I Wu
2a82bb30e8 ilo: drop unused context param from transfer functions
Many of the transfer functions do not need an ilo_context.  Drop it.
2014-07-28 22:57:22 +08:00
Chia-I Wu
8abf6c06e8 ilo: tidy up transfer mapping/unmapping
Add xfer_map() to replace map_bo_for_transfer().  Add xfer_unmap() and
xfer_alloc_staging_sys() to simplify texture and buffer mapping/unmapping, and
enable more code sharing between them.
2014-07-28 22:57:22 +08:00
Chia-I Wu
2f4bed0405 ilo: tidy up choose_transfer_method()
Add a bunch of helper functions and a big comment for
choose_transfer_method().  This also fixes handling of
PIPE_TRANSFER_MAP_DIRECTLY to not ignore tiling.
2014-07-28 22:57:22 +08:00
Chia-I Wu
91656eb375 ilo: free transfers with util_slab_free()
We used FREE() in one of the error path.
2014-07-28 22:57:22 +08:00
EdB
1d3e06c216 clover: Add clUnloadPlatformCompiler.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 14:46:44 +02:00
EdB
39869423cb clover: Add clCreateProgramWithBuiltInKernels.
[ Francisco Jerez: Check for devices not associated with the specified
  context.  Style fix. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 14:45:29 +02:00
Jordan Justen
be8bc588b9 glsl/cs: Add several GLSL compute shader variables
With MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader, this fixes piglit:
built-in-constants tests/spec/arb_compute_shader/minimum-maximums.txt

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-27 17:59:28 -07:00
Jordan Justen
12029046a2 main/cs: Add additional compute shader constant values
With MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader, this fixes piglit:
* arb_compute_shader-minmax

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-27 17:58:58 -07:00
Chris Forbes
74e100affc glsl: No longer require ubo block index to be constant in ir_validate
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
be237a6129 glsl: Accept nonconstant array references in lower_ubo_reference
Instead of falling back to just the block name (which we won't find),
look for the first element of the block array. We'll deal with the rest
in the backend by arranging for the blocks to be laid out contiguously.

V2: Squashed together patches 3, 5 of V1, plus a naming tweak.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
c59802d3a1 glsl: Convert uniform_block in lower_ubo_reference to ir_rvalue.
Previously this was a block index with special semantics for -1.
With ARB_gpu_shader5, this need not be a compile-time constant, so
allow any rvalue here and convert the -1 to a NULL pointer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
9c90a63378 glsl: Mark entire UBO array active if indexed with non-constant.
Without doing a lot more work, we have no idea which indices may
be used at runtime, so just mark them all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
8eae5ceb99 glsl: Allow non-constant UBO array indexing with GLSL4/ARB_gpu_shader5.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chia-I Wu
4714c4ec48 ilo: simplify ilo_flush()
Move fence creation to the new ilo_fence_create().
2014-07-26 12:30:39 +08:00
Bruno Jiménez
654fd3e33f r600g/compute: Defrag the pool at the same time as we grow it
This allows us two things: we now need less item copies when we have
to defrag+grow the pool (to just one copy per item) and, even in the
case where we don't need to defrag the pool, we reduce the data copied
to just the useful data that the items use.

Note: The fallback path is a bit ugly now, but hopefully we won't need
it much.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 17:51:57 -04:00
Bruno Jiménez
4ca04f3112 r600g/compute: Try to use a temporary resource when growing the pool
Now, before moving everything to host memory, we try to create a
new resource to use as a pool. I we succeed we just use this resource
and delete the previous one. If we fail we fallback to using the
shadow.

This should make growing the pool faster, and we can also save
64KB of memory that were allocated for the 'shadow', even if they
weren't used.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 17:51:57 -04:00
Rob Clark
5eb11eb192 freedreno: fix typo in gpu version check
Opps, I should use larger fonts, I guess.

Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 14:29:02 -04:00
Rob Clark
db193e5ad0 freedreno/ir3: split out shader compiler from a3xx
Move the bits we want to share between generations from fd3_program to
ir3_shader.  So overall structure is:

  fdN_shader_stateobj -> ir3_shader -> ir3_shader_variant -> ir3
                                    |- ...
                                    \- ir3_shader_variant -> ir3

So the ir3_shader becomes the topmost generation neutral object, which
manages the set of variants each of which generates, compiles, and
assembles it's own ir.

There is a bit of additional renaming to s/fd3_compiler/ir3_compiler/,
etc.

Keep the split between the gallium level stateobj and the shader helper
object because it might be a good idea to pre-compute some generation
specific register values (ie. anything that is independent of linking).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
7d7e6ae9c3 freedreno/a3xx/compiler: rename ir3_shader to ir3
First step of reoganization split out compiler (so it can be shared
between a3xx and a4xx).  Rename ir3_shader -> ir3 (since we'll want
the name ir3_shader for a higher level object).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
faaeddb55e freedreno/a3xx/compiler: scheduler vs pred reg
The scheduler also needs to be aware of predicate register (p0) in
addition to address register (a0).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
9f391322a0 freedreno/a3xx/compiler: little cleanups
Remove some obsolete comments, rename deref->addr.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
d48faad3c2 freedreno/a3xx: enable/disable wa's based on patch-level
It seems like for the most part, different behaviors, workarounds, etc,
should be conditional on GPU patch revision (ie. a320.0 vs a320.2)
rather than GPU id (a320 vs a330).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
9613ca569f freedreno/a3xx/compiler: make IR heap dyanmic
The fixed size heap is a remnant of the fdre-a3xx assembler.  Yet it is
convenient for being able to free the entire data structure in one shot
without worrying about leaking nodes.

Change it to dynamically grow the heap size (adding chunks) as needed so
we don't have an artificial upper limit on shader size (other than hw
limits) and don't always have to allocate worst-case size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Jan Vesely
0bc1fa22d8 r600g/compute: Fix singed/unsigned comparison compiler warnings.
The iteration variables go from 0 anyway.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:55:05 -04:00
Tom Stellard
0ec8587642 clover: Query the device to see if images are supported
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-25 12:49:45 -04:00
Tom Stellard
1607a8efc1 gallium: Add PIPE_CAP_COMPUTE_IMAGES_SUPPORTED
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-25 12:49:20 -04:00
Bruno Jiménez
d6b89aef26 r600g/compute: Allow compute_memory_defrag to defragment between resources
This will be used in the following patch to avoid duplicated code

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:38:42 -04:00
Bruno Jiménez
5cf108078c r600g/compute: Allow compute_memory_move_item to move items between resources
v2: Remove unnecesary variables

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:38:28 -04:00
Dylan Baker
bf1247936a gbm: Search LIBGL_DRIVERS_PATH if GBM_DRIVERS_PATH is not set
The GBM_DRIVERS_PATH environment variable is not documented, and only
used to set the location of gbm drivers, while LIBGL_DRIVERS_PATH is
used for everything else, and is documented.

Generally this split leads to confusion as to why gbm doesn't work.

This patch will read LIBGL_DRIVERS_PATH as a fallback if
GBM_DRIVERS_PATH is not set.

The comments clearly indicate that using LIBGL_DRIVERS_PATH is
preferred over GBM_DRIVERS_PATH.

v2: - Use GBM_DRIVERS_PATH as a fallback
v3: [jordan.l.justen@intel.com] - Make LIBGL_DRIVERS_PATH the fallback

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-24 23:15:06 -07:00
Jerome Glisse
cce58147eb winsys/radeon: fix indentation
Can we please keep it clean and avoid ending up in messy situation
like ddx.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
2014-07-24 17:30:31 -04:00
Jason Ekstrand
989d2e3709 Add an accelerated version of F_TO_I for x86_64
According to a quick micro-benchmark, this new version is 20% faster on my
Haswell laptop.

v2: Removed the XXX note about x86_64 from the comment
v3: Use an intrinsic instead of an __asm__ block.  This should give us MSVC
    support for free.
v4: Enable it for all x86_64 builds, not just with USE_X86_64_ASM

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-24 12:44:56 -07:00
Matt Turner
2a33510f16 i965/fs: Decide predicate/predicate_inverse outside of the for loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:44 -07:00
Matt Turner
96128d134b i965/fs: Swap if/else conditions in SEL peephole.
Will clarify make the next commit easier to read.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:44 -07:00
Matt Turner
ac2acf04f7 i965: Improve dead control flow elimination.
... to eliminate an ELSE instruction followed immediately by an ENDIF.

instructions in affected programs:     704 -> 700 (-0.57%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:43 -07:00
Ilia Mirkin
0ddc28b026 nvc0/ir: support 2d constbuf indexing
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:42 -04:00
Ilia Mirkin
4eef537960 gm107/ir: emit LDC subops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:42 -04:00
Ilia Mirkin
fc3d5fe01d gk110/ir: emit load constant subop
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
9c4959d0df mesa/st: add support for interpolate_at_* ops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
dfb0ca1606 nv50/ir: fix phi/union sources when their def has been merged
In a situation where double-register values are used, the phi nodes can
still end up being u32 values. They all get merged into one RA node
though. When fixing up the merge (which comes after the phi node), the
phi node's def would get fixed, but not its sources which would remain
at the low register value.

This maintains the invariant that a phi node's defs and sources are
allocated the same register.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
32702cceed nv50/ir: fix hard-coded TYPE_U32 sized register
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
3f6b34bacc nvc0: mark shader header if fp64 is used
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
b21a28797c nv50/ir: keep track of whether the program uses fp64
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
47e5a8d7a2 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>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
637b6c2478 mesa: add ARB_clear_texture.xml to file list, remove duplicate decls
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-24 08:26:41 -04:00
Chia-I Wu
9d6166880d ilo: check the tilings of imported handles
Just to be cautious.
2014-07-24 13:38:51 +08:00
Chia-I Wu
cbc943c43e ilo: clean up resource bo renaming
s/alloc_bo/rename_bo/ as that is what the functions do.  Simplify bo
allocation and move the complexity to bo renaming.
2014-07-24 13:21:35 +08:00
Chia-I Wu
cf8c9947a8 ilo: share some code between {tex,buf}_create_bo
Add resource_get_bo_name() and resource_get_bo_initial_domain() for use by
both functions.
2014-07-24 10:49:02 +08:00
Chia-I Wu
c1a1a627c4 ilo: use native 3-component vertex formats on GEN7.5+
GEN7.5 gains support for those formats natively.
2014-07-24 09:54:20 +08:00
Chia-I Wu
2126541b0b ilo: allow for device-dependent format translation
Pass ilo_dev_info to all format translation functions.
2014-07-24 09:33:33 +08:00
Jason Ekstrand
6bac86cd85 i965: Accelerate uploads of RGBA and BGRA GL_UNSIGNED_INT_8_8_8_8_REV textures
Since intel is always going to be little-endian,
GL_UNSIGNED_INT_8_8_8_8_REV is the same as GL_UNSIGNED_BYTE for RGBA and
BGRA textures, so the same acceleration code will work.  We might as well
use it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-23 16:48:35 -07:00
Ian Romanick
5072d0e7fc mesa: Fix the name in the error message
Obvious copy-and-paste bug.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 16:42:47 -07:00
Ian Romanick
3f04a1532e glsl: Fix some bad indentation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 16:42:47 -07:00
Kenneth Graunke
d4d886a0bc 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>
2014-07-23 15:44:37 -07:00
Kenneth Graunke
36a4a6bbdc i965: Port INTEL_DEBUG=optimizer to the vec4 backend.
Largely via copy and paste.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:16 -07:00
Kenneth Graunke
8d2e95bd4b i965: Save the gl_shader_stage enum in backend_visitor.
This will be useful for INTEL_DEBUG=optimizer in the vec4 backend, which
needs to know whether it's currently processing a VS or GS.  It isn't
worth adding virtual methods for this case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:14 -07:00
Kenneth Graunke
d6d3e6027d i965: Don't print WE_normal in disassembly.
Dropping this helps most lines fit in an 80 column terminal.  The
absence of WE_normal also helps call attention to WE_all, where
something unusual is going on.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:08 -07:00
Rob Clark
2f181bc391 freedreno/a3xx/compiler: fix p0 (kill, etc)
Don't assert (debug builds) or assign random uninitialized value for
predicate register (p0).. that screws up kill, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 15:10:53 -04:00
Tom Stellard
fb237ba746 Revert "r600g/compute: Fix warnings"
This reverts commit 467f1585e2.

This breaks the build on some systems.
2014-07-23 11:52:05 -04:00
Grigori Goronzy
2a766b0b64 radeon/llvm: fix formatting
Use K&R and same indent as most other code. No functional change
intended.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:40:41 -04:00
Grigori Goronzy
0e9cdedd2e radeon/llvm: enable unsafe math for graphics shaders
Accuracy of some operations was recently improved in the R600 backend,
at the cost of slower code. This is required for compute shaders,
but not for graphics shaders. Add unsafe-fp-math hint to make LLVM
generate faster but possibly less accurate code.

Piglit didn't indicate any regressions.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:40:33 -04:00
Tom Stellard
467f1585e2 r600g/compute: Fix warnings 2014-07-23 10:29:17 -04:00
Glenn Kennard
2fa6d659c3 r600g: Use hardware sqrt instruction
Piglit quick tests including sqrt pass, no other regressions,
tested on radeon 6670.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
dbaf0bc388 r600g/compute: Remove unneeded code from compute_memory_promote_item
Now that we know that the pool is defragmented, we positively know
that allocated + unallocated will be the total size of the
current pool plus all the items that will be promoted. So we only
need to grow the pool once.

This will allow us to just add the new items to the end of the
item_list without the need of looking for a place to the new item.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
e7bda844e6 r600g/compute: Quick exit if there's nothing to add to the pool
This way we can avoid defragmenting the pool, even if it is needed
to defragment it, and looping again through the list of unallocated
items.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
90d7b09ed2 r600g/compute: Defrag the pool if it's necesary
This patch adds a new member to the pool to track its status.
For now it is used only for the 'fragmented' status, but if
needed it could be used for more statuses.

The pool will be considered fragmented if: An item that isn't
the last is freed or demoted.

This 'strategy' has a problem, although it shouldn't cause any bug.
If for example we have two items, A and B. We choose to free A first,
now the pool will have the 'fragmented' status. If we now free B,
the pool will retain its 'fragmented' status even if it isn't
fragmented.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
d8b6f0dacb r600g/compute: Add a function for defragmenting the pool
This new function will move items forward in the pool, so that
there's no gap between them, effectively defragmenting the pool.

For now this function is a bit dumb as it just moves items
forward without trying to see if other items in the pool could
fit in the gaps.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
1f705b2bee r600g/compute: Add a function for moving items in the pool
This function will be used in the future by compute_memory_defrag
to move items forward in the pool.

It does so by first checking for overlaping ranges, if the ranges
don't overlap it will copy the contents directly. If they overlap
it will try first to make a temporary buffer, if this buffer fails
to allocate, it will finally fall back to a mapping.

Note that it will only be needed to move items forward, it only
checks for overlapping ranges in that case. If needed, it can
easily be added by changing the first if.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Rob Clark
23ae2db854 freedreno/a3xx: more vtx formats
Actually what we currently handle is just the SCALED versions, and not
the int versions.  The difference probably matters more when we actually
support integer in the compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:10 -04:00
Rob Clark
a5ac36a75f freedreno/a3xx/compiler: const file relative addressing
Teach new compiler scheduling and register assignment how to deal with
relative addressing.  This gets us what we need to avoid falling back to
old compiler for CONST[ADDR[0].x+n].  It is also a prerequisite for temp
file relative addressing, although that is going to also need some
cleverness in register assignment to keep arrays grouped together.

NOTE: doing address calculation in full precision and then narrowing to
s16 in the mov to addr reg seems to sometimes cause lockups (and
sometimes work?!).  It seems more reliable to do the address calculation
in s16, like the blob does.  Which means teaching RA how to deal with
mixed half and full precision allocation.  Fortunately that didn't turn
out to be too hard, so that is a nice bonus which we could probably take
better advantage of elsewhere.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:10 -04:00
Rob Clark
c18ae9c293 freedreno/a3xx/compiler: move function
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
3a7da7f5ec freedreno/a3xx: add back a few stalls
Technically we should not need these.  CP_LOAD_STATE can be pipelined.
But removing them broke a few piglit tests, like fbo-depth-
GL_DEPTH_COMPONENT24-readpixels.  I expect these are just masking a
problem elsewhere, or perhaps they are only needed under some more
specific circumstances.  But until that is understood properly, give
back a bit of the perf boost we got from c63450e8.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
9f6dfd16e3 targets/dri: fix freedreno targets
The kernel driver name is either "kgsl" (downstream/android) or "msm"
(upstream).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
c357e8475a freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Neil Roberts
c6398a38af docs: Update GL3.txt and relnotes for GL_ARB_clear_texture 2014-07-23 12:10:37 +01:00
Neil Roberts
0779f37e15 meta: Add a meta implementation of GL_ARB_clear_texture
Adds an implementation of the ClearTexSubImage driver entry point that tries
to set up an FBO to render to the texture and then calls glClearBuffer with a
scissor to perform the actual clear. If an FBO can't be created for the
texture then it will fall back to using _mesa_store_ClearTexSubImage.

When used in combination with _mesa_store_ClearTexSubImage this should provide
an implementation that works for all DRI-based drivers. However as this has
only been tested with the i965 driver it is currently only enabled there.

v2: Only enable the extension for the i965 driver instead of all DRI drivers.
    Remove an unnecessary goto. Don't require GL_ARB_framebuffer_object. Add
    some more comments.

v3: Use glClearBuffer* to avoid having to modify glClearColor and friends.
    Handle sRGB textures. Explicitly disable dithering.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
05b52efbc9 meta: Add a state flag for the GL_DITHER
The Meta implementation of glClearTexSubImage is going to want to ensure that
dithering is disabled so that it can get a consistent color across the whole
texture when clearing. This adds a state flag to easily save it and set it to
the default value when performing meta operations.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
df9945ca26 texstore: Add a generic implementation of GL_ARB_clear_texture
Adds an implmentation of the ClearTexSubImage driver entry point that just
maps the texture and writes the values in. The extension is not yet enabled by
default because it doesn't work with multisample textures as they don't have a
simple linear layout.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
fbbbf7529c mesa/main: Add generic bits of ARB_clear_texture implementation
This adds the driver entry point for glClearTexSubImage and fills in the
_mesa_ClearTexImage and _mesa_ClearTexSubImage functions that call it.

v2: Don't clear some of the images if only one of them makes an error

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
2e63f91e60 teximage: Add utility func for format/internalFormat compatibility check
In texture_error_check() there was a snippet of code to check whether the
given format and internal format are basically compatible. This has been split
out into its own static helper function so that it can be used by an
implementation of glClearTexImage too.
2014-07-23 11:50:38 +01:00
Ilia Mirkin
c4067acd90 mesa/main: add ARB_clear_texture entrypoints
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-07-23 11:50:37 +01:00
Michel Dänzer
07c65b85ea r600g/radeonsi: Use write-combined CPU mappings of some BOs in GTT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-23 18:55:50 +09:00
Michel Dänzer
37d43ebb28 winsys/radeon: Use separate caching buffer managers for VRAM and GTT
Should reduce overhead because the caching buffer manager doesn't need to
consider buffers of the wrong type.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-23 15:43:04 +09:00
Dave Airlie
2c947760ed docs/GL3.txt: update status for ARB_compute_shader
since some bits are done in tree, but nobody is working on it anymore.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-23 11:06:15 +10:00
Anuj Phogat
9548ba6e7b 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>
2014-07-21 18:33:29 -07:00
Kenneth Graunke
29af97f280 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>
2014-07-21 14:59:13 -07:00
Kenneth Graunke
38ffef7840 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>
2014-07-21 14:59:12 -07:00
Kenneth Graunke
4cf47c80fc 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>
2014-07-21 11:19:44 -07:00
Kenneth Graunke
caf8c07dd4 i965/disasm: Don't disassemble the URB complete field on Broadwell.
It doesn't exist, so attempting to read it will trigger generation
assertions in the brw_inst API.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-21 11:19:17 -07:00
Kenneth Graunke
662f1ccc24 i965: Disable hex offset printing in disassembly.
Printing the hex offsets makes it basically impossible to diff assembly:
if you add even a single instruction, the entire shader shows up as a
difference.  So, every time I want to compare assembly, I have to strip
this out.

The hex offsets might be useful when debugging compaction, or when
inspecting the program cache buffer.  Since it's occasionally useful,
but uncommon, this patch disables it by default, but makes it easy to
re-enable it temporarily when the need arises.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-21 11:19:08 -07:00
Matt Turner
3e9105f7ee i965/vec4: Use foreach_inst_in_block a couple more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:41 -07:00
Matt Turner
1761671b06 i965: Replace cfg instances with calls to calculate_cfg().
Avoids regenerating it unnecessarily.

Every program in shader-db improved, none by an amount less than a 1/3
reduction. One Dota2 shader decreased from 62 -> 24.

cfg calculations:     429492 -> 193197 (-55.02%)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:39 -07:00
Matt Turner
dd65a6d9ad i965/cfg: Add a foreach_block_and_inst macro.
Will let us abstract how the instructions are stored.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:38 -07:00
Matt Turner
680fe0acb3 i965: Add cfg to backend_visitor.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:34 -07:00
Tom Stellard
b0f780345e radeonsi/compute: Add support scratch buffer support v2
The scratch buffer will be used for private memory and also register
spilling.

v2:
  - Code cleanups
2014-07-21 10:00:09 -04:00
Tom Stellard
6cc5334e42 radeonsi/compute: Bump number of user sgprs for LLVM 3.5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
81385f7596 winsys/radeon: Query the kernel for the number of SEs and SHs per SE
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
245e86168a radeonsi/compute: Share COMPUTE_DBG macro with r600g
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
9ba3105e0a radeonsi: Read rodata from ELF and append it to the end of shaders
The is used for programs that have arrays of constants that
are accessed using dynamic indices.  The shader will compute
the base address of the constants and then access them using
SMRD instructions.
2014-07-21 10:00:09 -04:00
Ian Romanick
01c21c459f glsl: Fix bad indentation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:04:04 -07:00
Ian Romanick
47e2a74a5a i965: Silence unused parameter warning
brw_fs_visitor.cpp:2400:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:04:01 -07:00
Ian Romanick
22b9641edf i965: Silence 'comparison is always true' warning
The parameter is an int16_t, and we're check that it's value will fit in
16-bits.  Yes, the value that is stored in 16-bits will surely fit in
16-bits.

brw_inst.h: In function 'brw_inst_set_gen6_jump_count':
brw_inst.h:321:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
brw_inst.h:321:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:03:57 -07:00
Ian Romanick
1946612b7d i965: Silence many unused parameter warnings
brw_inst.h: In function 'brw_inst_set_src1_vstride':
brw_inst.h:118:76: warning: unused parameter 'brw' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:03:49 -07:00
Vinson Lee
f6fc807345 configure.ac: Add LLVM patch version to error message.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-18 21:33:38 -07:00
Jason Ekstrand
ecd3e89b32 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>
2014-07-18 18:34:36 -07:00
Carl Worth
8ed24543f8 docs: Import 10.2.4 release notes
And add a news item.
2014-07-18 16:50:05 -07:00
Jason Ekstrand
f14d217f5c Add support for RGBA8 and RGBX8 textures in intel_texsubimage_tiled_memcpy
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-07-17 18:20:09 -07:00
Jason Ekstrand
765f4b8c04 i965: Improve debug output in intelTexImage and intelTexSubimage
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-07-17 18:20:09 -07:00
Marek Olšák
d808de31bd radeonsi: only update vertex buffers when they need updating
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
6210d6fdc2 radeonsi: remove nr_vertex_buffers
Unused.

Also inline util_set_vertex_buffers_count and simplify it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
0ed0bf0696 radeonsi: move vertex buffer descriptors from IB to memory
This removes the intermediate storage (pm4 state) and generates descriptors
directly in a staging buffer.

It also reduces the number of flushes, because the descriptors no longer
take CS space.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
1635ded828 radeonsi: add support for fine-grained sampler view updates
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
bea8f2f46d radeonsi: move si_set_sampler_views to si_descriptors.c
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
dd46841bc9 radeonsi: move sampler descriptors from IB to memory
Sampler descriptors are now represented by si_descriptors.
This also adds support for fine-grained sampler state updates and
the border color update is now isolated in a separate function.

Border colors have been broken if texturing from multiple shader stages is
used. This patch doesn't change that.

BTW, blitting already makes use of fine-grained state updates.
u_blitter uses 2 textures at most, so we only have to save 2.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
2a7b57ad42 radeonsi: implement ARB_draw_indirect
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
887b69a233 radeonsi: don't add info->start to the index buffer offset
info->start will be invalid once info->indirect isn't NULL, so it shouldn't
be added to ib.offset.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
09056b352d radeonsi: use an SGPR instead of VGT_INDX_OFFSET
The draw indirect packets cannot set VGT_INDX_OFFSET, they can only set user
data SGPRs. This is the only way to support start/index_bias with indirect
drawing.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
a66d934139 radeonsi: assume LLVM 3.4.2 is always present
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
4ad682461e configure.ac: require LLVM 3.4.2 for radeon
Needed by ARB_draw_indirect.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
3a86ca54df st/mesa,gallium: add a workaround for Unigine Heaven 4.0 and Valley 1.0
Most (all?) Unigine shaders fail to compile without this if sample shading
is advertised. This is, of course, Unigine developers' fault.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
b0ff18bd34 glsl: add a mechanism to allow #extension directives in the middle of shaders
This is needed to make Unigine Heaven 4.0 and Unigine Valley 1.0 work
with sample shading.

Also, if this is disabled, the error message at least makes sense now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-18 01:58:58 +02:00
Glenn Kennard
392c9f8dfe r600g: Implement GL_ARB_texture_gather
Only supported on evergreen and later. Currently limited
to single component textures as the hardware GATHER4
instruction ignores texture swizzles.

Piglit quick run passes on radeon 6670 with all
applicable textureGather tests, no regressions.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-07-18 01:58:58 +02:00
Anuj Phogat
984a02ba55 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>
2014-07-17 15:52:27 -07:00
Anuj Phogat
5d9f5cd35b Revert "i965: Extend compute-to-mrf pass to understand blocks of MOVs"
This reverts commit bbefb15e01.
Fixes the 11 regressions caused in framebuffer_blit tests in
Khronos GLES3 CTS tests:

Original patch reduced the instruction count but had no performance
benefits. So, it's safe to revert it without causing any performance
regressions.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-17 15:49:46 -07:00
Adel Gadllah
b656e3c603 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>
2014-07-17 14:42:35 -07:00
Pavel Popov
4ceb612a10 mesa: Fix regression introduced by commit "mesa: fix packing of float texels to GL_SHORT/GL_BYTE".
This commit "mesa: fix packing of float texels to GL_SHORT/GL_BYTE" replaced *_TO_BYTE to *_TO_BYTE_TEX because *_TO_FLOAT_TEX are used to unpack the texels to floats.
In this case *_TO_FLOATZ in function extract_float_rgba also should be replaced to *_TO_FLOAT_TEX. Underline that these macros automatically preserve zero when converting.

The regression was observed on 3 oglconform tests:
    snorm-textures basic.getTexImage
    snorm-textures advanced.mipmap.manual.getTex
    snorm-textures advanced.mipmap.upload.getTex

Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-18 08:01:07 +12:00
Thorsten Glaser
3cfe6bc9cc 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>
2014-07-17 10:31:30 -04:00
Tom Stellard
74dfd86ed6 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>
2014-07-17 09:33:37 -04:00
Tapani Pälli
48deb4dbf2 glsl: handle a switch where default is in the middle of cases
This fixes following tests in es3conform:

   shaders.switch.default_not_last_dynamic_vertex
   shaders.switch.default_not_last_dynamic_fragment

and makes following tests in Piglit pass:

   glsl-1.30/execution/switch/fs-default-notlast-fallthrough
   glsl-1.30/execution/switch/fs-default_notlast

No Piglit regressions.

v2: take away unnecessary ir_if, just use conditional assignment
v3: use foreach_in_list instead of foreach_list

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
2014-07-17 07:39:12 +03:00
Kenneth Graunke
9e47ed2f77 glsl: Make the tree rebalancer use vector_elements, not components().
components() includes matrix columns, so if this code encountered a
matrix, it would ask for something like a vec9 or vec16.  This is
clearly not what you want.

Earlier code now prevents this from seeing matrices, but we should still
use vector_elements, for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
7db75927ca glsl: Guard against error_type in the tree rebalancer.
This helped me track down the bug fixed in the previous commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
9697f8088f glsl: Make the tree rebalancer bail on matrix operands.
It doesn't handle things like (vector * matrix) correctly, and
apparently Matt's intention was to bail.

Fixes shader compilation in Natural Selection 2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
99f8ea295f Revert "i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams."
This reverts commit 3178d2474a.

This caused GPU hangs on Ivybridge for some users and huge (80%)
performance regressions across the board on multiple platforms.

We need to find a better solution.  I've made several attempts, but none
of them have worked yet.  In the meantime, we should revert this.

Reverting it breaks GL_PRIMITIVES_GENERATED for non-zero streams, but
that's okay, since we don't expose GL_ARB_gpu_shader5 yet.

Fixes Piglit's EXT_transform_feedback/generatemipmap prims_generated
test case on Haswell.
2014-07-16 14:19:29 -07:00
Chia-I Wu
1661f7559b ilo: add some missing formats
Map more pipe formats to hardware formats.  Enable more VB formats on Haswell.
2014-07-16 14:31:59 +08:00
Chia-I Wu
69cd3ebd6f ilo: update and tailor the surface format table
Recreate the table from scratch with the help of a pdf-table-to-csv converter.
Switch to a form that is more suitable for ilo.
2014-07-16 14:31:59 +08:00
Kenneth Graunke
a2de656278 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>
2014-07-15 22:12:15 -07:00
Kenneth Graunke
cf1b5eee7f 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>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:10:10 -07:00
Kenneth Graunke
e5adc560cc 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>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:10:06 -07:00
Kenneth Graunke
2eaf3f670f 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>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:09:49 -07:00
Christoph Bumiller
4198711006 nvc0: fix translate path for PRIM_RESTART_WITH_DRAW_ARRAYS
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Christoph Bumiller
a284a0afa2 nvc0: add support for indirect drawing
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Ilia Mirkin
bbc4a7bd31 nouveau: check if a fence has already been signalled
nouveau_fence_update does real work unconditionally. Avoid doing that if
the fence we're checking on has already been signalled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Matt Turner
c11096c749 glsl: Don't declare variables in for-loop declaration.
Reported-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-15 12:17:48 -07:00
Connor Abbott
58270c2fac exec_list: Make various places use the new length() method.
Instead of hand-rolling it.

v2 [mattst88]: Rename get_size to length. Expand comment in ir_reader.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Connor Abbott
7b0f69225a exec_list: Add a function to give the length of a list.
v2 [mattst88]: Remove trailing whitespace. Rename get_size to length.
               Mark as const.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Connor Abbott
28c4fd4bc6 exec_list: Add a prepend function.
This complements the existing append function. It's implemented in a
rather simple way right now; it could be changed if performance is a
concern.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Ian Romanick
9a723b970e 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>
2014-07-15 10:46:33 -07:00
Ian Romanick
750286600b 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>
2014-07-15 10:46:33 -07:00
Ian Romanick
ee58c71a65 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.

Anuj: Can you verify this does not regress proxy_textures_invalid_size?

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>
2014-07-15 10:46:33 -07:00
Matt Turner
83214edf8a i965/fs: Relax interference check in register coalescing.
A similar attempt was made in commit 5ff1e446 and was reverted in commit
a39428cf after causing a regression in an ES 3 conformance test. The
test still passes after this commit.

total instructions in shared programs: 1994827 -> 1992858 (-0.10%)
instructions in affected programs:     128247 -> 126278 (-1.54%)
GAINED:                                0
LOST:                                  1

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Matt Turner
1d97212007 i965/fs: Perform CSE on sends-from-GRF rather than textures.
Should potentially allow a few more cases, while avoiding doing CSE on
texture operations on Gen <= 6 with the MRF.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80211
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: lu hua <huax.lu@intel.com>
2014-07-15 10:12:29 -07:00
Matt Turner
103716a862 glsl: Update expression types after rebalancing the tree.
If we saw a tree that looked like

            vec3
           /   \
         vec3 float
        /   \
      vec3 float
     /   \
   vec3 float

We would see that all of the expression types were vec3, and then
rebalance to

           vec3
        /        \
      vec3       vec3 <-- should be float
     /   \      /    \
   vec3 float float float

This patch adds code to visit the rebalanced tree and update the
expression types from the bottom up.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80880
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Matt Turner
7b962a4e6b glsl: Add callback_leave to ir_hierarchical_visitor. 2014-07-15 10:12:29 -07:00
Matt Turner
76caaedd7e i965: Initialize new chunks of realloc'd memory.
Otherwise we'd compare uninitialized pointers with NULL and dereference,
leading to crashes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Tom Stellard
0d711e719e radeon/llvm: Fix LLVM diagnostic error reporting
We were trying to print the error message after disposing the
message object.

Tested-by and Reviewed-by: Aaron Watry <awatry@gmail.com>
2014-07-15 11:55:26 -04:00
José Fonseca
20b431fd9e util/tgsi: Fix ureg_EMIT/ENDPRIM prototype.
0cbefc1bea added a source argument to
EMIT/ENDPRIM, but it did not update tgsi_ureg accordingly, causing all
users of ureg_EMIT/ENDPRIM to fail at runtime with an assertion failure.

Trivial.
2014-07-15 14:56:31 +01:00
Vinson Lee
e945a19b35 glapi: Use GetProcAddress instead of dlsym on Windows.
This patch fixes this MinGW build error.

glapi_gentable.c: In function '_glapi_create_table_from_handle':
glapi_gentable.c:123:9: error: implicit declaration of function 'dlsym' [-Werror=implicit-function-declaration]
         *procp = dlsym(handle, symboln);
         ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Brian Paul <brianp@vmware.com>
2014-07-14 22:21:10 -07:00
Chia-I Wu
c25fe88ebf ilo: raise texture size limits
Report the hardware limits now that max-texture-size piglit test has been
fixed.
2014-07-15 12:00:15 +08:00
Chia-I Wu
81d7f33e30 ilo: move away from drm_intel_bo_alloc_tiled
We want to know the exact sizes of the BOs, and the driver has the knowledge
to do so.  Refactoring of the resource allocation code is needed though.
2014-07-15 12:00:10 +08:00
Marek Olšák
d859bdb4b5 radeonsi: partially revert "switch descriptors to i32 vectors"
It indeed breaks LLVM 3.4.2.
2014-07-14 21:40:19 +02:00
Matt Turner
130c99ca15 i965/vec4: Invalidate live intervals in opt_cse, not _local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
aba15d93a6 i965/vec4: Move aeb list into opt_cse_local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
1ca6b5d2e8 i965/fs: Invalidate live intervals in opt_cse, not _local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
bdbaa9ab5b i965/fs: Move aeb list into opt_cse_local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Cody Northrop
0f679f0ab5 glsl: Fix aggregates with dynamic initializers.
Vectors are falling in to the ir_dereference_array() path.

Without this change, the following glsl aborts the debug driver,
or gets the wrong answer in release:

mat2x2 a = mat2( vec2( 1.0, vertex.x ), vec2( 0.0, 1.0 ) );

Also submitting piglit tests, will reference in bug.

v2: Rebase on Mesa master.

v3: Remove unneeded check for arrays, which are covered by
    process_array_constructor(), recommended by Timothy Arceri.

Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79373
2014-07-14 08:36:36 -07:00
Jon TURNEY
923f78440c Avoid mesa_dri_drivers import lib being installed
On Cygwin and MinGW, linking a shared library also generates an import library

Use a wildcard which also matches the name of the megadriver import lib,
mesa_dri_drivers.dll.a, so that is also removed after megadriver symlinks are
created

(This then matches src/gallium/targets/dri/Makefile.am, which already does
things this way)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-13 16:06:46 +01:00
Chris Forbes
5899a45a5b i965/vec4: Silence warnings about unhandled interpolation ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-13 11:13:23 +12:00
Chris Forbes
1e4068ca45 docs: Mark off ARB_gpu_shader5 interpolation functions for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-13 10:04:25 +12:00
Chris Forbes
9c0bddf735 i965/fs: add support for ir_*_interpolate_at_* expressions
SIMD8-only for now.

V5: - Fix style complaints
    - Move prototype to be with other oddball emit functions
    - Use unreachable() instead of assert() where possible

V6: - Describe what is happening with the clamping
    - Add reg_width to make some expressions clearer

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:24 +12:00
Chris Forbes
5ed147c26f i965/fs: Skip channel expressions splitting for interpolation
The backend will have to do a message send, so we want to keep these in
one piece, just like texture ops.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:22 +12:00
Chris Forbes
6e91f2df95 i965/fs: add generator support for pixel interpolator query
V5: - Split into separate opcodes
    - Pass message data in src1 immediate
    - Put noperspective bit in fs_inst rather than adding any junk to
      backend_instruction

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:18 +12:00
Chris Forbes
d732598b63 i965: add low-level support for send to pixel interpolator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:17 +12:00
Chris Forbes
0b0572a2ad i965/disasm: add support for pixel interpolator messages
V3: Rework for brw_inst changes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:16 +12:00
Chris Forbes
1b6163bdf5 i965: Add message descriptor bit definitions for pixel interpolator
These got lost in the big brw_inst shakeup.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:13 +12:00
Chris Forbes
f55e9a7c75 i965/disasm: Disassemble indirect sends more properly
- Don't try to disassemble send's src1 as a descriptor if it's not an
  immediate.

- In the same case, show src1 as an operand (makes it easier to see
  bogus register regions, etc -- the hardware is very fussy)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:17 +12:00
Chris Forbes
1854ead64c i965: Avoid crashing while dumping vec4 insn operands
We'd otherwise go looking into virtual_grf_sizes for things that aren't
in there at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:17 +12:00
Chris Forbes
1499619fe6 i965: Fix two broken asserts in brw_eu_emit
These were looking in the wrong field.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:09 +12:00
Chris Forbes
b45d417108 glsl: add new interpolateAt* builtin functions
V2: - Don't assume everyone wants interpolateAtSample() lowered to
      interpolateAtOffset. It turns out this isn't what we want most
      of the time for i965. Lowering can be added later in an ir pass
      which drivers opt into, rather than bolting it straight into the
      builtin definition.
    - Only expose the interpolateAt* builtins in the fragment language.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:20:02 +12:00
Chris Forbes
1d5b06664f glsl: add new expression types for interpolateAt*
Will be used to implement interpolateAt*() from ARB_gpu_shader5

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:20:00 +12:00
Chris Forbes
8b7a323596 allow builtin functions to require parameters to be shader inputs
The new interpolateAt* builtins have strange restrictions on the
<interpolant> parameter.

- It must be a shader input, or an element of a shader input array.
- It must not include a swizzle.

V2: Don't abuse ir_var_mode_shader_in for this; make a new flag.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:19:50 +12:00
Marek Olšák
ee2a818d33 radeonsi: rename definitions of shader limits
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-11 19:36:29 +02:00
Marek Olšák
4f3f0435bf radeonsi: switch descriptors to i32 vectors
This is a follow-up to the commit which adds texture fetches with offsets.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-11 19:36:29 +02:00
Marek Olšák
877bb52dc9 radeonsi: properly implement texture opcodes that take an offset
Instead of using intr_name in lp_build_tgsi_action, this selects the names
with a switch statement in the emit function. This allows emitting
llvm.SI.sample for instructions without offsets and llvm.SI.image.sample.*.o
otherwise.

This depends on my LLVM changes.

When LLVM 3.5 is released, I'll switch all texture instructions to the new
intrinsics.
2014-07-11 19:36:29 +02:00
Marek Olšák
04aa2bd724 radeonsi: fix texture fetches with derivatives for 1DArray and 3D textures 2014-07-11 19:36:29 +02:00
Marek Olšák
b279f0143f radeonsi: fix samplerCubeShadow with bias
Pack the depth value before overwriting it with cube coordinates.

Cc: mesa-stable@lists.freedesktop.org
2014-07-11 19:36:29 +02:00
Marek Olšák
a11fff329e 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>
2014-07-11 19:36:29 +02:00
Marek Olšák
734e4946f5 mesa: fix crash in st/mesa after deleting a VAO
This happens when glGetMultisamplefv (or any other non-draw function) is
called, which doesn't invoke the VBO module to update _DrawArrays and
the pointer is invalid at that point.

However st/mesa still dereferences it to setup vertex buffers ==> crash.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-11 19:36:29 +02:00
Jon TURNEY
f381c27c54 configure: Cygwin requires _XOPEN_SOURCE >= 700 to prototype strndup()
Adjust definition of _XOPEN_SOURCE appropriately for use of strndup() added with
commit da3a47d6

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-07-11 15:26:02 +01:00
Brian Paul
da46b9de9f gallium/docs: minor clarification for TXQ instruction
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-10 11:30:04 -06:00
Brian Paul
c45b9b5721 softpipe: fix sp_get_dims() for PIPE_BUFFER
Before, we were checking the level against view->u.tex.last_level but
level is not valid for buffers.  Plus, the aliasing of the view->u.tex
view->u.buf members (a union) caused the level checking arithmetic to
be totally wrong.  The net effect is we always returned early for
PIPE_BUFFER size queries.

This fixes the piglit "textureSize 140 fs samplerBuffer" test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-10 10:59:40 -06:00
Brian Paul
faa6b0cdc3 glsl/glcpp: move macro declaration before code to fix MSVC build
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-10 08:08:10 -06:00
Ilia Mirkin
acaed8f41d nvc0/ir: add support for interpolating with non-default settings
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 22:32:13 -04:00
Ilia Mirkin
7c9161521a gallium: add INTERP_* opcodes to support interpolateAt*
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-07-09 22:32:13 -04:00
Ilia Mirkin
ca5e15f40f r600g: remove unused base_vector_chan variable
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-09 22:32:13 -04:00
Ilia Mirkin
b8db6db8b0 i965: forward-declare struct brw_context in brw_reg.h
Commit 54e91e7420 introduced a function declaration that uses
brw_context. While brw_context tends to get included in most files, it
is not when compiling intel_asm_annotation.c resulting in the following
warning:

In file included from brw_shader.h:25:0,
                 from brw_cfg.h:32,
                 from intel_asm_annotation.c:24:
brw_reg.h:122:39: warning: 'struct brw_context' declared inside
parameter list [enabled by default]
brw_reg.h:122:39: warning: its scope is only this definition or
declaration, which is probably not what you want [enabled by default]

Add a forward-declaration for struct brw_context to avoid the issue.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 22:31:51 -04:00
Ilia Mirkin
a432079400 nvc0/ir: fix encoding of offset register into interpolation instruction
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Ilia Mirkin
7f937875c0 nvc0/ir: account for indirect textures on fermi for txd
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Ilia Mirkin
9807a8ddaf nvc0/ir: unset s/r indirect sources before moving everything
With the current logic, it's very likely that s/r indirect sources are
right after the "regular" ones. Unset them before moving the texture
arguments over rather than after, as one of those arguments would
likely have assumed one of the s/r positions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Emil Velikov
0bdc3e1afd targets/dri-swrast: Convert to static/shared pipe-driver
Convert the final dri target to the single DRI (megadriver) library.
Cleanup all the automake leftovers from the conversion stage and
update the scons build.

v2: Link in llvmpipe, when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:49 +01:00
Emil Velikov
29ca7d2c94 st/dri: merge dri/drm and dri/sw backends
Move the driver_name to dri2/drisw and remove all the SPLIT_TAGETS
mayhem. In the next step we'll unify the dri and dri-swrast targets,
completing the gallium DRI megadriver.

v2: Remove leftover st/dri Makefiles from CONFIG_FILES. Spotted by
Thomas Helland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:49 +01:00
Emil Velikov
f6483aa694 targets/dri-swrast: convert to gallium megadrivers :)
Export the approapriate new symbol, and keep backwards compat
via the megadriver_stub helper library.

Our next step would be to unify dri/drm and dri/sw, leading to
a complete megadrivers solution, and having a single library
that provides dri across all targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
dab5d16f0e scons: build and use a single dri_common library
Rather than building two identical ones for dri-vmwgfx and dri-swrast
build a single library, and drop some duplication in the build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
0e357234f3 st/dri/drm: remove __driDriverExtensions and driDriverAPI
... and use libmegadriver_stub as their provider.
Teach scons how to build the library archive and use it.

v2: scons: fix build on a drm-less system.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
3b7c120be3 targets/dri: cleanup conversion leftovers
With all the users converted to __driGetExtensions_* we can
have only a single inclusion of the required header + define.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
f6898aa264 targets/dri: update scons build to handle __driDriverGetExtensions_vmwgfx
Cc: Jose Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
5c68a1dc0b targets/dri: Add __driDriverGetExtensions_vmwgfx
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Jose Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
ff0e25f3a6 targets/dri: Add __driDriverGetExtensions_i965 symbol
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
3591acacf9 targets/dri: Add __driDriverGetExtensions_i915 symbol
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
f48b06f89d targets/dri: Add __driDriverGetExtensions_freedreno symbol
Identical to previous two commits - will bring us a step closer
to megadrivers.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Emil Velikov
4cd1bb6a91 targets/dri: Add __driDriverGetExtensions_(r300|r600|radeonsi) symbols
The symbol is introduced by the mesa megadrivers, and
adding gallium support for it will allow us to merge
st/dri/drm and st/dri/sw. Resulting in a single dri library
across all of gallium.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Emil Velikov
5b7e43aea8 targets/dri: Add __driDriverGetExtensions_nouveau symbol
The symbol is introduced by the mesa megadrivers, and adding
gallium support for it will allow us to merge st/dri/drm and
st/dri/sw. Resulting in a single dri library across gallium.

v2: Rebase on top of gallium dri3.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Ilia Mirkin
532eb72be3 tgsi: add interpolation location modifier support to text parser
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 19:26:32 -04:00
Ilia Mirkin
6b92a06ea3 mesa/st: add per sample shading state to fp key and set interpolation
This enables a gallium driver not to care about the semantics of
ARB_sample_shading vs ARB_gpu_shader5 sample attributes. When
ARB_sample_shading-style sample shading is enabled, all of the fp inputs
are marked for interpolation at the sample location.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 19:26:32 -04:00
Ilia Mirkin
4c97ed4411 gallium: switch dedicated centroid field to interpolation location
The new location field can be either center, centroid, or sample, which
indicates the location that the shader should interpolate at.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-09 19:26:32 -04:00
Kenneth Graunke
e3b16294cb meta: Call glObjectLabel before linking.
i965 precompiles shaders at link time, and prints a disassembly if
INTEL_DEBUG=vs,gs,fs, including the shader name.  However, blit shaders
were showing up as "unnamed" since we hadn't set a name prior to
linking.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-09 16:04:52 -07:00
Kenneth Graunke
272e36e229 ff_fragment_shader: Access glsl_types directly.
Originally, we didn't have direct accessors for all of the GLSL types,
so the only way to get at them was to use the symbol table.  Now, we
can just get at them directly, which is simpler and faster.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-07-09 15:48:24 -07:00
Brian Paul
c03c6e0168 st/mesa: add PIPE_FORMAT_R10G10B10A2_UNORM to format_map table
as a candidate for the GL_RGB10_A2 internal texture format.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 15:06:46 -06:00
Brian Paul
282b783a15 st/mesa: add some missing MESA/PIPE_FORMAT_R10G10B10A2_UNORM switch cases
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 15:06:46 -06:00
Carl Worth
0e12cd7954 glsl/glcpp: Don't choke on an empty pragma
The lexer was insisting that there be at least one character after "#pragma"
and before the end of the line. This caused an error for a line consisting
only of "#pragma" which volates at least the following sentence from the GLSL
ES Specification 3.00.4:

	The scope as well as the effect of the optimize and debug pragmas is
	implementation-dependent except that their use must not generate an
	error. [Page 12 (Page 28 of PDF)]

and likely the following sentence from that specification and also in
GLSLangSpec 4.30.6:

	If an implementation does not recognize the tokens following #pragma,
	then it will ignore that pragma.

Add a "make check" test to ensure no future regressions.

This change fixes at least part of the following Khronos GLES3 CTS test:

	preprocessor.pragmas.pragma_vertex

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:14 -07:00
Carl Worth
43047384c3 glsl/glcpp: Promote "extra token at end of directive" from warning to error
We've always warned about this case, but a recent confromance test expects
this to be an error that causes compilation to fail. Make it so.

Also add a "make check" test to ensure these errors are generated.

This fixes the following Khronos GLES3 conformance tests:

	invalid_conditionals.tokens_after_ifdef_vertex
	invalid_conditionals.tokens_after_ifdef_fragment
	invalid_conditionals.tokens_after_ifndef_vertex
	invalid_conditionals.tokens_after_ifndef_fragment

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:14 -07:00
Carl Worth
dac3c986c5 glsl/glcpp: Once again report undefined macro name in error message.
While writing the previous commit message, I just felt bad documenting the
shortcoming of the change, (that undefined macro names would not be reported
in error messages).

Fix this by preserving the first-encounterd undefined macro name and reporting
that in any resulting error message.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:13 -07:00
Carl Worth
ec6222ef01 glsl/glcpp: Add short-circuiting for || and && in #if/#elif for OpenGL ES.
The GLSL ES Specification 3.00.4 says:

	#if, #ifdef, #ifndef, #else, #elif, and #endif are defined to operate
        as for C++ except for the following:
	...
	• Undefined identifiers not consumed by the defined operator do not
	  default to '0'. Use of such identifiers causes an error.

	[Page 11 (page 127 of the PDF file)]

as well as:

	The semantics of applying operators in the preprocessor match those
	standard in the C++ preprocessor with the following exceptions:

	• The 2nd operand in a logical and ('&&') operation is evaluated if
	  and only if the 1st operand evaluates to non-zero.

	• The 2nd operand in a logical or ('||') operation is evaluated if
	  and only if the 1st operand evaluates to zero.

	If an operand is not evaluated, the presence of undefined identifiers
	in the operand will not cause an error.

(Note that neither of these deviations from C++ preprocessor behavior apply to
non-ES GLSL, at least as of specfication version 4.30.6).

The first portion of this, (generating an error for an undefined macro in an
(short-circuiting to squelch errors), was not implemented previously, but is
implemented in this commit.

A test is added for "make check" to ensure this behavior.

Note: The change as implemented does make the error message a bit less
precise, (it just states that an undefined macro was encountered, but not the
name of the macro).

This commit fixes the following Khronos GLES3 conformance test:

	undefined_identifiers.valid_undefined_identifier_1_vertex
	undefined_identifiers.valid_undefined_identifier_1_fragment
	undefined_identifiers.valid_undefined_identifier_2_vertex
	undefined_identifiers.valid_undefined_identifier_2_fragment

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:13 -07:00
Carl Worth
9794f8f245 glsl/glcpp: Fix glcpp to properly lex entire "preprocessing numbers"
The preprocessor defines a notions of a "preprocessing number" that
starts with either a digit or a decimal point, and continues with zero
or more of digits, decimal points, identifier characters, or the sign
symbols, ('-' and '+').

Prior to this change, preprocessing numbers were lexed as some
combination of OTHER and IDENTIFIER tokens. This had the problem of
causing undesired macro expansion in some cases.

We add tests to ensure that the undesired macro expansion does not
happen in cases such as:

	#define e +1
	#define xyz -2

	int n = 1e;
	int p = 1xyz;

In either case these macro definitions have no effect after this
change, so that the numeric literals, (whether valid or not), will be
passed on as-is from the preprocessor to the compiler proper.

This fixes the following Khronos GLES3 CTS tests:

	preprocessor.basic.correct_phases_vertex
	preprocessor.basic.correct_phases_fragment

v2. Thanks to Anuj Phogat for improving the original regular expression,
(which accepted a '+' or '-', where these are only allowed after one of
[eEpP]. I also expanded the test to exercise this.

v3. Also fixed regular expression to require at least one digit at the
beginning (after an optional period). Otherwise, a string such as ".xyz" was
getting sucked up as a preprocessing number, (where obviously this should be a
field access). Again, I expanded the test to exercise this.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Carl Worth
98c0e3c783 glsl/glcpp: Fix glcpp to catch garbage after #if 1 ... #else
Previously, a line such as:

	#else garbage

would flag an error if it followed "#if 0", but not if it followed "#if 1".

We fix this by setting a new bit of state (lexing_else) that allows the lexer
to defer switching to the <SKIP> start state until after the NEWLINE following
the #else directive.

A new test case is added for:

	#if 1
	#else garbage
	#endif

which was untested before, (and did not generate the desired error).

This fixes the following Khronos GLES3 CTS tests:

	tokens_after_else_vertex
        tokens_after_else_fragment

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Carl Worth
1d862a0b39 glsl/glcpp: Fixup glcpp tests for redefining a macro with whitespace changes.
Previously, the test suite was expecting the compiler to allow a redefintion
of a macro with whitespace added, but gcc is more strict and allows only for
changes in the amounts of whitespace, (but insists that whitespace exist or
not in exactly the same places).

See: https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html:

 These definitions are effectively the same:

      #define FOUR (2 + 2)
      #define FOUR         (2    +    2)
      #define FOUR (2 /* two */ + 2)

 but these are not:

      #define FOUR (2 + 2)
      #define FOUR ( 2+2 )
      #define FOUR (2 * 2)
      #define FOUR(score,and,seven,years,ago) (2 + 2)

This change adjusts the existing "redefine-macro-legitimate" test to work with
the more strict understanding, and adds a new "redefine-whitespace" test to
verify that changes in the position of whitespace are flagged as errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Anuj Phogat
a6e9cd14ca glsl/glcpp: Fix preprocessor error condition for macro redefinition
This patch specifically fixes redefinition condition for white space
changes. #define and #undef functionality in GLSL follows the standard
for C++ preprocessors for macro definitions.

From https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html:

These definitions are effectively the same:

     #define FOUR (2 + 2)
     #define FOUR         (2    +    2)
     #define FOUR (2 /* two */ + 2)

but these are not:

     #define FOUR (2 + 2)
     #define FOUR ( 2+2 )
     #define FOUR (2 * 2)
     #define FOUR(score,and,seven,years,ago) (2 + 2)

Fixes Khronos GLES3 CTS tests;
invalid_object_whitespace_vertex
invalid_object_whitespace_fragment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-09 12:05:13 -07:00
Carl Worth
1a46dd6edd glsl/glcpp: Add test to ensure compiler won't allow #undef for some builtins
Currently verifying that an #undef of __FILE__, __LINE__, or __VERSION__ will
generate an error.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Anuj Phogat
64b7fc2dd1 glsl/glcpp: Do not allow undefining the built-in macros
Fixes piglit tests in spec/glsl-es-3.00/compile:
undef-__FILE__.vert
undef-GL_ES.vert
undef-__LINE__.vert
undef-__VERSION__.vert

Also, fixes Khronos GLES3 CTS tests:
undefine_invalid_object_1_vertex
undefine_invalid_object_1_fragment
undefine_invalid_object_2_vertex
undefine_invalid_object_2_fragment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-09 12:05:13 -07:00
Brian Paul
378fa34c7b 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>
2014-07-09 12:15:35 -06:00
Ilia Mirkin
e924bb32f4 tgsi: properly parse indirect dimension references (e.g. for UBOs)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-09 12:40:07 -04:00
Christian König
c8011c1885 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>
2014-07-09 15:08:22 +02:00
Brian Paul
d10204930f 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>
2014-07-09 06:43:26 -06:00
Brian Paul
176b64b811 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>
2014-07-09 06:43:26 -06:00
Brian Paul
971122a9c0 st/mesa: minor simplification of some state atom assignments 2014-07-09 06:43:25 -06:00
Brian Paul
301ffe7b26 st/mesa: minor fix-up in st_GetSamplePosition()
If the driver doesn't implement get_sample_position(), let's return
some non-garbage values.
2014-07-09 06:43:25 -06:00
Brian Paul
91affc8b32 mesa: use float to silence MSVC warning in _mesa_GetMultisamplefv() 2014-07-09 06:43:25 -06:00
Samuel Pitoiset
50bbe49c33 nvc0: allocate more space before a counter is configured
On nvc0, a counter can have up to 6 sources instead of only one
for nve4+. This fixes a crash when a counter uses more than
one source.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 19:41:00 -04:00
Tobias Klausmann
a9b21015f5 nv50/ir: use unordered_set instead of list to keep track of var uses
The set of variable uses does not need to be ordered in any way, and
removing/adding elements is a fairly common operation in various
optimization passes.

This shortens runtime of piglit test fp-long-alu to ~22s from ~4h

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 19:41:00 -04:00
Kenneth Graunke
503391b46f i965/disasm: Fix disassembly of the any16h/all16h predicates.
BRW_PREDICATE_ALIGN1_ANY16H was incorrectly being disassembled as
"all16h", and ALL16H would probably print as "(null)".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-08 12:31:01 -07:00
Kenneth Graunke
e13a6406c3 glsl: Fix the foreach_in_list_reverse macro.
We clearly don't want to start at the head and walk backwards; we want
to start at the last real element before the tail sentinel.  If the list
is empty, tail_pred will be the head sentinel, and we'll stop.

Nothing uses this function, so I guess nobody noticed it was broken.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-08 12:31:01 -07:00
Marek Olšák
be536efe20 radeonsi: mark MSAA config state as dirty at the beginning of CS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81020

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-08 20:46:23 +02:00
Marek Olšák
fe6be9926f 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>
2014-07-08 20:46:23 +02:00
Matt Turner
cf430408c4 i965: Remove artificial dependency between math instructions.
... on Gen6+. I'm not actually sure which class Gen6 fits into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-08 11:12:02 -07:00
Matt Turner
099cbc1477 i965/fs: Track dependencies in instruction scheduling per reg offset.
Previously instruction scheduling tracked dependencies on a per-register
basis. This meant that there was an artificial dependency between
interpolation instructions writing into the same virtual register.

Instruction scheduling would insert a number of instructions between the
two instructions in this example, when they are actually independent.

   linterp vgrf8+0.0:F, hw_reg2:F, hw_reg3:F, hw_reg6:F
   linterp vgrf8+1.0:F, hw_reg2:F, hw_reg3:F, hw_reg6+16:F

This lead to cases where the first texture coordinate is interpolated at
the beginning of the shader, but the second is done immediately before
the texture operation that uses it as a source.

After this change, the artificial dependency is removed and the
interpolation instructions are scheduled together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-08 11:12:02 -07:00
Jon TURNEY
7a641dd58d configure: Don't special case Cygwin to use gnu99, define _XOPEN_SOURCE instead
Revert "build: Build on Cygwin with gnu99 instead of c99." and define
_XOPEN_SOURCE appropriately.

This reverts commit 53e36d333c.

Since Cygwin 1.7.18 (April 2013), it's headers correctly prototype strtoll()
when using -std=c99, and correctly prototype strdup() when _XOPEN_SOURCE is
defined appropriately, so this workaround is no longer needed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-07-08 14:25:21 +01:00
Chia-I Wu
8ff16111ee ilo: fix fence reference counting
The old code was complicated, and was wrong when *ptr is NULL.
2014-07-08 15:00:36 +08:00
Kristian Høgsberg
bbefb15e01 i965: Extend compute-to-mrf pass to understand blocks of MOVs
The current compute-to-mrf pass doesn't handle blocks of MOVs.  Shaders
that end with a texture fetch follwed by an fb write are left like this:

0x00000000: pln(8)          g6<1>F          g4<0,1,0>F      g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000008: pln(8)          g7<1>F          g4.4<0,1,0>F    g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000010: send(8)         g2<1>UW         g6<8,8,1>F
                            sampler (1, 0, 0, 1) mlen 2 rlen 4              { align1 WE_normal 1Q };
0x00000020: mov(8)          g113<1>F        g2<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000028: mov(8)          g114<1>F        g3<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000030: mov(8)          g115<1>F        g4<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000038: mov(8)          g116<1>F        g5<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000040: sendc(8)        null            g113<8,8,1>F
                            render ( RT write, 0, 4, 12) mlen 4 rlen 0      { align1 WE_normal 1Q EOT };

This patch lets compute-to-mrf recognize blocks of MOVs and match them to
instructions (typically SEND) that writes multiple registers.  With this,
the above shader becomes:

0x00000000: pln(8)          g6<1>F          g4<0,1,0>F      g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000008: pln(8)          g7<1>F          g4.4<0,1,0>F    g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000010: send(8)         g113<1>UW       g6<8,8,1>F
                            sampler (1, 0, 0, 1) mlen 2 rlen 4              { align1 WE_normal 1Q };
0x00000020: sendc(8)        null            g113<8,8,1>F
                            render ( RT write, 0, 20, 12) mlen 4 rlen 0     { align1 WE_normal 1Q EOT };

which is the bulk of the shader db results:

total instructions in shared programs: 987040 -> 986720 (-0.03%)
instructions in affected programs:     844 -> 524 (-37.91%)
GAINED:                                0
LOST:                                  0

The optimization also applies to MRT shaders that write the same
color value to multiple RTs, in which case we can eliminate four MOVs in
a similar fashion.  See fbo-drawbuffers2-blend in piglit for an example.

No measurable performance impact.  No piglit regressions.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-07 23:39:40 -07:00
Ilia Mirkin
8aa34dc9cb nvc0/ir: fill offset in properly for TXD
Apparently TXD wants its offset differently than TEX, accepting it in
the upper bits of the layer index. Unclear what happens when this is
combined with indirect sampler indexing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
114d46829d 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>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
afea9bae67 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>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
1065aa92f4 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>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
30d91e0eec 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>
2014-07-08 00:14:33 -04:00
Carl Worth
9007c4f9f4 docs: Import 10.2.3 release notes
And add a news item.
2014-07-07 16:28:37 -07:00
Matt Turner
f6db414f3c i965/fs: Disable unlit_centroid_workaround on Haswell.
Although the HSW PRM shows it, the BSpec lists this workaround as being
for Ivybridge only.

total instructions in shared programs: 1994951 -> 1993675 (-0.06%)
instructions in affected programs:     27325 -> 26049 (-4.67%)
2014-07-06 18:19:17 -07:00
Matt Turner
6f7c4a8d05 i965/vec4: Perform CSE on CMP(N) instructions.
Port of commit b16b3c87 to the vec4 code.

No shader-db improvements, but might as well. The fs backend saw an
improvement because it's scalar and multiple identical CMP instructions
were generated by the SEL peepholes.
2014-07-06 18:19:15 -07:00
Matt Turner
7921bf0062 i965/vec4: Don't emit null MOVs in CSE.
Port of commit 219b43c6 to the vec4 code.
2014-07-06 18:18:52 -07:00
Matt Turner
949991cc99 i965/vec4: Improve CSE performance by expiring some available expressions.
Port of commit 5daf867f to the vec4 code.
2014-07-06 18:18:52 -07:00
Kenneth Graunke
3c8dc48ad1 i965/vec4: Add basic common subexpression elimination.
[mattst88]: Modified to perform CSE on instructions with
            the same writemask. Offered no improvement before.

total instructions in shared programs: 1995633 -> 1995185 (-0.02%)
instructions in affected programs:     14410 -> 13962 (-3.11%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-06 18:18:51 -07:00
Matt Turner
848fc7f710 i965: Fix warnings introduced in commit e24ef5ab.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-06 18:15:36 -07:00
Christian König
042b061fef gallium/radeon: use PRIX64 instead of PRIu64
We want hex values here, not decimals.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-06 13:28:04 +02:00
Matt Turner
1580865a8c i965: Move assembly annotation functions to intel_asm_annotation.c.
It's C. Compile it as such.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
423932791d i965: Rename intel_asm_printer -> intel_asm_annotation.
The #ifndef include guards already said the right thing :)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
6d3e24a5c2 i965: Make backend_instruction usable from C.
With a hack to place an exec_node in the struct in C to be at the same
location as the inherited exec_node in C++.

Acked-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
0db30fcf89 i965/cfg: Make cfg_t usable from C.
Acked-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
857c06236c i965: Repack backend_instruction struct.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
ce706b4a9b i965: Make a brw_predicate enum.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
46e5b2a497 i965: Make a brw_conditional_mod enum.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
ab74a42eef i965: Move common fields into backend_instruction.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
3de11cacf0 i965: Use enum brw_reg_type for register types.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
34ef6a7651 i965: Move is_zero/one/null/accumulator into backend_reg.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
c019105f37 i965: Make a common backend_reg class.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
9377b189f7 i965: Drop imm union from visitor register classes.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:29 -07:00
Matt Turner
53992a102f i965: Use immediate storage in brw_reg for visitor regs.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:29 -07:00
Andreas Boll
45446efc30 docs: add news item for mesa-demos 8.2.0 release 2014-07-05 11:32:54 +02:00
Chris Forbes
4087d9ec0b glsl: Fix merging of layout(invocations) with other qualifiers
If another layout qualifier appeared to the left of `invocations` in the
GS input layout declaration, the invocation count would be dropped on
the floor.

Fixes the piglit tests:

spec/ARB_transform_feedback3/arb_transform_feedback3-ext_interleaved_two_bufs_gs_max
spec/ARB_gpu_shader5/arb_gpu_shader5-invocation-id
spec/ARB_gpu_shader5/compiler/correct-multiple-layout-qualifier-invocations.geom
spec/ARB_gpu_shader5/execution/invocations-conflicting

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-05 09:42:17 +12:00
Ilia Mirkin
9a37eb8adb 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>
2014-07-03 20:08:41 -04:00
Ilia Mirkin
5d4f5218bb 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>
2014-07-03 20:01:07 -04:00
Ilia Mirkin
b2b7c65122 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>
2014-07-03 20:01:06 -04:00
Ilia Mirkin
32b71246e7 gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORT
Now that this cap is used to determine the availability of both, adjust
its name to reflect the new reality.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-03 19:39:25 -04:00
Ilia Mirkin
0fb6f1bf1d mesa/st: enable AMD_vertex_shader_viewport_index
The assumption is that any driver capable of emitting layer from the
vertex shader and supporting viewports should be able to also handle
emitting viewport index from the vertex shader.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-03 19:39:25 -04:00
Ilia Mirkin
313acb3ffa r600g: allow vs to write to gl_ViewportIndex
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-03 19:39:25 -04:00
Thomas Hellstrom
556a415033 svga: Don't unnecessarily reemit BindGBShader commands v2
The Linux winsys can no longer relocate shader code, so avoid
reemitting BindGBShader commands. They are costly.

v2: Correctly handle errors from SVGA3D_BindGBShader()

Reported-by: Michael Banack <banackm@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-07-03 22:26:00 +02:00
Aaron Watry
824197efd5 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>
2014-07-03 15:18:03 -05:00
Samuel Iglesias Gonsalvez
7f0420700c glsl: fix duplicated layout qualifier detection for GS
This patch fixes the duplicated layout qualifier detection
for geometry shader's layout qualifiers.

Also it makes the detection code more legible by defining
allowed_duplicates_mask variable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-03 10:34:12 -07:00
Brian Paul
986adb9057 svga: add switch cases for PIPE_SHADER_CAP_DOUBLES
Signed-off-by: Brian Paul <brianp@vmware.com>
2014-07-03 08:25:50 -06:00
Thomas Hellstrom
35cf3831d7 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>
2014-07-03 02:55:00 -07:00
Michel Dänzer
370184e813 Revert "radeonsi: Use dma_copy when possible for si_blit."
This reverts commit 5d5c20920e.

Caused visual corruption, see e.g.
https://bugs.freedesktop.org/show_bug.cgi?id=80827#c1
2014-07-03 11:17:38 +09:00
Ilia Mirkin
7666a9f4ae i965: expose AMD_vertex_shader_viewport_index on gen7+
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-02 21:59:41 -04:00
Ilia Mirkin
df61553070 glsl: add support for AMD_vertex_shader_viewport_index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-02 21:59:38 -04:00
Ilia Mirkin
e593953b50 mesa: add support for AMD_vertex_shader_viewport_index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-02 21:59:05 -04:00
Ilia Mirkin
6c544e5413 mesa/st: enable ARB_fragment_layer_viewport
If multiple viewports are supported, that implies the presence of a GS
and layered rendering, so we can enable ARB_fragment_layer_viewport as
well.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-02 20:20:53 -04:00
Eric Anholt
6ded75ed08 i965/gen6: Add a spec citation about push constant packet requirements.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
e874274d08 i965: Add a comment about null renderbuffer surfaces and why they exist.
I noticed this when trying to find comments about pull constant buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
489ec68554 i965: Update a ton of comments about constant buffers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
e24ef5ab18 i965: Merge VS/GS and WM pull constant buffer upload paths.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
34f4e614dd i965/gen6+: Merge VS/GS and WM push constant buffer upload paths.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
c0f1929dd2 i965: Move dispatch_grf_start_reg and first_curbe_grf into stage_prog_data.
I wanted to access this value from stage-generic code, so stop storing it
under two different names.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
5ba31c34d8 i965: Fix state flags for gen4/5 CURBE.
If we had some NOS affecting VS compilation that resulted in optimization
changing the set of constants to be uploaded, we might not have reuploaded
the constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
a8330c343c i965: Remove a dead define.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
c00d3bd59d i965: Reuse libdrm's header for AUB definitions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
a6af5602af i965: Fix stale comments about the state cache.
This changed in the state streaming work years ago.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
ccf7878126 i965: Fix stale binding table comment.
I recently moved the code from the mentioned location right into this
file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
ccda1b9ba9 i965: Drop the memcmp for finding duplicated CURBE uploads.
At this point, the extra copy of the data and memcmp are as expensive as
just re-uploading.

Note: now that we'll always upload, and brw_constant_buffer watches
BRW_NEW_BATCH anyway, we don't need to explicitly unref the old curbe_bo
at batch reset time.

No significant performance difference on glamor copywinwin10 (n=55),
despite that test having a 98% hit rate on the cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:58 -07:00
Eric Anholt
44c63bdd40 i965: Reuse intel_upload.c for gen4/5 constant buffers.
No performance difference on glamor with copywinwin10 (n=40) on my gm45.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:58 -07:00
Tom Stellard
fea996c2aa gallium: Add PIPE_SHADER_CAP_DOUBLES
This is for reporting whether or not double precision floating-point
operations are supported.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-02 15:31:52 -04:00
Matt Arsenault
2ab44f657e clover: Fix not setting build log if the build succeeds v2
If there were only warnings, they would not be added to the log.

v2:
  - Use compat::string.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-02 15:15:13 -04:00
Francisco Jerez
d2504ead2f clover: Have compat::string allocate its own memory. 2014-07-02 15:15:13 -04:00
Tom Stellard
9e5beac236 gallium/radeon: Only print a message for LLVM diagnostic errors
We were printing messages for all diagnostic types, which was
spamming the console for some OpenCL programs.
2014-07-02 15:15:13 -04:00
Tom Stellard
b9f501bc6b 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>
2014-07-02 14:59:29 -04:00
Ilia Mirkin
141f8fe1d1 r600g: allow viewport index/layer to be sent to ps
In order to support ARB_fragment_layer_viewport, we need to explicitly
send these along to the pixel shader, since it has no other way to
retrieve them.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-02 10:53:34 -04:00
Emil Velikov
7414552b18 targets/dri: allow duplicated symbols
With the inclusion of xmlconfig in the loader we're providing dri* symbols
which are already available in libdricommon.la. This leads to a build
break due to the multiple definitions.

Temporary allow multiple definitions, until we come with a better solution.

Reported-by: Laurent Carlier <lordheavym@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-02 12:25:05 +01:00
Emil Velikov
bd322dfd0e st/dri: Remove the old libdridrm library
With all the hw drivers converted, we can go back to having
a single libdridrm provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
37b7a76266 targets/dri-vmwgfx: Convert to static/shared pipe-drivers
Convert the final hardware driver to a single dri provider which
includes all the pipe-drivers.

Update the scons build and drop the unused vmw_powf.c.

Cc: José Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
100e654b25 targets/dri-ilo: Convert to static/shared pipe-driver
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
0a4be815f4 targets/dri-i915: Convert to static/shared pipe-drivers
v2:
 - Drop inclusion of the winsys wrapper and softpipe/llvmpipe.
 - Remove old Makefile.am, target.c.
 - Correctly append i915 to the megadrivers list.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
231063b032 targets/dri-freedreno: Convert to static/shared pipe-drivers
Now we don't need a second dri module when using kgsl :)

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
495e3e7bed targets/(r300|r600|radeonsi)/dri: Convert to static/shared pipe-drivers
Related to previous commit, merge the separate dri targets to a single
one.

This is essentially all the buildsystem mayhem required for megaradeon.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
6eabddd531 targets/dri-nouveau: Convert to static/shared pipe-drivers
Similiar to other targets, we'd like to convert all the separate
targets into a single one, thus we'll minimize the duplication and
overall size of mesa. The conversion per API basis, with the drivers
available either statically or shared. Currently the former is the
default.

v2: Correctly append the version script to the linker flags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
9a7fd2954f st/dri/drm: Add a second libdridrm library
Will be used to create the single dri target library, on our
way to convert all the dri targets during the conversion to
to static/shared pipe-drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Emil Velikov
a66dd60547 st/dri: Allow separate dri-targets
With this commit we add a couple of DEFINES making the ST code
conditional, in a way that we can use it to gradually convert
the dri-targets from separate libraries into a single one.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Emil Velikov
98204ea7d0 targets/dri-swrast: use drm aware dricommon when building more than swrast
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Ilia Mirkin
e1432489c0 docs: update hw-dependent bits of ARB_gpu_shader5
Some of the features are completely implemented by core, while others
have hardware dependencies. Create a list of drivers supporting each
sub-feature that must have hw support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-01 20:10:09 -04:00
Ilia Mirkin
27ee7df8ad nvc0: add missed PIPE_CAP_DRAW_INDIRECT
Real support will be forthcoming. For now, avoid the unknown cap error
and compiler warning.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 20:08:36 -04:00
Roland Scheidegger
a7ee842acd llvmpipe: get rid of llvmpipe_get_texture_tile_linear
Because the layout is always linear this didn't really do much any longer -
at some point this triggered per-tile swizzled->linear conversion. The x/y
coords were ignored too.
Apart from triggering conversion, this also invoked alloc_image_data(), which
could only actually trigger mapping of display target resources. So, instead
just call resource_map in the callers (which also gives the ability to unmap
again). Note that mapping/unmapping of display target resources still isn't
really all that clean (map/unmap may be unmatched, and all such mappings use
the same pointer thus usage flags are a lie).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
a4d0758d9d llvmpipe: get rid of llvmpipe_get_texture_image
The only caller left used it only for non display target textures,
hence it was really the same as llvmpipe_get_texture_image_address - it
also had a usage flag but this was ignored anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
aa1ab8173d llvmpipe: get rid of llvmpipe_get_texture_image_all
Once used for invoking swizzled->linear conversion for all needed images.
But we now have a single allocation for all images in a resource, thus looping
through all slices is rather pointless, conversion doesn't happen neither.
Also simplify the sampling setup code to use the mip_offsets array in the
resource directly - if the (non display target) resource exists its memory
will already be allocated as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
90abdc1541 llvmpipe: allocate regular texture memory upfront
The deferred allocation doesn't really make much sense anymore, since we no
longer allocate swizzled/linear memory in chunks and not per level / slice
neither.
This means we could fail resource creation a bit more (could already fail in
theory anyway) but should not fail maps later (right now, callers can't deal
with neither really).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
7e1521f191 llvmpipe: get rid of linear_img struct
Just use a tex_data pointer directly - the description was no longer correct
neither.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
b4c3246e7b llvmpipe: (trivial) rename linear_mip_offsets to mip_offsets
Since switching to non-swizzled rendering we only have "normal", aka linear,
offsets.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
188ba1d6ec target-helpers: don't use designated initializers
it looks since ce1a137228 they are now included
in more places, in particular even for things buildable with msvc, and hence
those break the build.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-02 01:55:59 +02:00
Christoph Bumiller
b97b87940b st/mesa: add support for indirect drawing 2014-07-02 00:47:10 +02:00
Marek Olšák
59330f13b0 gallium/u_vbuf: get draw info from an indirect buffer if there's any
This is required for fallbacks to work with ARB_draw_indirect.
2014-07-02 00:47:10 +02:00
Christoph Bumiller
bc198f8e63 gallium: add facilities for indirect drawing
v2:
Added comments to util_draw_indirect, clarified and fixed map size.
Removed unlikely().
2014-07-02 00:47:09 +02:00
Christoph Bumiller
a27b3582a6 gallium: add PIPE_BIND_COMMAND_ARGS_BUFFER
Intended for use with GL_ARB_draw_indirect's DRAW_INDIRECT_BUFFER
target or for D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS.
2014-07-02 00:47:09 +02:00
Dave Airlie
8392179fcc xmlconfig/dri: bool -> unsigned char
Drop stdbool, due to the X server being a pain and having
struct members called bool, although I've sent a patch to fix
that we should retain stupidity here. Use unsigned char
which is what GLboolean is anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-02 08:24:05 +10:00
Cody Northrop
78121e4b8d i965/fs: Update discard jump to preserve uniform loads via sampler.
Commit 17c7ead7 exposed a bug in how uniform loading happens in the
presence of discard.  It manifested itself in an application as
randomly incorrect pixels on the borders of conditional areas.

This is due to how discards jump to the end of the shader incorrectly
for some channels.  The current implementation checks each 2x2
subspan to preserve derivatives.  When uniform loading via samplers
was turned on, it uses a full execution mask, as stated in
lower_uniform_pull_constant_loads(), and only populates four channels
of the destination (see generate_uniform_pull_constant_load_gen7()).
It happens incorrectly when the first subspan has been jumped over.

The series that implemented this optimization was done before the
changes to use samplers for uniform loads.  Uniform sampler loads
use special execution masks and only populate four channels, so we
can't jump over those or corruption ensues.

This fix only jumps to the end of the shader if all relevant channels
are disabled, i.e. all 8 or 16, depending on dispatch.  This
preserves the original GLbenchmark 2.7 speedup noted in commit
beafced2.

It changes the shader assembly accordingly:

before   : (-f0.1.any4h)  halt(8)  17 2  null { align1 WE_all 1Q };
after(8) : (-f0.1.any8h)  halt(8)  17 2  null { align1 WE_all 1Q };
after(16): (-f0.1.any16h) halt(16) 17 2  null { align1 WE_all 1H };

v2: Cleaned up comments and conditional ordering.
v3: Fix typo.

Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Mike Stroyan <mike@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79948
2014-07-01 13:22:28 -07:00
Matt Turner
fcac7020cf i965/fs: Mark case unreachable to silence warning.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
3d826729da i965: Use unreachable() instead of unconditional assert().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
a3d10c2c30 mesa: Make unreachable macro take a string argument.
To aid in debugging.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
e658440234 i965/vec4: Remove useless conditionals.
Setting a couple of bits is the same cost or less as conditionally
setting a couple of bits.
2014-07-01 08:55:52 -07:00
Matt Turner
2e90d1fb62 i965/fs: Pass cfg to calculate_live_intervals().
We've often created the CFG immediately before, so use it when
available.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
ec1b2d6aa0 i965: Mark fields in the live interval classes protected.
cfg, for instance, is a pointer to a local variable in
calculate_live_intervals, certainly not valid after that function has
returned.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
021094481c glsl: Remove now unused foreach_list* macros.
foreach_list_typed_const was never used as far as I can tell.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
266109736a i965: Use typed foreach_in_list_safe instead of foreach_list_safe.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
c5030ac0ac i965: Use typed foreach_in_list instead of foreach_list.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
bc2fbbafd2 i965: Add and use foreach_inst_in_block macros.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
e8e5f0a342 i965/fs: Use is_head_sentinel() instead of ->prev == NULL.
Makes it more clear what we're doing and requires less knowledge of
exec_list.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
d6bb8bb7ce mesa: Add and use foreach_list_typed_safe.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
22cd917329 mesa: Add and use foreach_in_list_use_after.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
d49173a97b glsl: Replace uses of foreach_list_const.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
fd8f65498a glsl: Replace another couple uses of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
6e217ad1d7 glsl: Use foreach_list_typed when possible.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
373824d769 mesa: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
c6a16f6d0e glsl: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
e0cb82d0c4 mesa: Use typed foreach_in_list instead of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
4d78446d78 glsl: Use typed foreach_in_list instead of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
da9f0316e6 glsl: Add typed foreach_in_list_safe macro.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
3597681040 glsl: Add typed foreach_in_list/_reverse macros.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Axel Davy
4d6c9352f3 mesa: fix the condition in src/loader/Makefile.am
We want to have the dri common files compiled to define USE_DRICONF.
We need to check both NEED_OPENGL_COMMON and HAVE_DRICOMMON

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: Brian Paul <brianp@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
ad6e1e12cc mesa: update comment for UniformBufferSize to indicate size is in bytes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
f4b0ab7afd st/mesa: fix incorrect size of UBO declarations
UniformBufferSize is in bytes so we need to divide by 16 to get the
number of constant buffer slots.  Also, the ureg_DECL_constant2D()
function takes first..last parameters so we need to subtract one
for the last value.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
01bf8bb875 st/mesa: don't use address register for constant-indexed ir_binop_ubo_load
Before, we were always using the address register and indirect addressing
to index into a UBO constant buffer.  With this change we only do that
when necessary.

Using the piglit bin/arb_uniform_buffer_object-rendering test as an
example:

Shader code:
  uniform ub_rot {float rotation; };
  ...
  m[1][1] = cos(rotation);

Before:
  IMM[1] INT32 {0, 1, 0, 0}
  1: UARL ADDR[0].x, IMM[1].xxxx
  2: MOV TEMP[0].x, CONST[3][ADDR[0].x].xxxx
  3: COS TEMP[1].x, TEMP[0].xxxx

After:
  0: COS TEMP[0].x, CONST[3][0].xxxx

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
dfca35f807 st/mesa: allow 2D indexing for all shader types in translate_src()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
f11e3dc122 st/mesa: don't ignore const buf index in src_register()
Otherwise, if we were creating a const buffer src register for a UBO
the index into the UBO was always zero.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Ilia Mirkin
5e04526399 nvc0: expose 4 vertex streams, use stream ids in xfb
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
2f2467cb23 nvc0/ir: only merge emit/restart for identical streams
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
e5cdbdecd2 nvc0/ir: avoid creating restarts with non-0 stream
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
40b8aec251 nvc0/ir: fix emitting vertex stream
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
1d16dbf416 mesa/st: add vertex stream support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:37 -04:00
Ilia Mirkin
746e5260f6 gallium: add a cap for max vertex streams
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:35 -04:00
Ilia Mirkin
43e4b3e311 gallium: add an index argument to create_query
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-07-01 11:34:31 -04:00
Ilia Mirkin
7f1b365f65 gallium: add support for stream in so info
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:28 -04:00
Ilia Mirkin
0cbefc1bea gallium: add vertex stream argument to EMIT/ENDPRIM
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:24 -04:00
Matt Turner
1bfc0a1102 i965/fs: Mark predicated PLN instructions with dependency hints.
To implement the unlit_centroid_workaround, previously we emitted

   (+f0) pln(8) g20<1>F g16.4<0,1,0>F g4<8,8,1>F { align1 1Q };
   (-f0) pln(8) g20<1>F g16.4<0,1,0>F g2<8,8,1>F { align1 1Q };

where the flag register contains the channel enable bits from g0.

Since the predicates are complementary, the pair of pln instructions
write to non-overlapping components of the destination, which is the
case that the dependency control hints are designed for.

Typically setting dependency control hints on predicated instructions
isn't safe (if an instruction doesn't execute due to the predicate, it
won't update the scoreboard, leaving it in a bad state) but since we
must have at least one channel executing (i.e., +f0 is true for some
channel) by virtue of the fact that the thread is running, we can put
the +f0 pln instruction last and set the hints:

   (-f0) pln(8) g20<1>F g16.4<0,1,0>F g2<8,8,1>F { align1 NoDDClr 1Q };
   (+f0) pln(8) g20<1>F g16.4<0,1,0>F g4<8,8,1>F { align1 NoDDChk 1Q };

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:06 -07:00
Matt Turner
4fe53ee5d7 i965/fs: Predicate PLN instructions used in unlit centroid WA.
Maybe lets us skip some PLN instructions if whole subspans are disabled?

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:05 -07:00
Matt Turner
6d2536395d i965/fs: Add no_dd_{clear,check} fields to fs_inst.
And plumb them through. Also make the assert in the generator look like
the vec4 one.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:05 -07:00
Matt Turner
bcbb7c41b7 i965/fs: Let sat-prop ignore live ranges if producer already has sat.
This sequence (where both x and w are used afterwards) wasn't handled.

   mul.sat x, y, z
   ...
   mov.sat w, x

We assumed that if x was used after the mov.sat, that we couldn't
propagate the saturate modifier, but in fact x was already saturated.

So ignore the live range check if the producing instruction already
saturates its result. Cuts one instruction from hundreds of TF2 shaders.

total instructions in shared programs: 1995631 -> 1994951 (-0.03%)
instructions in affected programs:     155248 -> 154568 (-0.44%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
e58992aedd i965/fs: Pass const references to emit functions.
Cuts 10k of .text and saves a bunch of useless struct copies.
2014-06-30 22:31:05 -07:00
Matt Turner
35b741c8e7 i965/vec4: Pass const references to instruction functions.
text	   data	    bss	    dec	    hex	filename
4231165	 123200	  39648	4394013	 430c1d	i965_dri.so
4186277	 123200	  39648	4349125	 425cc5	i965_dri.so

Cuts 43k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
d35f34cea9 i965/vec4: Pass const references to vec4_instruction().
text	   data	    bss	    dec	    hex	filename
4244821	 123200	  39648	4407669	 434175	i965_dri.so
4231165	 123200	  39648	4394013	 430c1d	i965_dri.so

Cuts 13k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
e4b05af5d4 i965/fs: Pass const references to instruction functions.
text	   data	    bss	    dec	    hex	filename
4270747	 123200	  39648	4433595	 43a6bb	i965_dri.so
4244821	 123200	  39648	4407669	 434175	i965_dri.so

Cuts 25k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Axel Davy
5d5c20920e radeonsi: Use dma_copy when possible for si_blit.
This improves GLX DRI3 GPU offloading significantly on CPU
bound benchmarks particularly.
No performance impact for DRI2 GPU offloading.

v2: Add missing tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák<marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:10:01 +10:00
Axel Davy
9320c8fea9 glx/dri3: add GPU offloading support.
The differences with DRI2 GPU offloading are:
a) There's no logic for GPU offloading needed in the Xserver

b) for DRI2, the card would render to a back buffer, and
the content would be copied to the front buffer (the same buffers
everytime). Here we can potentially use several back buffers and copy
to buffers with no tiling to share with X. We send them with the
Present extension.

That means than the DRI2 solution is forced to have tearings with GPU
offloading. In the ideal scenario, this DRI3 solution doesn't have this
problem.

However without dma-buf fences, a race can appear (if the card is slow
and the rendering hasn't finished before the server card reads the buffer),
and then old content is displayed. If a user hits this, he should probably
revert to the DRI2 solution (LIBGL_DRI3_DISABLE). Users with cards fast
enough seem to not hit this in practice (I have an Amd hd 7730m, and I
don't hit this, except if I force a low dpm mode)

c) for non-fullscreen apps, the DRI2 GPU offloading solution requires
compositing. This DRI3 solution doesn't have this requirement. Rendering
to a pixmap also works.

d) There is no need to have a DDX loaded for the secondary card.

V4: Fixes some piglit tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:52 +10:00
Axel Davy
3ecd9e1a93 loader: Use drirc device_id parameter in complement to DRI_PRIME
DRI_PRIME is not very handy, because you have to launch the executable
with it set, which is not always easy to do.
By using drirc, the user specifies the target executable
and the device to use. After that the program will be launched everytime
on the target device.

For example if .drirc contains:

<driconf>
    <device driver="loader">
        <application name="Glmark2" executable="glmark2">
            <option name="device_id" value="pci-0000_01_00_0" />
        </application>
    </device>
</driconf>

Then glmark2 will use if possible the render-node of
ID_PATH_TAG pci-0000_01_00_0.

v2: Fix compilation issue
v3: Add "-lm" and rebase.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:40 +10:00
Axel Davy
7ab925a6aa loader: add gpu selection code via DRI_PRIME.
v2: Fix the leak of device_name
v3: Rebased

It enables to use the DRI_PRIME env var to specify
which gpu to use.
Two syntax are supported:
If DRI_PRIME is 1 it means: take any other gpu than the default one.
If DRI_PRIME is the ID_PATH_TAG of a device: choose this device if
possible.

The ID_PATH_TAG is a tag filled by udev.
You can check it with 'udevadm info' on the device node.
For example it can be "pci-0000_01_00_0".

Render-nodes need to be enabled to choose another gpu,
and they need to have the ID_PATH_TAG advertised.
It is possible for not very recent udev that the tag
is not advertised for render-nodes, then
ones need to add a file containing:

SUBSYSTEM=="drm", IMPORT{builtin}="path_id"

in /etc/udev/rules.d/

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:30 +10:00
Axel Davy
da3a47d682 drirc: Add string support
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-07-01 13:06:51 +10:00
Dave Airlie
29800e6a3e dri: remove GL types from config queries
This in theory changes ABI for the boolean->bool I think,
but nothing in the tree uses configQueryb AFAICS.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:06:29 +10:00
Dave Airlie
a513daec29 dri/xmlconfig: remove GL types.
This just drops all the GL types from the xmlconfig and use
std C types from stdint and stdbool.

v2: drop further double and header include.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:03:06 +10:00
Dave Airlie
b94dc944df dri3: cache pointer to back instead of looking up.
This is just prep work for the dri3 prime patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:00:14 +10:00
Alexandre Demers
11a879f260 configure.ac: (trivial) Fixing a typo
Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:50:00 +01:00
Emil Velikov
ce1a137228 targets/egl-static: use inline_drm_helper and Automake.inc helpers
Update all three build systems, and add freedreno to the android
build. Pending future work on the ST we can convert egl-static
to provide either static or dynamic access to the pipe-drivers.

There is no functional change with this patch.

v2: Don't add freedreno to android build, drop the wrapper winsys.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:12 +01:00
Emil Velikov
7689aa28cd targets/gbm: convert to static/shared pipe-driver
Move the gbm "target" code to the state-tracker, similar
to other - dri, omx, vdpau... ST.

v2: Drop inclusion of the wrapper winsys and softpipe/llvmpipe.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:11 +01:00
Emil Velikov
37e640a073 targets/xa: provide alternative(static) xa target
Now we can build the xa target (libxatracker) with either static
pipe-drivers or shared ones. Currently we default to static.

 - Remove the unused CFLAGS/CPPFLAGS.
 - Use GALLIUM_TARGET_CFLAGS where applicable.

v2: Update the printout messages at configure.
v3: Drop inclusion of the wrapper winsys and softpipe/llvmpipe.

Cc: Jakob Bornecrantz <jakob@vmware.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:11 +01:00
Kenneth Graunke
c60a4ba7e3 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>
2014-06-30 14:06:51 -07:00
Kenneth Graunke
5dfbfd17e0 i965/disasm: Delete gen8_disasm.c.
The functionality has been merged into brw_disasm.c; use that instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
e59a9ecc98 i965/disasm: Stop using gen8_disassemble in favor of brw_disassemble.
At this point, brw_disassemble can do everything gen8_disassemble can
do - and, thanks to the new brw_inst API, it supports all generations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
7b7f95b952 i965/disasm: Improve render target write message disassembly.
Previously, we decoded render target write messages as:

   render ( RT write, 0, 16, 12, 0) mlen 8 rlen 0

which made you remember (or look up) what the numbers meant:

1. The binding table index
2. The raw message control, undecoded:
   - Last Render Target Select
   - Slot Group Select
   - Message Type (SIMD8, normal SIMD16, SIMD16 replicate data, ...)
3. The dataport message type, again (already decoded as "RT write")
4. The write commit bit (0 or 1)

Needless to say, having to decipher that yourself is annoying.  Now, we
do:

   render RT write SIMD16 LastRT Surface = 0 mlen 8 rlen 0

with optional "Hi" and "WriteCommit" for slot group/write commit.

Thanks to the new brw_inst API, we can also stop duplicating code on a
per-generation basis.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
0e5b52e35d i965/disasm: Rename msg_target to SFID.
We haven't used the name "message target" in a while - there are a lot
of things called "target", and it gets confusing.  SFID ("Shared
Function ID") is the term commonly used in the modern documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
c4cf088f43 i965/disasm: Fix typo in RT UNORM write message.
The name of this message is "Render Target UNORM Write" (Sandybridge
PRM, Volume 4 Part 1, Page 210).  Drop the bogus 'c'.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
3603dfff6f i965/disasm: Use Gen6+ SFID case labels.
Most developers will recognize the Gen6+ SFID names more quickly than
the Gen4-5 ones.  Given that they're the same values, just use the new
names.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
4fe78f4cc2 i965/disasm: "Handle" Gen8+ HF/DF immediate cases.
We should print something properly, but I'm not sure how to properly
print an HF, and we don't have any DFs today to test with.

This is at least better than the current Gen8 disassembler, which would
simply assert fail.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
f36bebcd5c i965/disasm: Cut piles of duplicate swizzle printing.
Making a helper function saves us from cut and pasting this four times.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
bdcbcc73dd i965/disasm: Properly decode negate source modifiers on Broadwell.
This is a port of Abdiel's 6f9f916b9b
to brw_disasm.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
00b72bbab5 i965/disasm: Improve disassembly of atomic messages on Haswell+.
This backports the atomic message disassembly support from
gen8_disasm.c, which additionally offers support for decoding atomic
surface read/write messages, and showing SIMD modes and other details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
eb3185f686 i965/disasm: Actually disassemble Gen7+ URB opcodes.
I never bothered implementing the disassembler for Gen7+ URB opcodes, so
we were just disassembling them as Ironlake/Sandybridge ones.  This
looked pretty bad when running Paul's GS EndPrimitive tests, as the
"write OWord" message was decoded at ff_sync, which doesn't exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
aa9e23dbe8 i965/disasm: Decode Broadwell's invm/rsqrtm math functions.
We don't use these yet, but we may as well disassemble them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
9a91f92596 i965/disasm: Properly disassemble the "atomic" ThreadCtrl value.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
156c73a899 i965/disasm: Properly disassemble all32h/any32h align1 predicates.
While we're adding things, use symbolic constants rather than magic
numbers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
03084453d7 i965: Add #defines for any32h/all32h predication.
These have existed since Ivybridge.  We don't use them today, but the
Gen8+ disassembler supports them, and I'd like to use symbolic names
rather than magic numbers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
707c42cb96 i965/disasm: Mark ELSE as having UIP on Gen8+.
This makes brw_disasm.c able to disassemble ELSE instructions correctly
on Broadwell.  (gen8_disasm.c already handles this correctly.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
df4eeed0be i965/disasm: Properly disassemble jump targets on Gen4-5.
Previously, our dissasembly for flow control instructions looked like:

0x00000040: else(8)         ip          65540D     { align16 switch };

It didn't print InstCount properly for ELSE/ENDIF, and didn't even
attempt to disassemble PopCount.

Now it looks like:

0x00000040: else(8)         Jump: 4     Pop: 1     { align16 switch };

which is much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
6928959d8e i965/disasm: Improve disassembly of jump targets on Gen6+.
Previously, flow control instructions generated output like:

(+f0) if(8) 12 8  null         0x000c0008UD { align16 WE_normal 1Q };

which included a dissasembly of the register fields, even though those
are meaningless for flow control instructions---those bits are reused
for another purpose.

It also wasn't immediately obvious which number was UIP and which was
JIP.

With this patch, we instead output:

(+f0) if(8)       JIP: 8       UIP: 12      { align16 WE_normal 1Q };

which is much clearer.

The patch also introduces has_uip/has_jip helper functions which clear
up a some generation/opcode checking mess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
6497890bf4 i965/disasm: Add support for new Gen8+ register types.
While we're at it, use proper names rather than magic numbers for the
existing fields.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
5f106b03a9 i965: Restyle brw_disasm.c.
brw_disasm.c basically wasn't following the Mesa coding style at all.
It used 4-space indent instead of 3-space, didn't cuddle braces, didn't
put function return types on a separate line, put extra spaces in
function calls (between the name and parenthesis), and a number of other
things.

This made it fairly obnoxious to work on, since my editor is configured
to follow Mesa style in the Mesa source repository.  Fixing it to follow
a consistent style now should save time dealing with it later.

These modifications were originally generated by:
$ indent -br -i3 -npcs -ce -cs -l80 --no-tabs
with some manual changes afterwards to fit our style better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
5e20e9a830 i965/disasm: Create an "opcode" temporary.
This saves typing brw_inst_opcode(brw, inst) everywhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
3d1992754f i965/disasm: Eliminate opcode pointer.
opcode is just a pointer to opcode_descs; we may as well use that
directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Jason Ekstrand
4000c0112a Remove the ATI_envmap_bumpmap extension
As far as I can tell, the Intel mesa driver is the only driver in the world
still supporting this legacy extension.  If someone wants to do bump
mapping, they can use shaders.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> [v2]
Reviewed-by: Ian Romanick <idr@freedesktop.org> [v3]
2014-06-30 12:02:25 -07:00
Kenneth Graunke
7577cdd830 meta: Use AMD_vertex_shader_layer instead of a GS for layered clears.
On i965, enabling and disabling the GS is not free: you have to do a
full pipeline stall, reconfigure the URB and push constant space, and
emit a bunch of state.  Most clears aren't layered, so the GS isn't
needed in the common case.  But we turned it on universally.

Using AMD_vertex_shader_layer allows us to skip setting up the GS
altogether, while achieving the same effect.

According to Ilia, current nVidia GPUs can't do AMD_vertex_shader_layer.
However, since nouveau is Gallium-based, they're unlikely to ever care
about this path.  Intel and AMD GPUs both support the extension.

Since i965 is the only driver using this path which does layered
rendering, we may as well target it at that.

v2: Improve commit message.  No code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-30 00:08:54 -07:00
Samuel Iglesias Gonsalvez
f3c5b2f7d0 docs: mark "Geometry shader multiple streams" as done for i965
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
5b3492fa3f i965: Enable vertex streams up to MAX_VERTEX_STREAMS.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
0b84fa2c52 mesa: Enable simultaneous queries on different streams.
It should be possible to query the number of primitives written to each
individual stream by a geometry shader in a single draw call. For that
we need to have up to MAX_VERTEX_STREAM separate query objects.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
3178d2474a i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams.
So far we have been using CL_INVOCATION_COUNT to resolve this query but this
is no good with streams, as only stream 0 reaches the clipping stage. Instead
we will use SO_PRIM_STORAGE_NEEDED which can keep track of the primitives sent
to each individual stream.

Since SO_PRIM_STORAGE_NEEDED is related to the SOL stage and according to
ARB_transform_feedback3 we need to be able to query primitives generated in
each stream whether transform feedback is active or not what we do is to
enable the SOL unit even if transform feedback is not active but disable all
output buffers in that case. This effectively disables transform feedback
but permits activation of statistics enabling SO_PRIM_STORAGE_NEEDED even
when transform feedback is not active.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
a374685f09 i965: Implement GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN with non-zero streams.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
ecd9960430 mesa: Include stream information in indexed queries.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Samuel Iglesias Gonsalvez
0e58a3ef2a glsl: include streamId when reading/printing ir_variable IR.
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
a16043ba57 glsl: include streamId when reading/printing emit-vertex and end-primitive IR.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
5d562588a5 i965/gs: Set control data bits for vertices emitted in stream mode.
In stream mode we have to set control data bits with the StreamID
information for every vertex.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
7589683c97 glsl: Validate vertex emission in geometry shaders.
Check if non-zero streams are used. Fail to link if emitting to unsupported
streams or emitting to non-zero streams with output type other than GL_POINTS.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
e877aadde0 glsl: Add support for EmitStreamVertex() and EndStreamPrimitive().
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
4b3fc21032 glsl: Modify ir_end_primitive to have a stream.
This will be necessary to implement EndStreamPrimitive().
EndPrimitive() will produce an ir_end_primitive with the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
8639effefe glsl: Modify ir_emit_vertex to have a stream.
This will be necessary to implement EmitStreamVertex().
EmitVertex() will produce an ir_emit_vertex with the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
9650293b51 i965/gs: Set number of control data bits for stream mode.
If the geometry shader is indeed using streams then we need 2 control data
bits per vertex for the StreamID. If the shader is not using streams then
we don't need control data bits.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
6d3632c9c9 glsl: Store info about geometry shaders that emit vertices to non-zero streams.
On Intel hardware when a geometry shader outputs GL_POINTS primitives we
only need to emit vertex control bits if it emits vertices to non-zero
streams, so use a flag to track this.

This flag will be set to TRUE when a geometry shader calls EmitStreamVertex()
or EndStreamPrimitive() with a non-zero stream parameter in a later patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
598c2e2c83 glsl: Only geometry shader outputs can be associated with non-zero streams.
This should be ensured by the parser, so assert on that.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
e2dd717616 glsl: Two varyings can't write to the same buffer from different streams.
If this is detected, fail to link.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
1e1f071d25 glsl: Add methods to retrive a varying's name and streamId.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
02fd80e160 glsl: Fail to link if inter-stage input/outputs are not assigned to stream 0
Outputs that are linked to inputs in the next stage must be output to stream 0,
otherwise we should fail to link.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
b908e85ed3 glsl: Assign GLSL StreamIds to transform feedback outputs.
Inter-shader outputs must be on stream 0, which is the default.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
37d795317e i965: Enable transform feedback for streams > 0
Configure hardware to read vertex data for all streams and have all streams
write their varyings to the corresponsing output buffers.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
f20c723039 mesa: add StreamId information to transform feedback outputs.
For now initialized to the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Samuel Iglesias Gonsalvez
a7e6ec6898 glsl: Add parsing support for multi-stream output in geometry shaders.
This implements parsing requirements for multi-stream support in
geometry shaders as defined in ARB_gpu_shader5.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Emil Velikov
15b5e663b0 st/omx: strcpy the string into the allocated buffer
This fixes commit a001ca98e15(st/omx: keep the name,
(name|role)_specific strings dynamically allocated) in which we
dynamically allocated the buffers for name and (name|role)_specific
yet forgot to copy the encoder strings into them.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80614
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-28 15:24:45 +01:00
Ilia Mirkin
f230015206 mesa: expose ARB_seamless_cubemap_per_texture when supported
All of the bits appear to already be in place to support this in the
sampler (which the original AMD version didn't allow).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-28 00:51:43 -04:00
Emil Velikov
a001ca98e1 st/omx: keep the name, (name|role)_specific strings dynamically allocated
... as it's caller (the external program omxregister-bellagio) is the one
who frees all of the allocated memory.

Reported-by: Pedretti Fabio <pedretti.fabio@gmail.com>
Tested-by: Fabio Pedretti <pedretti.fabio@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-27 19:13:31 +01:00
Chris Forbes
ed66312426 docs: Update the status of a few things in GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-27 22:13:21 +12:00
Axel Davy
c58486516f nv50: fix dri3 prime buffer creation
This is the same fix than
"nvc0: fix dri3 prime buffer creation"

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 13:38:20 +10:00
Dave Airlie
13eddf3bf2 nvc0: fix dri3 prime buffer creation
We need to place shared buffers into GART.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 13:38:14 +10:00
Axel Davy
df282ce1bf gallium/dri2: implement blitImage
V3: call flush_resource before flush
V4: Add new flags

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
8a66a5de83 dri/image: add blitImage to the specification
It allows to blit two __DRIimages.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
27c686309e gallium: Add __DRIimageDriverExtension support to gallium
__DRIimageDriverExtension is used by GLX DRI3 and Wayland.

This patch is a rewrite of
http://lists.freedesktop.org/archives/mesa-dev/2014-May/060318.html
and
http://lists.freedesktop.org/archives/mesa-dev/2014-May/060317.html

Previous patches were:
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
e40cf256f4 dri3: use invalidate.
This doesn't change anything to the intel DRI3 implementation,
but enables the gallium implementation to use dri2.stamp instead
of relying on the stamp shared with the st backend.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Dave Airlie
e4419913bf dri3: fix image extension checking.
Move the image extension setup in with all the others in
bind_extensions, and improve the check to both version
and function pointer.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Jasper St. Pierre
b4dcf87f34 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>
2014-06-27 09:44:56 +10:00
Kenneth Graunke
8cf289c3ef 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>
2014-06-26 11:50:35 -07:00
Kenneth Graunke
db184d43b0 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>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
a248b2a4eb 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>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
e10311be9f 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>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
fd77187689 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>
2014-06-26 11:50:34 -07:00
Jordan Justen
a46cb6a971 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>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
7c2946fc23 i965: Disassemble all of DP write message control bits on Gen6.
Prior to the new brw_inst API, the brw_instruction structure split off
bits 4 and 5 of msg_control for specific fields, and we failed to
disassemble them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:46:26 -07:00
Matt Turner
40a9754953 i965: Pass brw to brw_try_compact_instruction().
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:25 -07:00
Matt Turner
fa1a3b2e3c i965: Add is_cherryview flag to brw_context.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:24 -07:00
Matt Turner
a25401bc9a i965: Add CSEL opcode definition for Gen8.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:23 -07:00
Matt Turner
e1b477238d i965: Document which instructions are generation specific.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:21 -07:00
Matt Turner
a382b4cb7a i965: Don't set UIP for ENDIF/WHILE.
They don't have a UIP. We used UIP in an array dereference, which never
caused problems on Gen < 8, since UIP was a small integer (number of
instructions). On Gen 8 UIP is in bytes, so it's large enough that it
caused us to read out of bounds of the array.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:19 -07:00
Matt Turner
92233aee47 i965: Replace struct brw_compact_instruction with brw_compact_inst.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:17 -07:00
Matt Turner
eaf78e56af i965: Convert brw_eu_compact.c to the new brw_compact_inst API.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:16 -07:00
Matt Turner
395c759712 i965: Introduce a new brw_compact_inst API.
For now nothing uses this, but we can incrementally convert.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:14 -07:00
Matt Turner
7c79608b5b i965: Replace 'struct brw_instruction' with 'brw_inst'.
Use this an an opportunity to clean up the formatting of some old code
(brw_ADD, for instance).

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:12 -07:00
Matt Turner
290daad497 i965: Throw out guts of struct brw_instruction.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:11 -07:00
Matt Turner
a375092f5c i965: Convert brw_gs_emit.c to the new brw_inst API.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:05 -07:00
Matt Turner
bfbe6a7210 i965: Convert brw_disasm.c to the new brw_inst API.
v2: (by Kenneth Graunke)
 - Fix disassembly of Gen4-5 SEND messages to print base MRF correctly.
 - Only print URB opcode on Gen5+, to match previous output (besides,
   there is only one opcode AFAICT.)
 - Only print the low 3 bits of msg_control, to match previous output.
   (We probably should decode all the fields, but hadn't previously due
   to the brw_instruction structure definition splitting out bits 4/5
   for last_render_target and slot_group_select.)
 - Fix 3-source MRF/GRF file decoding on Sandybridge.
 - Fix compression code to use qtr_control rather than cmpt_control
   (which is compaction, not compression).

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v2]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:01 -07:00
Matt Turner
1149eedffc i965: Pass brw rather than gen to brw_disassemble_inst().
We will need it in order to use the new brw_inst API.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:45:58 -07:00
Matt Turner
9cbf899a7d i965: Convert brw_eu_compact.c to the new brw_inst API.
v2: Use brw_inst_bits rather than pulling out individual fields and
    reassembling them.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:45:50 -07:00
Kenneth Graunke
5e6818faa5 i965: Extend is_haswell checks to gen >= 8 in Gen4-7 generators.
We're going to use fs_generator/vec4_generator for Gen8+ code soon,
thanks to the new brw_instruction API.  When we do, we'll generally
want to take the Haswell paths on Gen8+ as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:47 -07:00
Kenneth Graunke
45cc9ddcc1 i965: Convert test_eu_compact.c to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:46 -07:00
Kenneth Graunke
4362631d7b i965: Convert vec4_generator to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:44 -07:00
Kenneth Graunke
a041eb4030 i965: Convert fs_generator to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:42 -07:00
Kenneth Graunke
eedc5bbc69 i965: Convert Gen4-5 clipping code to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:40 -07:00
Kenneth Graunke
7213e1ddc7 i965: Convert brw_sf_emit.c to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:38 -07:00
Kenneth Graunke
829aac4b67 i965: Convert brw_eu_emit.c to the new brw_inst API.
v2:
 - Fix IF -> ELSE patching on Sandybridge.
 - Don't set base_mrf on Gen6+ in OWord Block Read functions.  (Although
 - the old code did this universally, it shouldn't have - the field
 - doesn't exist on Gen6+ and just got overwritten by the SFID anyway.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:51 -07:00
Kenneth Graunke
607f5eb381 i965: Convert brw_eu.[ch] to use the new brw_inst API.
v2: Don't set flag_reg_nr prior to Gen7 (as it doesn't exist).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:43 -07:00
Kenneth Graunke
d49a9ca8c2 i965: Introduce a new brw_inst API.
This is similar to gen8_instruction, and will eventually replace it.

For now nothing uses this, but we can incrementally convert.
The new API takes the existing brw_instruction pointers to ease
conversion; when done, we can simply drop the old structure and rename
struct brw_instruction -> brw_inst.

v2: (by Matt Turner) Make JIP/UIP functions take a signed argument.
v3: (by Kenneth Graunke)
 - Make Gen4-6 jump target functions take a signed argument.
 - Fix indirect align1 AddrImm bits on Gen4-7.
 - Fix SFID on Sandybridge to use bits 27:24.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v1, v3+]
Signed-off-by: Matt Turner <mattst88@gmail.com> [v2]
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:24 -07:00
Kenneth Graunke
05040d6f8f i965: Pass brw into next_offset().
The new brw_inst API is going to require a brw pointer in order
to access fields (so it can do generation checks).  Plumb it in now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:22 -07:00
Greg Hunt
890287b96b i965: Remove unneeded VS workaround stalls on Baytrail.
According to the workarounds list, these stalls aren't needed on
production Baytrail systems.  Piglit confirms that as well.

These cause a small slowdown when we are sending a large number of small
batches to the GPU.  Removing these improves performance by up to 5% on
some CPU bound SynMark tests (Batch[4-7], DrvState1, HdrBloom,
Multithread, ShMapPcf).

Signed-off-by: Gregory Hunt <greg.hunt@mobica.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:31:28 -07:00
Kenneth Graunke
05126b9bb5 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>
2014-06-26 11:31:27 -07:00
Roland Scheidegger
b1c1c7d31b softpipe: use last_level from sampler view, not from the resource
The last_level from the sampler view may be limited by the state tracker
to a value lower than what the base texture provides.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-26 16:57:12 +02:00
Emil Velikov
f3a97c0381 targets/automake.inc: s/GALLIUM_VIDEO_CFLAGS/GALLIUM_TARGET_CFLAGS/
The flags are not specific to the video targets plus
we can reuse them for targets/xa and targets/gbm.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
f6723392e3 auxiliary/vl: Remove no longer used SPLIT_TARGETS
Required for the conversion stage of all VL targets to
a single library per API (static/shared pipe-drivers).

No longer required as per last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
11bce6a94e targets/radeonsi/omx: convert to static/shared pipe-drivers
The radeonsi counterpart of previous commit - now libomx-radeonsi is
built into the libomx-mesa library. Providing a single library per API.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

This patch concludes the unification. Now libomx-mesa will be used
for all hardware - r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: 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-06-26 14:05:13 +01:00
Emil Velikov
d23497c256 targets/r600/omx: convert to static/shared pipe-drivers
The r600 counterpart of previous commit - now the libomx-r600 is
built into the libomx-mesa library. Providing a single library per API.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: 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-06-26 14:05:13 +01:00
Emil Velikov
b1f4a9681f targets/omx-nouveau: convert to static/shared pipe-drivers
Similar to the vdpau/xvmc targets, we're going to convert the
multiple target libraries into a single one.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
c35cf3400f st/omx: avoid using dynamic vid_(enc|dec)_base and avc_(name|role)
Strictly speaking we should not have done this in the
first place, as all of the above should be static across
the system.

Currently this may cause some minor issues, which will be
resolved in the following patches, by providing a single
library for the OMX api.

Cleanup a few unneeded strcpy cases while we're around.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:12 +01:00
Emil Velikov
9a9742f92c st/omx: provide constant number of components
The number of components and their names/roles should
be kept constant as all of that information cached.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:12 +01:00
Juha-Pekka Heikkila
2670d0f91d glx: Added missing null check in GetDrawableAttribute()
For GLX_BACK_BUFFER_AGE_EXT query added extra null check.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
0f7958aac2 mesa/main: In register_surface() verify gl_texture_object was found
Verify _mesa_lookup_texture() returned valid pointer before using it.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
cc5abf0460 mesa/main: Verify calloc return value in register_surface()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
568c545b7e glsl: Add missing null check in push_back()
Report memory error on realloc failure and don't leak any memory.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
088da3720f glsl: check _mesa_hash_table_create return value in link_uniform_blocks
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
db081b497e i965/fs: Check variable_storage return value in fs_visitor::visit
check variable_storage() found the requested fs_reg.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
78a89d6fa0 i965: Handle miptree creation failure in intel_alloc_texture_storage()
Check intel_miptree_create() return value before using it as
a pointer.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
375943bc0a i965: Check calloc return value in gather_statistics_results()
Check calloc return value and report on error, also later skip
results handling if there was no memory to store results to.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Matt Turner
9a8acafa47 i965/vec4: Try constant propagate after copy propagate made progress.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:57 -07:00
Matt Turner
d5432e3f45 i965/vec4: Make try_copy_propagate() static.
Now that can_do_source_mods() isn't part of the visitor, this doesn't
need to be either.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:56 -07:00
Matt Turner
7526df70ea i965/vec4: Rename try_copy/constant_propagat{ion,e} to match the fs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:55 -07:00
Matt Turner
7192207de1 i965/vec4: Constant propagate into 2-src math instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:54 -07:00
Matt Turner
038eb649b3 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>
2014-06-25 13:00:53 -07:00
Matt Turner
aca4a951ea i965/fs: Make try_constant_propagate() static.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:51 -07:00
Matt Turner
46659d46a8 i965: Make can_do_source_mods() a member of the instruction classes.
Pretty nonsensical to have it as a method of the visitor just for access
to brw.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:48 -07:00
Chris Forbes
b4ef7c596b glsl: Treat an interface block specifier as a level of struct nesting
Fixes the piglit test:

   spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block-instanced.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:32 +12:00
Chris Forbes
91b8ecbe1c glsl: Disallow primitive type layout qualifier on variables.
This only makes any sense on the GS input or output layout declaration,
nowhere else.

Fixes the piglit tests:

  * spec/glsl-1.50/compiler/incorrect-in-layout-qualifiers-with-variable-declarations.geom
  * spec/glsl-1.50/compiler/incorrect-out-layout-qualifiers-with-variable-declarations.geom
  * spec/glsl-1.50/compiler/layout-fs-no-output.frag
  * spec/glsl-1.50/compiler/layout-vs-no-input.vert
  * spec/glsl-1.50/compiler/layout-vs-no-output.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:25 +12:00
Chris Forbes
d4703f9446 glsl: Relax combinations of layout qualifiers with other qualifiers.
Previously we disallowed any combination of layout with interpolation,
invariant, or precise qualifiers. There is very little spec guidance on
exactly which combinations should be allowed, but with ARB_sso it's
useful to allow these qualifiers with rendezvous-by-location.

Since it's unclear exactly where the layout qualifier should appear when
combined with other qualifiers, we will allow it anywhere before the
auxiliary storage qualifier.

This allows enough flexibility for all examples I've seen, while keeping
the auxiliary-storage-qualifier / storage-qualifier pair together (as
they are a single qualifier in the spec prior to
ARB_shading_language_420pack)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:01 +12:00
Ian Romanick
316dafa27d glsl: Don't convert reductions of ivec to a dot-product
Mesa has an optimization that converts expressions like "v.x + v.y + v.z
+ v.w" into dot(v, 1.0).  And therein lies the rub: the other operand to
the dot-product is always a float... even if the vector is an ivec or
uvec.  This results in an assertion failure in ir_builder.

If the base type of the operand is not float, don't try the
optimization.  Dot-product is not valid on integer data.

Fixes piglit vs-integer-reduction.shader_test and OpenGL ES conformance
test ES2-CTS.gtf.GL2Tests.glGetUniform.glGetUniform.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-06-25 10:56:32 -07:00
Carl Worth
4ccbbbdd74 docs: Import 10.2.2 release notes, add news item 2014-06-24 21:49:38 -07:00
Carl Worth
4076cbceaf docs: Import 10.1.6 release notes, add news item 2014-06-24 21:40:15 -07:00
Takashi Iwai
6b8b17153a 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>
2014-06-25 02:15:49 +02:00
Matt Turner
48f1143c64 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>
2014-06-24 11:51:54 -07:00
Matt Turner
b24e1cc604 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>
2014-06-24 11:51:54 -07:00
Matt Turner
0e800dfe75 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>
2014-06-24 11:51:54 -07:00
Bruno Jiménez
c997007f66 r600g/compute: Defer the creation of the temporary resource
For the first use of a buffer, we will only need the temporary
resource in the case that a user wants to write/map to this buffer.

But in the cases where the user creates a buffer to act as an
output of a kernel, then we were creating an unneeded resource,
because it will contain garbage, and would be copied to the pool,
and destroyed when promoting.

This patch avoids the creation and copies of resources in
this case.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-24 12:37:36 -04:00
Jan Vesely
fec2a08eae r600g/compute: Handle failures in compute_memory_pool_finalize
Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:37:30 -04:00
Jan Vesely
9575225e12 r600g/compute: Fix possible endless loop in compute_memory_pool allocations.
The important part is the change of the condition to <= 0. Otherwise the loop
gets stuck never actually growing the pool.

The change in the aux-need calculation guarantees max 2 iterations, and
avoids wasting memory in case a smaller item can't fit into a relatively larger
pool.

Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:36:55 -04:00
Jan Vesely
0c181cdc6c r600: Fix use after free in compute_memory_promote_item.
The dst pointer needs to be initialized after any calls to
 compute_memory_grow_pool, as the function might change the pool->vbo pointer.

This fixes crashes and assertion failures in two gegl tests.

Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:04:54 -04:00
Ilia Mirkin
a59f2bb17b 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>
2014-06-24 09:30:25 -04:00
Fredrik Höglund
41d759d076 mesa: Don't use derived vertex state in api_arrayelt.c
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-24 07:15:30 +02:00
Ilia Mirkin
ea91d629df nvc0: allow VIEWPORT_INDEX and LAYER to be used as input semantics
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-23 19:23:16 -04:00
Ilia Mirkin
a91a556c81 mesa/st: handle gl_Layer input semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-23 19:23:16 -04:00
Tobias Klausmann
98a86f61a8 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>
2014-06-23 19:23:16 -04:00
Roland Scheidegger
604e54de78 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>
2014-06-24 00:37:52 +02:00
Kenneth Graunke
f6a99d1167 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>
2014-06-23 13:29:39 -07:00
Emil Velikov
2442d3553f targets/(vdpau|xvmc): hardlink against the installed library
With commit 11e46a32ae and f9ebb1ea77 we resolved the symlink
generation required by the versioning of the library.
Although they incorrectly changed the way hardlinks are created by
linking to the ones from the build tree. If the device used for
building differs from the one set as destination linking will fail.

Reported-by: Andy Furniss <adf.lists@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 20:57:01 +01:00
Neil Roberts
5f11b10f2c i965: Allow the blorp blit between BGR and RGB
Previously the blorp blitter would only be used if the format is identical or
there is only a difference between whether there is an alpha component or not.
This patch makes it also allow the blorp blitter if the only difference is the
ordering of the RGB components (ie, RGB or BGR).

This is particularly useful since commit 61e264f4fc because Mesa now
prefers RGB ordering for textures but the window system buffers are still
created as BGR. That means that the blorp blitter won't be used for the
(probably) common case of blitting from a texture to the window system buffer.

This doesn't cause any regressions in the FBO piglit tests on Haswell. On
Sandybridge it causes the fbo-blit-stretch test to fail but that is only
because it was failing anyway before the above commit and that commit hid the
problem.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68365
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-23 19:59:40 +01:00
Ian Romanick
3552aa7c1c glsl: Silence many unused parameter warnings
In file included from ../../src/glsl/builtin_functions.cpp:61:0:
../../src/glsl/glsl_parser_extras.h:154:9: warning: unused parameter 'var' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-23 11:24:25 -07:00
Emil Velikov
f9ebb1ea77 targets/xvmc: correctly generate the symlinks
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 15:54:36 +01:00
Emil Velikov
11e46a32ae targets/vdpau: correctly generate the symlinks
Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 15:53:26 +01:00
Ville Syrjälä
ca55a1aaa7 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>
2014-06-23 12:42:00 +03:00
Iago Toral Quiroga
c822db6a05 mesa: Make Geom.UsesEndPrimitive a bool instead of a GLboolean 2014-06-23 07:55:51 +02:00
Emil Velikov
df71b39f5c targets/r600/xvmc: convert to static/shared pipe-drivers
The r600 equivalent of previous commit.

v2: Correctly include the radeon winsys/radeon_common.

Cc: 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>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:07 +01:00
Emil Velikov
dc01ca44a7 targets/xvmc-nouveau: convert to static/shared pipe-drivers
Similar to vdpau targets, we're going to convert the individual
target libraries into a single one.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:04 +01:00
Emil Velikov
291d70210d targets/radeonsi/vdpau: convert to static/shared pipe-drivers
Similar to previous commits, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: 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>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:01 +01:00
Emil Velikov
f85e7ce057 targets/r600/vdpau: convert to static/shared pipe-drivers
Similar to previous commit, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: 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>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:58 +01:00
Emil Velikov
9df2c4956b targets/vdpau-nouveau: convert to static/shared pipe-drivers
Create a single library (for the vdpau api) thus reducing
the overall size of mesa. Current commit converts
vdpau-nouveau, with upcomming commits handling the rest.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Add SPLIT_TARGETS to guard the other VL targets.

Note: symlink handling is rather ugly and will need an
update to work with BSD and other non-linux platforms.

v2: Split the conversion into per-target basis.

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:49 +01:00
Chris Forbes
8b2e0ddf8a Partially revert "glsl: Add builtin define for ARB_fragment_layer_viewport"
This partially reverts commit cc18b1ec21,
which dropped some unrelated code due to a fumbled rebase.
2014-06-22 23:54:21 +12:00
Rob Clark
1f3ca56b76 freedreno: use util_copy_framebuffer_state()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:28:17 -04:00
Rob Clark
c63450e829 freedreno/a3xx: WFI fixes/cleanup
Blob driver seems to need WFI in some cases after CP_EVENT_WRITE,
implying that this is asynchronous and should reset needs_wfi.
Also, CP_INVALIDATE_STATE seems to need WFI.  But CP_LOAD_STATE
does not.

The blob driver also puts WFIs before writing GRAS_CL_VPORT registers.
The latter may be a work-around, as these registers should be banked/
context registers.  I haven't yet found a lockup that this averts, but
I expect viewport to change infrequently so out of paranoia I will
keep these for now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:25:43 -04:00
Chris Forbes
b2c1f3a019 glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:19 +12:00
Chris Forbes
cc18b1ec21 glsl: Add builtin define for ARB_fragment_layer_viewport
The spec doesn't actually mention adding this, but this is the usual
pattern so I'm assuming it's a spec bug.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:17 +12:00
Chris Forbes
fcc9b4c15e glsl: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:15 +12:00
Chris Forbes
51c82bddef mesa: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:13 +12:00
Chris Forbes
22448c819d glapi: Add (empty) api section for ARB_fragment_layer_viewport
This extension is purely GLSL -- there are no new GL API elements.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:51:29 +12:00
Kenneth Graunke
a20994d616 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>
2014-06-21 10:47:47 -07:00
Emil Velikov
dfaf6116c9 scons: avoid building any piece of i915
Leftover from commit c21fca8bf2.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2014-06-21 16:43:10 +01:00
Aaron Watry
564821c917 gallivm: Fix build after LLVM commit 211259
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 19:49:18 -05:00
Daniel Manjarres
86bd2196b4 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>
2014-06-20 11:04:04 -07:00
Bruno Jiménez
2d2af4cd2c r600g/compute: Use gallium util functions for double lists
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:12 -04:00
Bruno Jiménez
257d697fb9 r600g/compute: Map only against intermediate buffers
With this we can assure that mapped buffers will never change
its position when relocating the pool.

This patch should finally solve the mapping bug.

v2: Use the new is_item_in_pool util function,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:08 -04:00
Bruno Jiménez
9b933b73a9 r600g/compute: Implement compute_memory_demote_item
This function will be used when we want to map an item
that it's already in the pool.

v2: Use temporary variables to avoid so many castings in functions,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:04 -04:00
Bruno Jiménez
0b8c29915b r600g/compute: Avoid problems when promoting items mapped for reading
Acording to the OpenCL spec, it is possible to have a buffer mapped
for reading and at read from it using commands or buffers.

With this we can keep the mapping (that exists against the
temporary item) and read with a kernel (from the item we have
just added to the pool) without problems.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:00 -04:00
Bruno Jiménez
3da1b17555 r600g/compute: Only move to the pool the buffers marked for promoting
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:57 -04:00
Bruno Jiménez
4d1e4429e6 r600g/compute: divide the item list in two
Now we will have a list with the items that are in the pool
(item_list) and the items that are outside it (unallocated_list)

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:54 -04:00
Bruno Jiménez
e3dfe3f7b2 r600g/compute: Add statuses to the compute_memory_items
These statuses will help track whether the items are mapped
or if they should be promoted to or demoted from the pool

v2: Use the new is_item_in_pool util function,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:50 -04:00
Bruno Jiménez
9e491eb5d7 r600g/compute: Add an util function to know if an item is in the pool
Every item that has been placed in the pool must have start_in_dw
different from -1.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:46 -04:00
Bruno Jiménez
0038402753 r600g/compute: Add an intermediate resource for OpenCL buffers
This patch changes completely the way buffers are added to the
compute_memory_pool. Before this, whenever we were going to
map a buffer or write to or read from it, it would get placed
into the pool. Now, every unallocated buffer has its own
r600_resource until it is allocated in the pool.

NOTE: This patch also increase the GPU memory usage at the moment
of putting every buffer in it's place. More or less, the memory
usage is ~2x(sum of every buffer size)

v2: Cleanup

v3: Use temporary variables to avoid so many castings in functions,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:28 -04:00
Iago Toral Quiroga
96a95f48ea 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>
2014-06-20 09:50:54 +02:00
Iago Toral Quiroga
ec712bf469 mesa: Init Geom.UsesEndPrimitive in shader programs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-20 09:50:54 +02:00
Matt Turner
e974781301 glsl: Optimize (v.x + v.y) + (v.z + v.w) into dot(v, 1.0).
Cuts five instructions out of SynMark's Gl32VSInstancing benchmark.
2014-06-19 16:11:52 -07:00
Matt Turner
f043971097 glsl: Pass in options to do_algebraic().
Will be used in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-19 16:11:51 -07:00
Matt Turner
1d9f74eda7 glsl: Rebalance expression trees that are reduction operations.
The intention of this pass was to give us better instruction scheduling
opportunities, but it unexpectedly reduced some instruction counts as
well:

total instructions in shared programs: 1666639 -> 1666073 (-0.03%)
instructions in affected programs:     54612 -> 54046 (-1.04%)
(and trades 4 SIMD16 programs in SS3)
2014-06-19 16:11:51 -07:00
Emil Velikov
d300f3f51a automake: include the libdeps in the correct order
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80254
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 22:53:56 +01:00
Francisco Jerez
4a39e5073a clover: Calculate the serialized size of a module efficiently.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:19 +02:00
Francisco Jerez
ab023c27a3 clover: Optimize module serialization for vectors of fundamental types.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:08 +02:00
Roland Scheidegger
cad60420d5 gallivm: set mcpu when initializing llvm execution engine
Previously llvm detected cpu features automatically when the execution engine
was created (based on host cpu). This is no longer the case, which meant llvm
was then not able to emit some of the intrinsics we used as we didn't specify
any sse attributes (only on avx supporting systems this was not a problem since
despite at least some llvm versions enabling it anyway we always set this
manually). So, instead of trying to figure out which MAttrs to set just set
MCPU.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2014-06-19 16:58:00 +02:00
Tom Stellard
4aa128a123 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>
2014-06-19 10:41:10 -04:00
Tom Stellard
0cc391f013 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>
2014-06-19 10:18:26 -04:00
Michel Dänzer
93b6b1fa83 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>
2014-06-19 09:58:03 -04:00
Emil Velikov
949beb0b84 configure: add HAVE_GALLIUM_STATIC_TARGETS
Will be used to control the linking mode of pipe-drivers
in gallium targets.

Keep this hardcoded to static, as the pipe-drivers bare
an unstable interface which we do not want to expose to
the normal user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:46:19 +01:00
Emil Velikov
d22b39e4db targets: use GALLIUM_PIPE_LOADER_WINSYS_LIB_DEPS
Drop ~50 lines of buildsystem mayhem.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
571b2467ca automake: introduce helper variable
- gallium_pipe_loader_winsys_libs

Will be used in upcomming commits to reduce duplication
in the build.

v2: Drop the megadriver/static_target variables.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
86c30c6c5b target-helpers: add dd_configuration(), dd_driver_name()
Add a couple of helpers to be used by the dri targets when
built with static pipe-drivers. Both functions provide
functionality required by the dri state-tracker.

With this patch ilo, nouveau and r300 gain support for
throttle dri configuration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
573b55e302 target-helpers: add dd_create_screen() helper
Will be used by gallium targets that statically link the
pipe-drivers in the final library. Provides identical
functionality to device_descriptor.create_screan.

v2:
 - Don't sw_screen_wrap the i915/svga screen.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:39:50 +01:00
Emil Velikov
1e414faa5e target-helpers: add a note about debug wrappers
If memory serves me right, at least one debug wrapper does
not return the base screen on failure.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:15 +01:00
Emil Velikov
665a4d9d9b targets/pipe-loader: add driver specific drm_configuration
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
36ff20027c pipe-loader: add pipe_loader_ops::configuration()
Required for the dri state-tracker. Will be used to retrieve
driver specific configuration parameters:
 - share_fd (dmabuf) capability
 - throttle

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
7f00611d78 pipe-loader: note that we leak pipe_loader_drm_device->base->driver_name
The string is malloc'd (strdup) in loader_get_driver_for_fd().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
6984e8db91 automake: stop building i915-sw and drop explicit linking to softpipe
Unused and possibly broken. Will be completely removed in
upcomming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Ilia Mirkin
25182e249e 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>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
e1fe1435b1 nv30: tidy screen caps, add missing ones
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
c092c46b27 nv30: avoid dangling references to deleted contexts
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
5af80f6268 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>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
22e9551af0 nv50: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
b03be4b0ee nvc0: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
7e7097a4f4 nvc0: remove vport_int hack and instead use the usual state validation
Commit ad4dc772 fixed an issue with the viewport not being restored
correctly. However it's rather hackish and confusing. Instead just mark
the viewport dirty and let the viewport validation take care of it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
David Heidelberger
8658fe3e4c r300g: don't advertize PIPE_FORMAT_B10G10R10X2_UNORM on < r500
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-19 01:43:09 +02:00
Marek Olšák
57f3da997a radeonsi: implement ARB_texture_query_lod
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:18:17 +02:00
Marek Olšák
6a2b38381e radeonsi: pass ARB_conservative_depth parameters to the hardware
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:17:36 +02:00
Marek Olšák
1df7199fc9 gallium: implement ARB_texture_query_levels
The extension is always supported if GLSL 1.30 is supported.

Softpipe and llvmpipe support is also added (trivial).
Radeon and nouveau support is already done.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:36 +02:00
Marek Olšák
552c70a837 st/mesa: set sampler_view::last_level correctly
It was set to pipe_resource::last_level and _MaxLevel was embedded in max_lod,
that's why it worked for ordinary texturing. However, min_lod doesn't have
any effect on texelFetch and textureQueryLevels, so we must still set
last_level correctly.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Dave Airlie
c530282bbc st/mesa: handle array textures in st_texture_image_copy
Marek: also handle cube arrays

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Marek Olšák
6818e117ce radeonsi: cosmetic changes in si_shader.c
reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák
c7b5a5c4a3 radeonsi: implement ARB_texture_gather and Gather functions from GLSL 4.00
All ARB_texture_gather and gather-related ARB_gpu_shader5 piglit tests pass.

reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák
0df3551bf4 st/mesa: fix geometry shader max texture limit in state validation
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-19 00:14:00 +02:00
Marek Olšák
bb867e2f2f r600g: fix the max vertex shader input limit 2014-06-19 00:14:00 +02:00
Ian Romanick
cc219d1d65 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>
2014-06-18 14:45:25 -07:00
Roland Scheidegger
56335b4441 gallivm: fix SCALED -> NORM conversions
Such conversions (which are most likely rather pointless in practice) were
resulting in shifts with negative shift counts and shifts with counts the same
as the bit width. This was always undefined in llvm, the code generated was
rather horrendous but happened to work.
So make sure such shifts are filtered out and replaced with something that
works (the generated code is still just as horrendous as before).

This fixes lp_test_format, https://bugs.freedesktop.org/show_bug.cgi?id=73846.

v2: prettify by using build context shift helpers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-18 19:52:57 +02:00
Kristian Høgsberg
7928b946ad 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>
2014-06-18 10:15:03 -07:00
Juha-Pekka Heikkila
fe5224b16a mesa: In emit_texenv() type mismatch was forced with typecast
Type mismatch caused random memory to be copied when casted
memory area was smaller than expected type.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-18 16:15:51 +03:00
Grigori Goronzy
6cd30f5d73 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>
2014-06-18 13:58:52 +02:00
Grigori Goronzy
cf05f9bf01 radeonsi: add sampling of 4:2:2 subsampled textures
This makes 4:2:2 video surfaces work in VDPAU.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-18 13:58:37 +02:00
Grigori Goronzy
f5dafc156a util/u_format: move utility function from r600g
We need this for radeonsi, and it might be useful for other drivers,
too.
2014-06-18 13:58:19 +02:00
Leo Liu
700100d94b radeon/vce: set number of cpbs based on level
v2: add error check for cpb size 0

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:27 +02:00
Leo Liu
0796483282 radeon/vce: implement h264 level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:23 +02:00
Leo Liu
e2db7c10d6 st/omx/enc: implement h264 level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:20 +02:00
Leo Liu
4fca06a902 vl: add level interface
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:17 +02:00
Leo Liu
cb9fcc5c44 st/st/omx: fix switch-case indentation in vid_enc.c
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:52:54 +02:00
Jon TURNEY
83821ece79 glx: Add an error message when a direct renderer's createScreen() routine fails
because no matching fbConfigs or visuals could be found.

Nearly all the error cases in *createScreen() issue an error message to diagnose
the failure to initialize before branching to handle_error.  The few remaining
error cases which don't should probably do the same.

(At the moment, it seems this can be triggered in drisw with an X server which
reports definite values for MAX_PBUFFFER_(WIDTH|HEIGHT|SIZE), because those
attributes are checked for an exact match against 0.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-18 09:55:45 +01:00
Chia-I Wu
88b887faa9 i965/vec4: unit test for copy propagation and writemask
This unit test demonstrates a subtle bug fixed by
4ddf51db6a.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-18 13:43:05 +08:00
Matt Turner
6c2d815d64 i965/vec4/gs: Silence warning about unused 'success' in release build.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:41 -07:00
Matt Turner
17f2dd7274 i965/disasm: Mark three_source_reg_encoding[] static.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:39 -07:00
Matt Turner
9f7b5fa2c8 i965/blorp: Remove unused 'brw' member.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:38 -07:00
Matt Turner
73ab06f9c5 i965/blorp: Mark branch unreachable to silence uninitialized var warning.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:36 -07:00
Matt Turner
f3aecefa99 i965: Silence warning about unused brw in release builds.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:34 -07:00
Matt Turner
836f4299e8 i965: Mark backend_instruction and bblock_t as structs.
They have to be marked as structs for C code elsewhere. bblock_t is
already defined as a struct, and all of backend_instruction's fields are
public anyway.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:33 -07:00
Matt Turner
83649587c6 i965: Use standard SSE intrinsics instead of gcc built-ins.
Let's this file compile with clang.

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:20 -07:00
Matt Turner
52a4065493 mesa: Remove unused functions from perfomance query code.
Perhaps useful for debugging? Never used otherwise. Added by commit
8cf5bdad.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:18 -07:00
Matt Turner
7f3f9b1a68 mesa: Remove unused extra_EXT_texture_integer.
Unused since commit b6475f94.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:17 -07:00
Matt Turner
9f4e776433 mesa: Mark default case unreachable to silence warning.
Warned about 'coord' being undefined in the default case, which is
unreachable.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:14 -07:00
Matt Turner
6ac5adce63 egl: Remove unused variable dri_driver_path.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:12 -07:00
Matt Turner
d2458a4710 swrast: Remove unused solve_plane_recip().
Unused since commit 9e8a961d.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:11 -07:00
Matt Turner
db650d9ec1 glsl: Remove 'struct' from ir_variable declaration.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:06 -07:00
Matt Turner
ebc7524503 Revert "i965: Add 'wait' instruction support"
This reverts commit 20be3ff576.

No evidence of ever being used.
2014-06-17 10:16:23 -07:00
Matt Turner
fab92fa1cb i965/fs: Optimize SEL with the same sources into a MOV.
instructions in affected programs:     474 -> 462 (-2.53%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-17 09:40:31 -07:00
Matt Turner
35bc02dee8 i965/fs: Perform CSE on texture operations.
Helps Unigine Tropics and some (old) gstreamer shaders in shader-db.

instructions in affected programs:     792 -> 744 (-6.06%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-17 09:40:31 -07:00
Matt Turner
18372a7100 i965/fs: Copy propagate from load_payload.
But only into non-load_payload instructions. Otherwise we would prevent
register coalescing from combining identical payloads.
2014-06-17 09:40:30 -07:00
Matt Turner
31ae9c25ff i965/fs: Perform CSE on load_payload instructions if it's not a copy.
Since CSE creates instructions, if we let CSE generate things register
coalescing can't remove, bad things will happen. Only let CSE combine
non-copy load_payloads.

E.g., allow CSE to handle this

   load_payload vgrf4+0, vgrf5, vgrf6

but not this

   load_payload vgrf4+0, vgrf5+0, vgrf5+1
2014-06-17 09:40:30 -07:00
Matt Turner
8f4e324be2 i965/fs: Support register coalescing on LOAD_PAYLOAD operands. 2014-06-17 09:40:07 -07:00
Matt Turner
4b7bca8979 i965/fs: Emit load_payload instead of multiple MOVs for large VGRFs. 2014-06-17 09:40:07 -07:00
Matt Turner
68b7b03429 i965/fs: Only consider real sources when comparing instructions. 2014-06-17 09:38:06 -07:00
Matt Turner
856860db4a i965/fs: Apply cube map array fixup and restore the payload.
So that we don't have partial writes to a large VGRF. Will be cleaned up
by register coalescing.
2014-06-17 09:38:06 -07:00
Matt Turner
15b6ab04e2 i965/fs: Use LOAD_PAYLOAD in emit_texture_gen7(). 2014-06-17 09:38:06 -07:00
Matt Turner
138905d728 i965/fs: Lower LOAD_PAYLOAD and clean up.
Clean up with with register_coalesce()/dead_code_eliminate().
2014-06-17 09:38:05 -07:00
Matt Turner
b996216384 i965/fs: Add SHADER_OPCODE_LOAD_PAYLOAD.
Will be used to simplify the handling of large virtual GRFs in SSA form.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-06-17 09:38:05 -07:00
Tapani Pälli
39cdf1621e glsl: type check between switch init-expression and case
Patch adds a type check between switch init-expression and case label
and performs a implicit signed->unsigned type conversion when possible.

v2: add GLSL spec reference, do implicit conversion if possible (Matt)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79724
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-17 08:13:28 +03:00
Tobias Klausmann
5357c14da4 nv50/ir: Remove NV50_SEMANTIC_VIEWPORTINDEX
Use TGSI_SEMANTIC_VIEWPORT_INDEX for the last consumer.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:32 -04:00
Tobias Klausmann
cd01e1667a docs: update GL3.txt, relnotes: mark GL_ARB_viewport_array as done for nvc0
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:32 -04:00
Tobias Klausmann
a2cb3a4a4f nvc0: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
[imirkin: mark things dirty on ctx switch, 3d blit]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:03 -04:00
Ilia Mirkin
af05270ccf 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>
2014-06-16 23:08:03 -04:00
Kenneth Graunke
49659ad90c 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>
2014-06-16 17:23:21 -07:00
Kenneth Graunke
fa35b272a0 i965: Make INTEL_DEBUG=mip print out whether HiZ is enabled.
We only enable HiZ for miplevels which are aligned on 8x4 blocks.  When
debugging HiZ failures, it's useful to know whether a particular
miplevel is using HiZ or not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-16 17:22:29 -07:00
Jordan Justen
380dd3be02 glsl/cs: Fix local_size_y and local_size_z
flags.q.local_size has 3 bits. One each for x, y and z.

Fixes piglit's:
* spec/ARB_compute_shader/linker/mismatched_local_work_sizes
* spec/ARB_compute_shader/compiler/default_local_size.comp
* spec/ARB_compute_shader/compiler/work_group_size_too_large
* spec/ARB_compute_shader/compiler/gl_WorkGroupSize_matches_layout.comp

This was regressed in 738c9c3c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-16 09:54:52 -07:00
Jordan Justen
539cd92476 main/extensions: Only parse MESA_EXTENSION_OVERRIDE once
Previously, we would parse MESA_EXTENSION_OVERRIDE each time a context
was created. Now we will save the results of that parsing and use it
during context initialization.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
ac3e2efeff main/extensions: Build list of extensions that can't be disabled
This will allow us to utilize the early MESA_EXTENSION_OVERRIDE
parsing at the later extension string initialization step.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
863f57ee1b main/extensions: Create extra extensions override string
This will allow us to utilize the early MESA_EXTENSION_OVERRIDE
parsing at the later extension string initialization step.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
10e03b4401 i965/cs: Use override structure rather than separate env var
In 25268b93, we added a new environment variable
(INTEL_COMPUTE_SHADER) to allow some constant values to be upgraded
for the ARB_compute_shader extension.

Now, we can look to see if the extension was enabled via the
MESA_EXTENSION_OVERRIDE environment variable.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
f5ca8c1972 main/extensions: Add early extension override structures
During the early one_time_init phase of context creation, we
initialize two global gl_extensions structures.

We read the MESA_EXTENSION_OVERRIDE environment variable, and store
positive and negative overrides in two structures:
* struct gl_extensions _mesa_extension_override_enables
* struct gl_extensions _mesa_extension_override_disables

These are filled before the driver initializes extensions and
constants, therefore the driver can make adjustments based on the
desired overrides.

This can be useful during development of a new extension where the
extension is only partially ready. The driver can't actually advertise
support for the extension, but if it sees that the override is set for
the extension, then it can expose more supported parts of the
extension, such as upgrading context constants.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
8be64fb570 main/extensions: Create a context-less set_extensions function
We will add new gl_extensions structures that capture the environment
variable extension overrides and are available early in context
creation.

This will allow a driver to take actions during its initialization
based on the extension overrides.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
f2280eeba5 main/extensions: Don't advertise unknown extensions overrides with (-)
Previously setting:
MESA_EXTENSION_OVERRIDE=-GL_MESA_ham_sandwich

Would cause Mesa to advertise support for the GL_MESA_ham_sandwich
extension, even though the override specifically asked for it to be
disabled.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Marek Olšák
41060a6095 radeonsi: fixup sizes of shader resource and sampler arrays
This was wrong for a very long time. I wonder if the array size has any
effect on anything.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-16 16:55:57 +02:00
José Fonseca
7889469663 scons: Link libGL.so against xcb-dri2.
Fixing undefined xcb_dri2_* symbols.

Trivial.
2014-06-16 11:24:21 +01:00
Michel Dänzer
d6fd8a9771 r600g/radeonsi: Remove default case from PIPE_COMPUTE_CAP_* switch
This way, the compiler warns about unhandled caps.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-16 15:56:29 +09:00
Tapani Pälli
5cb8fdb397 docs: update ARB_explicit_uniform_location status
+ modify release notes for 10.3

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
f3750a2c86 Enable GL_ARB_explicit_uniform_location in the drivers.
v2: enable also for i915 (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
e8fb8b1bb3 glsl: parser changes for GL_ARB_explicit_uniform_location
Patch adds a preprocessor define for the extension and stores explicit
location data for uniforms during AST->HIR conversion. It also sets
layout token to be available when having the extension in place.

v2: change parser check to require GLSL 330 or enabling
    GL_ARB_explicit_attrib_location (Ian)
v3: fix the check and comment in AST->HIR (Petri)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
8381f0f0c3 glsl: add enable bit for ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
73f7c8636d mesa: support inactive uniforms in glUniform* functions
Support inactive uniforms that have explicit location set in
glUniform* functions.

v2: remove unnecessary extension check, use new define (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
dd2a6519b9 glsl/linker: assign explicit uniform locations
Patch refactors the existing uniform processing so explicit locations
are taken in to account during variable processing. These locations
are temporarily stored in gl_uniform_storage before actual locations
are set.

UNMAPPED_UNIFORM_LOC marks unset location so that we can use 0 as a
valid explicit location.

When locations are set, UniformRemapTable is first populated with
uniforms that have explicit location set (inactive and active ones),
rest are put after explicit location slots.

v2: introduce define for locations that have not been set yet (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
eca9d16048 glsl/linker: initialize explicit uniform locations
Patch initializes the UniformRemapTable for explicit locations. This
needs to happen before optimizations to make sure all inactive uniforms
get their explicit locations correctly.

v2: fix initialization bug, introduce define for inactive uniforms (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
dadc3d04f0 glsl: add glsl_type::uniform_locations() helper function
This function calculates the number of unique values from
glGetUniformLocation for the elements of the type.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
bfe42ddd99 mesa: add new enum MAX_UNIFORM_LOCATIONS
Patch adds new implementation dependent value required by the
GL_ARB_explicit_uniform_location extension. Default value for user
assignable locations is calculated as sum of MaxUniformComponents
for each stage.

v2: fix descriptor in get_hash_params.py (Petri)
v3: simpler formula for calculating initial value (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
d1a64aad16 mesa: add enable bit for ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
bd5f1202fb glapi: add GL_ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Kenneth Graunke
5d8e246ac8 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>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
847abaccc0 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>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d053a05ef3 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>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
7f256c1c70 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>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d0575d98fc 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
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d6a7a2606e i965: Add SHADER_OPCODE_SHADER_TIME_ADD to dump_instructions() decode.
"shader_time_add" is a lot more informative than "op152".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-15 16:51:04 -07:00
Vinson Lee
4133c7126c glsl: Fix clang mismatched-tags warnings with glsl_type.
Fix clang mismatched-tags warnings introduced with commit
4f5445a45d.

./glsl_symbol_table.h:37:1: warning: class 'glsl_type' was previously declared as a struct [-Wmismatched-tags]
class glsl_type;
^
./glsl_types.h:86:8: note: previous use is here
struct glsl_type {
       ^
./glsl_symbol_table.h:37:1: note: did you mean struct here?
class glsl_type;
^~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-15 13:34:18 -07:00
Vinson Lee
32c5544860 mesa/drivers: Fix clang constant-logical-operand warnings.
This patch fixes several clang constant-logical-operand warnings such as
the following.

../../../../../src/mesa/tnl_dd/t_dd_tritmp.h:130:32: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
   if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
                               ^  ~~~~~~~~~~~
../../../../../src/mesa/tnl_dd/t_dd_tritmp.h:130:32: note: use '|' for a bitwise operation
   if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
                               ^~
                               |

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-14 23:21:43 -07:00
Chris Forbes
4191cc4861 glsl: Correct more typos
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-15 12:55:16 +12:00
Tom Stellard
ac26a562ed radeon/compute: Always report at least 1 compute unit
Some apps will abort if they detect 0 compute units.  This fixes
crashes in some OpenCV tests.
2014-06-13 21:32:34 -04:00
Jason Ekstrand
ffe609cc69 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>
2014-06-13 13:09:21 -07:00
Rob Clark
06e9536e5f freedreno/a3xx: vtx formats
Add support for more vertex buffer formats.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
ba6a490bbc freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
3394900dd3 freedreno: try for more squarish tile dimensions
Worth about ~0.5fps in xonotic, for example.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
6aeeb706d2 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>
2014-06-13 15:20:34 -04:00
Roland Scheidegger
2ea8e2fccf llvmpipe: increase number of queries which can be binned simultaneously to 64
Gallium (but not OpenGL) does allow nesting of queries, but there's no
limit specified (d3d10 has no limit neither). Nevertheless, for practical
purposes we need some limit in llvmpipe, otherwise we'd need more complex
handling of queries as we need to keep track of all binned queries (this
only affects queries which gather data past setup). A limit of 16 is too
small though, while 64 would suffice.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-13 20:08:39 +02:00
Bruno Jiménez
03aab2af16 radeon/compute: Implement PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS
v2:
    Add RADEON_INFO_ACTIVE_CU_COUNT as a define, as suggested by
    Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-13 10:59:30 -04:00
Neil Roberts
b8d15ca5e8 Remove _mesa_is_type_integer and _mesa_is_enum_format_or_type_integer
The comment for _mesa_is_type_integer is confusing because it says that it
returns whether the type is an “integer (non-normalized)” format. I don't
think it makes sense to say whether a type is normalized or not because it
depends on what format it is used with. For example, GL_RGBA+GL_UNSIGNED_BYTE
is normalized but GL_RGBA_INTEGER+GL_UNSIGNED_BYTE isn't. If the normalized
comment is just a mistake then it still doesn't make much sense because it is
missing the packed-pixel types such as GL_UNSIGNED_INT_5_6_5. If those were
added then it effectively just returns type != GL_FLOAT.

That function was only used in _mesa_is_enum_format_or_type_integer. This
function effectively checks whether the format is non-normalized or the type
is an integer. I can't think of any situation where that check would make
sense.

As far as I can tell neither of these functions have ever been used anywhere
so we should just remove them to avoid confusion.

These functions were added in 9ad8f431b2.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-13 15:54:46 +01:00
Bruno Jiménez
2a0dffa0c9 clover: query driver for the max number of compute units
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-06-12 19:09:32 -04:00
Bruno Jiménez
8f4d37889c gallium: Add PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-06-12 19:08:06 -04:00
Bruno Jiménez
4f70d83089 r600g/compute: solve a bug introduced by 2e01b8b440
That commit made possible that the items could be one just
after the other when their size was a multiple of ITEM_ALIGNMENT.
But compute_memory_prealloc_chunk still looked to leave a gap
between items. Resulting in that we got an infinite loop when
trying to add an item which would left no space between itself and
the next item.

Fixes piglit test: cl-custom-r600-create-release-buffer-bug
And the test for alignment I have just sent:
http://lists.freedesktop.org/archives/piglit/2014-June/011135.html

Sorry about this.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-12 15:52:08 -04:00
Niels Ole Salscheider
607bc89970 egl/gallium: Set defines for supported APIs when using automake
This fixes automake builds which are broken since
b52a530ce2.

v2: This patch also adds the FEATURE_* defines back to targets/egl-static for
Android and Scons that have been removed in the mentioned commit.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79885
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-12 18:07:20 +01:00
Emil Velikov
816d392b58 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>
2014-06-12 18:07:20 +01:00
Courtney Goeltzenleuchter
0406f59eeb mesa: glx: Reduce error log level
The code that parses LIBGL_DRIVERS_PATH was printing an
error for every attempted dlopen. It's not an error to
have to check multiple items in the path, only an error if
no suitable library is found. Reduced the load error to
a warning to match behavior of dynamic linker.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-12 10:19:00 -06:00
Brian Paul
33f273778b cso: fix stream-out clean up in cso_release_all()
Use the has_streamout flag as we do elsewhere to check if we need
to call pipe->set_stream_output_targets().  The driver might implement
the set_stream_output_targets() function, but not for all hardware
configurations.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-12 13:23:56 +01:00
Neil Roberts
765efeef88 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>
2014-06-12 11:24:04 +01:00
Chris Forbes
2c79aa8272 glsl: Fix typo in comment.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-12 21:19:24 +12:00
Kenneth Graunke
3e71258023 i965: Fix disassembly of BLORP clear programs.
Too many levels of indirection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-12 00:56:08 -07:00
Kenneth Graunke
b207caf9bc i965/fs: Move FB write default state mashing in a level.
We only need to alter the default state if we're emitting MOVs for
header related fields.  So, we can simply move the push/pop of state in
to the if (header_present) block, bypassing it in the common case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79903
2014-06-12 00:56:08 -07:00
Kenneth Graunke
a2ad771671 i965: Fix Haswell discard regressions since Gen4-5 line AA fix.
In commit dc2d3a7f5c, Iago accidentally
moved fire_fb_write() above the brw_pop_insn_state(), which caused the
SEND to lose its predication and change from WE_normal to WE_all.
Haswell uses predicated SENDs for discards, so this broke Piglit's
tests for discards.

We want the Gen4-5 MOV to be uncompressed, unpredicated, and unmasked,
but the actual FB write itself should respect those.  So, pop state
first, and force it again around the single MOV.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79903
2014-06-12 00:56:08 -07:00
Michel Dänzer
be5e5b6c93 gbm: Remove 64x64 restriction from GBM_BO_USE_CURSOR
GBM_BO_USE_CURSOR_64X64 is kept so that existing users of GBM continue to
build, but it no longer rejects widths or heights other than 64.

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

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-12 16:13:39 +09:00
Matt Turner
2c8520c03d i965: Use brw->gen in some generation checks.
Will simplify the automated conversion if we want to allow compiling the
driver for a single generation.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-11 20:57:10 -07:00
Matt Turner
f51a7e00da i965/fs: Clean up tabs in brw_fs_cse.cpp.
I'm adding vec4 CSE, and I want to diff the files.
2014-06-11 20:09:22 -07:00
Matt Turner
4bb9d16fd3 configure.ac: Simplify DUSE_EXTERNAL_DXTN_LIB logic.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Matt Turner
026d1fe986 configure.ac: Alphabetize AC_CONFIG_FILES.
This isn't supposed to be difficult.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Matt Turner
180e60df65 configure.ac: Remove single quotes to fix syntax highlighting.
Please stop adding them.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Robert Bragg
c6f118484c 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>
2014-06-11 21:38:01 +01:00
Ian Romanick
63117ac329 i965/vec4: Emit smarter code for b2f of a comparison
Previously we would emit the comparison, emit an AND to mask off extra
bits from the comparison result, then convert the result to float.  Now,
do the comparison, then use a cleverly constructed SEL to pick either
0.0f or 1.0f.

No piglit regressions on Ivybridge.

total instructions in shared programs: 1642311 -> 1639449 (-0.17%)
instructions in affected programs:     136533 -> 133671 (-2.10%)
GAINED:                                0
LOST:                                  0

Programs that are affected appear to save between 1 and 5 instuctions
(just by skimming the output from shader-db report.py.

v2: s/b2i/b2f/ in commit subject (noticed by Chris Forbes).  Remove
extraneous fix_3src_operand (suggested by Matt).  The latter change
required swapping the order of the operands and using predicate_inverse.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-11 12:00:24 -07:00
Ian Romanick
be0452b049 i965/vec4: Silence a couple unused parameter warnings
brw_vec4_visitor.cpp:2717:1: warning: unused parameter 'ir' [-Wunused-parameter]
brw_vec4_visitor.cpp:2723:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-11 12:00:20 -07:00
Ian Romanick
014d45f137 glsl: Store gl_uniform_driver_storage::format as the actual type
And delete the incorrect comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-11 11:26:05 -07:00
Dave Airlie
0d89448662 softpipe: fix pt->resource assert placement
oops meant to move this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 14:03:11 +10:00
Dave Airlie
9bc12ef241 softpipe: enable AMD_vertex_shader_layer.
This passes tests now on softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:21 +10:00
Dave Airlie
8dede2fa6c softpipe: enable GLSL 3.30 support.
This enables GL3.3 on softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:17 +10:00
Dave Airlie
c82d227edd softpipe: bump the softpipe geometry limits
This just aligns the limits with llvmpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:08 +10:00
Dave Airlie
7ea04f089b tgsi_exec: use defines for max inputs/outputs
This fixes the limits for GL 3.2, and subsequently fixes
some segfaults in some varying packing tests and max varying tests
after the limits bumped.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:04 +10:00
Dave Airlie
740d5bed77 softpipe: add layered rendering support.
This adds support for GL 3.2 layered rendering to softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:30 +10:00
Dave Airlie
dc8fc39ada softpipe: add layering to the surface tile cache.
This adds the layer info to the tile cache.

This changes clear_flags to be dynamically allocated as
MAX_LAYERS seems like a too big step.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:30 +10:00
Dave Airlie
5a57248541 softpipe: add depth clamping support. (v2)
This passes the piglit depth clamp tests.

this is required for GL 3.2.

v2: move min/max up one level, could go further, thanks
to Roland for suggestion.

v1: Reviewed-by: Brian Paul <brianp@vmware.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:07 +10:00
Dave Airlie
a4670de0a0 tgsi/gs: bound max output vertices in shader
This limits the number of emitted vertices to the shaders max output
vertices, and avoids us writing things into memory that isn't big
enough for it.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:19:37 +10:00
Jon Ashburn
10e8d55799 i965: Add GPU BLIT of texture image to PBO in Intel driver
Add Intel driver hook for glGetTexImage to accelerate the case of reading
texture image into a PBO.  This case gets huge performance gains by using
GPU BLIT directly to PBO rather than GPU BLIT to temporary texture followed
by memcpy.

No regressions on Piglit tests  with Intel driver.
Performance gain (1280 x 800 FBO, Ivybridge):
glGetTexImage + glMapBufferRange  with patch 1.45 msec
glGetTexImage + glMapBufferRange without patch 4.68 msec

v3: (by Kenneth Graunke)
 - Fix compile after Eric's change to drop the tiling argument
   to intel_miptree_create_for_bo.
 - Add GL_TEXTURE_3D to blacklisted texture targets to prevent Piglit
   regressions.
 - Squash in several whitespace and coding style fixes.
2014-06-10 18:36:44 -07:00
Kenneth Graunke
237aac39b1 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
2014-06-10 16:38:27 -07:00
Kenneth Graunke
ecc78eab11 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
2014-06-10 16:38:27 -07:00
Kenneth Graunke
fc19c4aaf1 meta: Label the meta GLSL clear program.
Giving the meta clear program a meaningful name makes it easier to find
in output such as INTEL_DEBUG=fs or INTEL_DEBUG=shader_time.  We already
did so for integer programs, but neglected to label the primary program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 16:38:27 -07:00
Kenneth Graunke
2bcd24c9f0 i965/fs: Combine generate_math[12]_gen6 methods.
These used to call different math emitters (brw_math vs. brw_math2).
Now that they both call gen6_math, they're virtually identical.

When unrolling SIMD16 to multiple SIMD8 operations, we should take care
not to apply sechalf to brw_null_reg for src1.  Otherwise, we'd end up
with BRW_ARF_NULL + 1 as the register number, and I'm not sure if that's
valid.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:27 -07:00
Kenneth Graunke
35e48bd618 i965/fs: Drop the generate_math[12]_gen7 methods.
These functions are basically identical, so we should combine them.
However, they're so trivial, we may as well just fold them into their
only call sites.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
f3ddd71f28 i965/vec4: Combine generate_math[12]_gen6 methods.
These are trivial to combine: we should just avoid checking the second
operand if it's brw_null_reg.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
5260a26e92 i965/vec4: Drop the generate_math2_gen7() method.
It's now a single line of code, so we may as well fold it into the
caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
b003fc265f i965: Rename brw_math to gen4_math.
Usually, I try to use "brw" for functions that apply to all generations,
and "gen4" for dead end/legacy code that is only used on Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
de65ec2fde i965: Split Gen4-5 and Gen6+ MATH instruction emitters.
Our existing functions, brw_math and brw_math2, had unclear roles:

Gen4-5 used brw_math for both unary and binary math functions; it never
used brw_math2.  Since operands are already in message registers, this
is reasonable.

Gen6+ used brw_math for unary math functions, and brw_math2 for binary
math functions, duplicating a lot of code.  The only real difference was
that brw_math used brw_null_reg() for src1.

This patch improves brw_math2's assertions to allow both unary and
binary operations, renames it to gen6_math(), and drops the Gen6+ code
out of brw_math().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
7b9cf79790 i965: Make src_reg::equals() take a constant reference, not a pointer.
This is more typical C++ style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
000f4a33c0 i965: Don't set the "switch" flag on control flow instructions on Gen6+.
Thread switching on control flow instructions is a documented workaround
for Gen4-5 errata.  As far as I can tell, it hasn't been needed since
Sandybridge.  Thread switching is not free, so in theory this may help
performance slightly.

Flow control instructions with the "switch" flag cannot be compacted, so
removing it will make these instructions compactable.  (Of course, we
still have to implement compaction for flow control instructions...)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
3a439534de i965/fs: Allow CSE on math opcodes on Gen6+.
total instructions in shared programs: 2081469 -> 2081248 (-0.01%)
instructions in affected programs:     22606 -> 22385 (-0.98%)
No programs were hurt by this 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-06-10 16:38:25 -07:00
Thomas Helland
2c9a1518a1 glsl: Remove unused include in expr.flatt.
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:52 -07:00
Thomas Helland
10e00611c2 glsl: Remove unused include in ir.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
8e1e68119c glsl: Remove unused include from ir_constant_expression.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
068d30655c glsl: Remove unused include from ir_basic_block.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
b6e68fc9fb glsl: Remove unused include from hir_field_selection.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
4f5445a45d glsl: Remove unused include from glsl_symbol_table.h
Only function-defs use glsl_type so forward declare instead.
Compile-tested on my Ivy-bridge system.

IWYU also suggests removing #include <new>, and this compiles fine.
I'm not familiar enough with memory management in C/C++ that I feel
comfortable removing this. Insights would be appreciated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
38ffbf459b glsl: Remove unused include from glsl_types.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.
Added comment about core.h being used for MAX2.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
22f5a0b277 glsl: Remove unused include from builtin_variables.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
6f385d9371 glsl: Remove unused include in ast_to_hir.cpp
Found with IWYU. Comment says it's for struct gl_extensions.
Grepping for gl_extensions shows no uses.
Tested by compiling on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
5b83d5e2f9 glsl: Remove unused includes in link_uniform_block_active_visitor.h
Found with IWYU, compile-tested on my Ivy-bridge system.
This is not used in the header, and is included in the source.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
eac09a4e1d glsl: Remove unused includes in link_uniform_init.
Found with IWYU, confirmed with grepping for "hash" and "symbol".
No negative effects on compilation.

IWYU also reported core.h and linker.h could be removed,
but I'm unsure if those are false positives.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Matt Turner
4787c25a60 i965: Replace open-coded linked list with exec_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
1951418038 glsl: Add an exec_node_init() function, usable from C.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
b123c6e96d glsl: Make foreach macros usable from C by adding struct keyword.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
d4ce0109de glsl: Make exec_list members just wrap the C API.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
b10ad648a1 glsl: Make exec_node members just wrap the C API.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
d691f0de72 glsl: Add C API for exec_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
47a77ba839 glsl: Add C API for exec_node.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
5f90f2ee59 glsl: Move definition of exec_list member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
cb5a0e59cf glsl: Move definition of exec_node member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Bruno Jiménez
112c1b14ed r600g/compute: Use %u as the unsigned format
This fixes an issue when running cl-program-bitcoin-phatk
piglit test where some of the inputs have negative values

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
2e01b8b440 r600g/compute: align items correctly
Now, items whose size is a multiple of 1024 dw won't leave
1024 dw between itself and the following item

The rest of the cases is left as it was

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
df1dd8bf22 r600g/compute: Cleanup of compute_memory_pool.h
Removed compute_memory_defrag declaration because it seems
to be unimplemented.

I think that this function would have been the one that solves
the problem with fragmentation that compute_memory_finalize_pending has.

Also removed comments that are already at compute_memory_pool.c

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
1d6384318e r600g/compute: Tidy a bit compute_memory_finalize_pending
Explanation of the changes, as requested by Tom Stellard:

Let's take need after is calculated as
item->size_in_dw+2048 - (pool->size_in_dw - allocated)

BEFORE:
If need is positive or 0:
    we calculate need += 1024 - (need % 1024), which is like
        cealing to the nearest multiple of 1024, for example
        0 goes to 1024, 512 goes to 1024 as well, 1025 goes
        to 2048 and so on. So now need is always possitive,
        we do compute_memory_grow_pool, check its output
        and continue.

If need is negative:
    we calculate need += 1024 - (need % 1024), in this case
        we will have negative numbers, and if need is
        [-1024:-1] 0, so now we take the else, recalculate
        need as need = pool->size_in_dw / 10 and
        need += 1024 - (need % 1024), we do
        compute_memory_grow_pool, check its output and continue.

AFTER:
If need is positive or 0:
    we jump the if, calculate need += 1024 - (need % 1024)
        compute_memory_grow_pool, check its output and continue.

If need is negative:
    we enter the if, and need is now pool->size_in_dw / 10.
        Now we calculate need += 1024 - (need % 1024)
        compute_memory_grow_pool, check its output and continue.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
39bd08efdd r600g/compute: Add more NULL checks
In this case, NULL checks are added to compute_memory_grow_pool,
so it returns -1 when it fails. This makes necesary
to handle such cases in compute_memory_finalize_pending
when it is needed to grow the pool

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
833b550773 r600g/compute: Adding checks for NULL after CALLOC
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
fd943fa6c2 r600g/compute: Fixing a typo and some indentation
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:56 -04:00
Cody Northrop
3eef571cbc mesa: Fix substitution of large shaders
Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-10 10:45:31 -06:00
Michel Dänzer
2d399bb183 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>
2014-06-10 10:56:58 -04:00
David Heidelberger
b0fd54900c r600g,radeonsi: implement PIPE_QUERY_TIMESTAMP_DISJOINT
v2 Marek: set the query result correctly

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-10 13:20:13 +02:00
Jon TURNEY
bd526ec9e1 configure: Always default to --enable-driglx-direct
Always default to --enable-driglx-direct, now that will build driswrast, but
won't try to use dri[123] on platforms which don't have that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 10:32:56 +01:00
Jon TURNEY
f647a722da glx: Fix build in GLX_DIRECT_RENDERING !GLX_USE_APPLEGL !GLX_USE_DRM case
Some untangling to fix building in the dri_platform=none, --enable-driglx-direct
case, where only driswast can be used.

Turn the test for including the glXGetScreenDriver()/glXGetScreenDriver()
interface used by xdriinfo from !GLX_USE_APPLEGL into a positive form, as it is
only useful when dri_platform=drm

Add additional GLX_USE_DRM tests so DRI[123] renderers are only used when
dri_platform=drm

Note that swrast and indirect must still be disabled in the APPLEGL case at the
moment, which makes things more complex than they need to be.  More untangling
is needed to allow that

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-10 10:32:22 +01:00
Kristian Høgsberg
7a45274477 i965: Make gen7_pi field of brw_instruction use unsigned instead of GLuint
Nothing else uses GL-types here.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-09 21:17:19 -07:00
Kristian Høgsberg
cefa265761 i965: Don't include mtypes.h in brw_disasm.c
It's not used.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-09 21:17:19 -07:00
Matt Turner
8e115b03cf i965/fs: initialize src as reg_undef for texture opcodes on Gen4.
Untested.
2014-06-09 21:08:05 -07:00
Tapani Pälli
198204c9c5 i965/fs: initialize src as reg_undef for texture opcodes on Gen5/6.
Commit 07af0ab changed fs_inst to have 0 sources for texture opcodes
in emit_texture_gen5 (Ironlake, Sandybrige) while fs_generator still
uses a single source from brw_reg struct. Patch sets src as reg_undef
which matches the behavior before the constructor got changed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79534
2014-06-09 21:08:05 -07:00
Emil Velikov
5cb1cad0ae egl/dri2: do not leak dri2_dpy->driver_name
Originally all hardware drivers duplicate the driver_name string
from an external source, while for the software rasterizer we set
it to "swrast". Follow the example set by hw drivers this way
we can free the string at dri2_terminate().

v2: Use strdup over strndup. Suggested by Ilia Mirkin.
v3: Handle platform_drm in a similar manner. Cleanup swrast
driver_name in error path.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09 22:56:00 +01:00
Emil Velikov
c153b1f39b egl/dri2/x11: use standard strndup function
Using a custom version of the function brings no benefit.

Cc: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09 22:55:51 +01:00
Adrian Negreanu
357a8b6f33 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>
2014-06-09 22:51:44 +01:00
Adrian Negreanu
6eb3888c86 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>
2014-06-09 22:51:34 +01:00
Adrian Negreanu
6980cae6ae 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>
2014-06-09 22:51:17 +01:00
Adrian Negreanu
4dc5545eff 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>
2014-06-09 22:51:10 +01:00
Adrian Negreanu
0048483f73 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>
2014-06-09 22:51:02 +01:00
Adrian Negreanu
a49ebfab1d 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>
2014-06-09 22:50:53 +01:00
Adrian Negreanu
aba0f152be 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>
2014-06-09 22:50:41 +01:00
Adrian Negreanu
eb3f80dbba 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>
2014-06-09 22:49:54 +01:00
Emil Velikov
c21fca8bf2 scons: remove dri-i915 build target
Unmaintained and broken.

Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2014-06-09 22:46:17 +01:00
Emil Velikov
93257a56b5 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>
2014-06-09 22:45:05 +01:00
Abdiel Janulgue
6f9f916b9b i965/disasm: Properly debug negate source modifier for logical instructions
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-06-09 11:19:50 -07:00
Abdiel Janulgue
c17db7537f 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>
2014-06-09 11:19:48 -07:00
Abdiel Janulgue
609d00e13e 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>
2014-06-09 11:19:45 -07:00
Abdiel Janulgue
a66660d2b7 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>
2014-06-09 11:19:39 -07:00
Brian Paul
1e150ca696 docs: add link to 10.1.5 on news page 2014-06-09 06:13:41 -07:00
Brian Paul
c53550586e docs: fix version number in 10.2.1 release notes 2014-06-09 06:10:35 -07:00
Brian Paul
bedeb5433b docs: import the 10.1.5 release notes 2014-06-09 06:10:18 -07:00
Chris Forbes
5bbb028ef3 glsl: Validate aux storage qualifier combination with other qualifiers.
We've been allowing `centroid` and `sample` in all kinds of weird places
where they're not valid.

Insist that `sample` is combined with `in` or `out`;
and that `centroid` is combined with `in`, `out`, or the deprecated
`varying`.

V2: Validate this in a more sensible place. This does require an extra
case for uniform blocks members and struct members, though, since they
don't go through the normal path.

V3: Improve error message wording; eliminate redundant error generation
for inputs in VS or outputs in FS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-10 10:09:31 +12:00
Iago Toral Quiroga
c75f827f12 i965: Ensure that we end instruction streams properly.
Threads must terminate with a SEND message to a particular shared function,
such as a URB write or FB write, so the instruction stream really shouldn't
ever end in an IF/ELSE/ENDIF or similar block structure.

However, if the instruction stream (incorrectly) ends in a block structure
the last block's end pointer will not be set, leading to a crash later on in
fs_live_variables::setup_def_use(). It is better to detect this earlier, so
assert on that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 12:00:04 +02:00
Iago Toral Quiroga
dc2d3a7f5c i965/fs: Add Gen < 6 runtime checks for line antialiasing.
In Gen < 6 the hardware generates a runtime bit that indicates whether AA data
has to be sent as part of the framebuffer write SEND message. This affects the
specific case where we have setup antialiased line rendering and we render
polygons which have one face setup in GL_LINE mode (line antialiasing
will be used) and the other one in GL_FILL mode (no line antialiasing needed).

Currently we are not doing this runtime test and instead we always send AA
data, which produces incorrect rendering of the GL_FILL face of the polygon in
in the aforementioned scenario (verified in ironlake and gm45).

In Gen4 this is, likely, a regression introduced with commit 098acf6c84. In
Gen5 this has never worked properly. Gen > 5 are not affected by this.

The patch fixes the problem by adding the appropriate runtime check and
adjusting the framebuffer write message accordingly in the conflictive
scenario.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 11:48:49 +02:00
Iago Toral Quiroga
6e61892aea i965/fs: Let the gen < 8 generator know about runtime_check_aads_emit
In gen < 6 we need to produce conditional code based on this flag when doing
framebuffer writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 11:47:38 +02:00
Chris Forbes
be1b5724ab docs: Mark off ARB_compressed_texture_pixel_storage
.. and add to release notes for 10.3

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
8a1a4855cf mesa: Add extension enable for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
b57138b57a mesa: Add pixel storage support for GetCompressedTexImage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
be30766f56 mesa: Compute proper strides for compressed texture pixel storage.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
8d29569c25 mesa: Extract computation of compressed pixel store params
This logic is reusable across CompressedTex*Image* and
GetCompressedTexImage; the strides calculated will also be needed
in the PBO validation functions to ensure that the referenced range of
bytes is valid.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:44 +12:00
Chris Forbes
d6e60cb504 mesa: Emit errors for inconsistent compressed pixel store state
V2: Use bool rather than GLboolean for internal function

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:44 +12:00
Chris Forbes
75a5823749 mesa: Add new pixel pack/unpack state for
ARB_compressed_texture_pixel_storage

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:42 +12:00
Chris Forbes
1fca84e7a0 tests: Add new enum strings for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:40 +12:00
Chris Forbes
cef3f9b909 glapi: Add XML infrastructure for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:38 +12:00
Chris Forbes
8f63559c93 mesa: Make CompressedTexSubImage errors more consistent
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:36 +12:00
Chris Forbes
4119b0eaee mesa: Trim down PixelStorei implementation
Move _mesa_error call for INVALID_VALUE to one place.
Remove checks for previous value matching -- this was important when we
were flushing vertices before the update, but that hasn't happened for a
long time now.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:27 +12:00
José Fonseca
eb58aa9cf0 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>
2014-06-08 09:43:14 +01:00
Iago Toral Quiroga
8873120f9f Revert "i965: Move brw_land_fwd_jump() to compilation unit of its use."
This reverts commit f3cb2e6ed7.

brw_land_fwd_jump() is convenient wherever we produce JMPI instructions
and we will use JMPI to implement framebuffer writes that involve line
antialiasing in gen < 6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-07 21:32:35 -07:00
Kenneth Graunke
220e208329 i965: Fix else and brace placement in brw_eu_emit.c.
I'm making a lot of changes to this area, and I figured I may as well
not conflate these trivial changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Kenneth Graunke
1f3735bff0 i965: Drop the remaining default predication whacking.
With my earlier cleaning in place (see git log brw_eu_emit.c), nothing
relies on the instruction emitters for IF/WHILE/JMPI disabling
predication.  Drop it in favor of making callers do the right thing
explicitly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Kenneth Graunke
8a314a784c i965/sf: Use brw_set_default_predicate_control().
This is a bit tidier than poking at p->current directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Ilia Mirkin
bd7dd3ed06 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>
2014-06-07 16:39:19 -04:00
Ian Romanick
40500ebb20 docs: Add MD5 checksum, etc. for 10.2.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 70ce1031e7)
2014-06-06 23:30:58 -07:00
Ian Romanick
3581e5ef89 docs: Add initial 10.2.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 8c4845d29b)
2014-06-06 23:30:17 -07:00
Vinson Lee
82c577acfa configure.ac: Do not use Pthreads with MinGW.
Match the behavior of the SCons MinGW build.

This patch also fixes these build errors.

  CC       glapi_entrypoint.lo
glapi_entrypoint.c: In function 'init_glapi_relocs_once':
glapi_entrypoint.c:341:4: error: unknown type name 'pthread_once_t'
    static pthread_once_t once_control = PTHREAD_ONCE_INIT;
    ^
glapi_entrypoint.c:341:41: error: 'PTHREAD_ONCE_INIT' undeclared (first use in this function)
    static pthread_once_t once_control = PTHREAD_ONCE_INIT;
                                         ^
glapi_entrypoint.c:341:41: note: each undeclared identifier is reported only once for each function it appears in
glapi_entrypoint.c:342:4: error: implicit declaration of function 'pthread_once' [-Werror=implicit-function-declaration]
    pthread_once( & once_control, init_glapi_relocs );
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-06 22:25:13 -07:00
Ilia Mirkin
7a67318794 gk110/ir: fix emitting constbuf file index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-07 00:30:22 -04:00
Ian Romanick
637132645a docs: Add MD5 checksum, etc. for 10.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 28d41e409d)
2014-06-06 21:19:27 -07:00
Ilia Mirkin
4a3a71a183 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>
2014-06-06 23:32:29 -04:00
Ilia Mirkin
9fef8b3d81 gk110/ir: fix slct emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 22:54:21 -04:00
Timothy Arceri
1454f894ff st/mesa: remove extra calculation of sampler count
This code was originally introduced to fix https://bugs.freedesktop.org/show_bug.cgi?id=53617. The comment says you need to pass NULL in order to unref old views however cso_set_sampler_views() already takes care of old views with the second for loop. Also as of 2355a64414 cso_set_sampler_views() passes the max of the old and new views to the driver for all state trackers making this code obsolete.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-07 12:21:19 +10:00
Ilia Mirkin
d588a4919b gk110/ir: fix interp mode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 20:33:06 -04:00
Ilia Mirkin
ed1b9e5721 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>
2014-06-06 19:52:49 -04:00
Ilia Mirkin
6e046508a1 gk110/ir: fix quadon opcode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 19:27:28 -04:00
Ilia Mirkin
ca65fc418f 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>
2014-06-06 18:25:35 -04:00
Ilia Mirkin
b9ec766bd0 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>
2014-06-06 18:25:32 -04:00
Ilia Mirkin
73eec47ef8 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>
2014-06-06 18:25:16 -04:00
José Fonseca
b6956aef74 scons: Search only for mingw-w64 cross-compilers.
Some distros still ship the non-mingw-w64 cross-compilers, but they are
can't build Mesa properly, as Jakob pointed out.
2014-06-06 13:15:37 +01:00
Stéphane Marchesin
1751a9ba26 i915g: Remove 4444 and 5551 formats
They don't seem to work 100%, I need to investigate but in the
meantime let's remove them.
2014-06-05 21:44:35 -07:00
Tobias Klausmann
4f4e9ba166 nvc0/ir: Handle OP_POPCNT when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
[imirkin: make sure to only fold 1-arg popcnt in opnd]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:05:11 -04:00
Tobias Klausmann
fdc1d96b0f nvc0/ir: Handle OP_BFIND when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:00:26 -04:00
Tobias Klausmann
4674343e8f nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:00:26 -04:00
Tobias Klausmann
3164bfc734 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>
2014-06-06 00:00:26 -04:00
Kenneth Graunke
221169693b 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>
2014-06-05 01:26:05 -07:00
Kenneth Graunke
7f3d64a77b 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>
2014-06-05 01:25:56 -07:00
Tapani Pälli
cf29913aa1 i965: use _mesa_align_malloc in intel_miptree_map_movntdqa
This fixes case where we have 1x1 size buffer and misalignment is 0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
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=79616
2014-06-05 09:00:17 +03:00
Chris Forbes
3c77d2a113 i965/fs: Allow array dereference of HW_REG.
When dereferencing an element of gl_SampleMaskIn[], the source register
here will be a HW_REG rather than a VGRF because the payload slot is
now exposed directly.

Fixes an assertion failure in the Piglit test:

   tests/spec/arb_gpu_shader5/execution/samplemaskin-basic

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-05 06:53:43 +12:00
Leo Liu
3642ee846a st/omx/enc: enable b frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:42 +02:00
Leo Liu
e074f8200e radeon/vce: implement h264 profile support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:42 +02:00
Leo Liu
f588b80bba st/omx/enc: implement h264 profile support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:41 +02:00
Leo Liu
4722c326ce vl: add more avc profiles
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:41 +02:00
José Fonseca
122e232495 wgl: Disable CRT message boxes when Windows system error messages boxes are disabled.
At least on MSVC we statically link against the CRT, so we must disable
the CRT message boxes if we want unattended testing.

The messages are convenient when running manually, so let them be if the
system error message boxes are not disabled.
2014-06-04 10:25:08 +01:00
Chris Forbes
7e0dd80f11 glapi: Note apparent gap in numbering from ARB_multi_draw_indirect
This is defined in the same included file as ARB_draw_indirect.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 20:25:39 +12:00
Chris Forbes
7bf768b484 docs: Mark off gs5/overload resolution
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 20:12:58 +12:00
Chris Forbes
b18b4c7d74 glsl: Implement overload resolution for ARB_gpu_shader5
V3: Move spec citation into the code.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 20:10:27 +12:00
Chris Forbes
c1ceadfc32 glsl: Add support for comparing function parameter conversions
The ARB_gpu_shader5 spec says:

"To determine whether the conversion for a single argument in one match is
better than that for another match, the following rules are applied, in
order:

  1. An exact match is better than a match involving any implicit
     conversion.

  2. A match involving an implicit conversion from float to double is
     better than a match involving any other implicit conversion.

  3. A match involving an implicit conversion from either int or uint to
     float is better than a match involving an implicit conversion from
     either int or uint to double.

If none of the rules above apply to a particular pair of conversions,
neither conversion is considered better than the other."

V3: Add spec citation, including oddball difference between gs5 and GLSL
4.0; comment a bit better as per Jordan's suggestions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 20:03:08 +12:00
Chris Forbes
59dd444cac glsl: Build a list of inexact function matches
This will facilitate GLSL 4.0 / ARB_gpu_shader5's enhanced overload
resolution rules, and also possibly better error reporting for ambiguous
function calls.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 19:49:34 +12:00
Chris Forbes
4312e973f2 docs: Mark off gs5/implicit conversions
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 19:36:02 +12:00
Chris Forbes
6ae787584d glsl: Allow int -> uint implicit conversions on function parameters
V2: Fix crashes during linking, where the parse state is NULL. In this
case, all required checks have already been done, so we assume the
extension is enabled.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:59 +12:00
Chris Forbes
f17428a276 glsl: Pass parse state to can_implicitly_convert_to()
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:57 +12:00
Chris Forbes
a78c663c22 glsl: Pass parse state to parameter_lists_match()
The available implicit conversions depend on the GLSL version we're
compiling.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:54 +12:00
Chris Forbes
240974e93f glsl: Add support for int -> uint implicit conversions
This is required for ARB_gpu_shader5.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:51 +12:00
Chris Forbes
1ace51f091 glsl: Clean up apply_implicit_conversion
We're about to add new implicit conversions, first for ARB_gpu_shader5,
and then later for ARB_gpu_shader_fp64. Pull out the opcode
determination into its own function, and get rid of the bool -> float
case that could never be hit anyway [since it fails the is_numeric()
check].

V2: Retain the vector width mangling. It turns out this is necessary for
the conversions done (and then thrown away) when determining the return
type of arithmetic operators.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:47 +12:00
Chris Forbes
9578bb21d0 docs: Update precise qualifier status in GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:11 +12:00
Chris Forbes
345034869e glsl: Allow precise as a parameter qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:09 +12:00
Chris Forbes
d0495c6db8 glsl: Disallow precise redeclarations of vars from outer scopes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:08 +12:00
Chris Forbes
5ecffe5a3a glsl: Add support for precise redeclarations
This works like glsl-1.20+'s invariant redeclarations, but with fewer
restrictions, since `precise` is allowed on pretty much anything.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:05 +12:00
Chris Forbes
4b756b20c4 glsl: add support for precise in type_qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:03 +12:00
Chris Forbes
37ab3ddbf8 glsl: remove outdated comment, move sample to correct block
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:55:49 +12:00
Kenneth Graunke
7913b4b97b 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>
2014-06-03 18:19:54 -07:00
Matt Turner
ac25cf55af glsl: Make most ir_instruction::as_subclass() functions non-virtual.
There are several common ways to check whether an object is a particular
subclass: dynamic_cast<>, the as_subclass() pattern, or explicit enum
tags.  We originally used the virtual as_subclass methods, but later
added enum tags as they are much nicer for debugging.

Since we have the enum tags, we don't necessarily need to use virtual
functions to implement the as_subclass() methods.  We can just check the
tag and return the pointer or NULL.

This saves 18 entries in the vtable, and instead of two pointer
dereferences per as_subclass() call most are only three inline
instructions.

Compile time of sam3/112.frag (the longest compile in a recent shader-db
run) is reduced by 5% from 348 to 329 ms (n=500).

perf stat of this workload shows:
   24.14% reduction in iTLB-loads:       285,543 -> 216,606
   42.55% reduction in iTLB-load-misses:  18,785 ->  10,792

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
773544f0e9 glsl: Move ir_type_unset to end of enumeration.
Now that the constructors set a type, ir_type_unset is not very useful.
Move it to the end of the enum (specifically out of position 0) so that
enums checks for dereferences and rvalues can save an instruction.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
943cc7ff17 glsl: Reorder ir_type_* enum for easier comparisons.
Makes checking whether an object is an ir_dereference, an ir_rvalue, or
an ir_jump simpler. Since ir_dereference is a subclass or ir_rvalue,
list its subtypes first so that they can both generate nice code.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
3540b5eb55 glsl: Remove useless call to as_rvalue().
The type returned by hir() is already an ir_rvalue pointer.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Ian Romanick
963bd99f03 glsl: Set ir_instruction::ir_type in the base class constructor
This has the added perk that if you forget to set ir_type in the
constructor of a new subclass (or a new constructor of an existing
subclass) the compiler will tell you... instead of relying on
ir_validate or similar run-time detection.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-03 17:58:34 -07:00
Sinclair Yeh
91ff0d4c65 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>
2014-06-03 17:28:30 -07:00
Marek Olšák
d226191820 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>
2014-06-03 13:33:14 +02:00
Marek Olšák
0423513c61 radeonsi: BlitFramebuffer should follow render condition
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-03 13:33:14 +02:00
Marek Olšák
3a92fc1bdd r600g: BlitFramebuffer should follow render condition 2014-06-03 13:33:14 +02:00
Marek Olšák
d929a30e9a r300g: BlitFramebuffer should follow render condition 2014-06-03 13:33:14 +02:00
Marek Olšák
bf701a84eb 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>
2014-06-03 13:33:14 +02:00
José Fonseca
e3e13d6b85 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>
2014-06-03 12:20:53 +01:00
José Fonseca
53468dee03 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>
2014-06-03 12:20:50 +01:00
Vinson Lee
dad22cc590 i965: Add _default_ name changes to test_eu_compact.c.
These were missed in commit e374809819.

Fixes 'make check'.

  CC       test_eu_compact.o
test_eu_compact.c: In function ‘gen_f0_0_MOV_GRF_GRF’:
test_eu_compact.c:222:4: error: implicit declaration of function ‘brw_set_predicate_control’ [-Werror=implicit-function-declaration]
    brw_set_predicate_control(p, true);
    ^
test_eu_compact.c: In function ‘run_tests’:
test_eu_compact.c:270:6: error: implicit declaration of function ‘brw_set_access_mode’ [-Werror=implicit-function-declaration]
      brw_set_access_mode(p, BRW_ALIGN_16);
      ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-06-02 23:44:21 -07:00
Matt Turner
328e959317 i965/gen8: Print number of instructions directly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:30 -07:00
Matt Turner
757d7ddf01 i965: Emit compaction stats without walking the assembly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Matt Turner
6fdfe3f2dc i965: Move program header printing to end of generate_code().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Matt Turner
92b055625d i965: Move annotation info into generate code.
Suggested by Ken as a way to cut down lines of code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Kenneth Graunke
e374809819 i965: Put '_default_' in the name of functions that set default state.
Eventually we're going to use functions to set bits on an instruction.
Putting 'default' in the name of functions that alter default state will
help distinguins them.

This patch was generated entirely mechanically, by the following:

for file in brw*.{cpp,c,h}; do
   sed -i \
   -e 's/brw_set_mask_control/brw_set_default_mask_control/g' \
   -e 's/brw_set_saturate/brw_set_default_saturate/g' \
   -e 's/brw_set_access_mode/brw_set_default_access_mode/g' \
   -e 's/brw_set_compression_control/brw_set_default_compression_control/g' \
   -e 's/brw_set_predicate_control/brw_set_default_predicate_control/g' \
   -e 's/brw_set_predicate_inverse/brw_set_default_predicate_inverse/g' \
   -e 's/brw_set_flag_reg/brw_set_default_flag_reg/g' \
   -e 's/brw_set_acc_write_control/brw_set_default_acc_write_control/g' \
   $file;
done

No manual changes were done after running that command.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:36 -07:00
Kenneth Graunke
76d7160c6c i965: Delete brw_set_conditionalmod.
This removes the ability to set the default conditional modifier on all
future instructions.  Nothing uses it, and it's not really a sensible
thing to do anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:35 -07:00
Kenneth Graunke
fea7b97742 i965: Eliminate brw_set_conditionalmod from the Gen4-5 compilers.
With the predication changes eliminated, all this does is set the
conditional modifier on a single instruction.  Doing that directly is
easy, and avoids mucking about with default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:33 -07:00
Kenneth Graunke
776ad51165 i965: Don't use brw_set_conditionalmod in the FS and vec4 compilers.
brw_set_conditionalmod and brw_next_insn work together to set the
conditional modifier for the next instruction, then turn it off.
The Gen8+ generators don't implement this: we just set it for all future
instructions, and whack it for each fs_inst/vec4_instruction.

Both approaches work out because we only set conditional_mod on
IR instructions like CMP, AND, and so on, which correspond to exactly
one assembly instruction.  The Gen8 generators would break if we had
an IR instruction that generated multiple instructions, and the Gen4-7
EU emit layer would do...something.

To safeguard against this, assert that we only generated one instruction
if conditional_mod is set, and just set the flag directly on that
instruction rather than altering default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:30 -07:00
Kenneth Graunke
ff340ce3c3 i965: Stop setting predication from brw_set_conditionalmod.
brw_set_conditionalmod has traditionally been complex: it causes
conditionalmod to be set for the next instruction, and then predication
to be set on all future instructions after that.

We may want to generate a flag condition and not use it immediately,
due to instruction scheduling or the like.  Even if not, it's easy
to set things explicitly, and that's clearer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:29 -07:00
Kenneth Graunke
0985da5423 i965: Drop unnecessary brw_set_conditionalmod() before brw_CMP().
brw_CMP already takes a conditional modifier as a parameter, and sets it
accordingly.  brw_set_conditionalmod() also makes everything after the
next instruction predicated, but we don't need that: we always emit an
IF instruction after load_clip_distance(), and that's already
predicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:26 -07:00
Kenneth Graunke
0bfac24caf i965/clip: Use the new brw_last_inst macro instead of temporaries.
It wasn't too bad before, but the macro is going to be nicer once I
start modifying a lot more instructions in this pattern.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:25 -07:00
Kenneth Graunke
42c292006c i965: Create a "brw_last_inst" convenience macro.
Often times, we want to emit an instruction, then set one field on it,
such as predication or a conditional modifier.  Normally, we'd have to
declare "struct brw_instruction *inst;" and then use "inst =
brw_FOO(...)" to emit the instruction, which can hurt readability.

The new "brw_last_inst" macro refers to the most recently emitted
instruction, so you can just do:

    brw_ADD(...)
    brw_last_inst->header.predicate_control = BRW_PREDICATE_NORMAL;

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:23 -07:00
Kenneth Graunke
8deb91b2e7 i965: Make brw_JMPI set predicate_control based on a parameter.
We use both predicated and unconditional JMPI instructions.  But in each
case, it's clear which we want.  It's simpler to just specify it as a
parameter, rather than relying on default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:21 -07:00
Kenneth Graunke
3769a2d51f i965: Remove the dst and src0 parameters from brw_JMPI.
In all cases, we set both dst and src0 to brw_ip_reg().  This is no
accident: according to the ISA reference, both are required to be the IP
register.  So, we may as well drop the parameters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:12 -07:00
Beren Minor
0ca0d5743f 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>
2014-06-02 12:16:50 -07:00
Marek Olšák
f98a7d89be radeonsi: enable ARB_sample_shading 2014-06-02 13:01:27 +02:00
Marek Olšák
d0e8b65aed radeonsi: implement SAMPLEMASK fragment shader output 2014-06-02 12:58:22 +02:00
Marek Olšák
99df120e00 radeonsi: interpolate varyings at sample when full sample shading is enabled 2014-06-02 12:58:22 +02:00
Marek Olšák
99d9d7c0d6 radeonsi: implement SAMPLEPOS fragment shader input
The sample positions are read from a constant buffer.
2014-06-02 12:58:22 +02:00
Marek Olšák
5b06fc376d radeonsi: implement SAMPLEID fragment shader input 2014-06-02 12:58:22 +02:00
Marek Olšák
501fee2511 radeonsi: implement set_min_samples
This is how per-sample shading is enabled.
2014-06-02 12:58:22 +02:00
Marek Olšák
fe98bfb261 radeon: add basic register setup for per-sample shading
Only for Cayman, SI, CIK.
2014-06-02 12:58:22 +02:00
Marek Olšák
3aed75c859 radeon: split cayman_emit_msaa_state into 2 functions
The other function will be split up from the framebuffer state.
2014-06-02 12:58:22 +02:00
Marek Olšák
0d5ec2c615 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>
2014-06-02 12:56:12 +02:00
Christoph Bumiller
b206f5951c r600g: use TGSI_PROPERTY to disable viewport and clipping
v2 get rid of magic value, use DEFINES
v3 update clip_disable together with vs_position_window_space

Big thanks to Marek Olšák!

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
4b586a26c8 gallium: create TGSI_PROPERTY to disable viewport and clipping
Marek v2: add a cap

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
304f64bb50 r600g: remove assert on draw with count == 0
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
476aaf8b8e r600g: HW bug workaround for TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
6544a4a342 r600g: implement TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
822ac96802 r600g: support all channels of TGSI_FILE_ADDRESS
It's allowed in SM3.

v2: fix multi-component tgsi_r600_arl (FLT_TO_INT is trans-only)

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
04eb8b85ea r600g: check for PIPE_BIND_BLENDABLE in is_format_supported
v2: added !util_format_is_depth_or_stencil(format)

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
04de3234ee r600g: handle PIPE_QUERY_GPU_FINISHED
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:02 +02:00
Matt Turner
84e0a5c406 i965/fs: Add fs_inst constructor that takes a list of sources.
Also add an emit() function that calls it.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
521f9b9a48 i965/fs: Add a function to resize fs_inst's sources array.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
07af0abef0 i965/fs: Clean up fs_inst constructors.
In a fashion suggested by Ken.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
b1dcdcde2e i965/fs: Loop from 0 to inst->sources, not 0 to 3.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
27e12a8ea9 i965/fs: Store the number of sources an fs_inst has.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
1b60391ed4 i965/fs: ralloc fs_inst's fs_reg sources.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
a391e99b23 i965/fs: Disable fs_inst assignment operator.
The fs_reg src array is going to turn into a pointer and we'd rather not
consider the implications of shallow copying fs_insts.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
6d3a15223a i965/fs: Add and use an fs_inst copy constructor.
Will get more complicated when fs_reg src becomes a pointer.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
bfcf6a665b i965: Skip IR annotations with INTEL_DEBUG=noann.
Running shader-db with INTEL_DEBUG=noann reduces the runtime
from ~90 to ~80 seconds on my machine. It also reduces the disk space
consumed by the .out files from 660 MB (676 on disk) to 343 MB (358 on
disk).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
55bd8b8b66 i965/fs: Debug the optimization passes by dumping instr to file.
With INTEL_DEBUG=optimizer, write the output of dump_instructions() to a
file each time an optimization pass makes progress. This lets you easily
diff successive files to see what an optimization pass did.

Example filenames written when running glxgears:
   fs8-0000-00-start
   fs8-0000-01-04-opt_copy_propagate
   fs8-0000-01-06-dead_code_eliminate
   fs8-0000-01-12-compute_to_mrf
   fs8-0000-02-06-dead_code_eliminate
        |   |  |   |
        |   |  |   `-- optimization pass name
        |   |  |
        |   |  `-- optimization pass number in the loop
        |   |
        |   `-- optimization loop interation
        |
        `-- shader program number

Note that with INTEL_DEBUG=optimizer, we disable compact_virtual_grfs,
so that we can diff instruction lists across loop interations without
the register numbers being changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
e9bf1662b0 i965: Give dump_instructions() a filename argument.
This will allow debugging code to dump the IR after an optimization pass
makes progress (the next patch). Only let it open and write to a file if
the effective user isn't root.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
56d6dcf4f7 i965: Give dump_instruction() a FILE* argument.
Use function overloading rather than default arguments, since gdb
doesn't know about default arguments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
08c2acd8d9 i965: Add envvar to debug the optimization passes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Roland Scheidegger
3fc72f2ec6 llvmpipe: (trivial) drop "unswizzled" from some function names
This made sense when swizzled storage layout was used for rendering to tiles.
But nowadays the name just adds confusion (and makes for long lines).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
576868140b 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>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
98d8ba2776 softpipe: honor the render_condition_enable bit in blits.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
c90b5884bd llvmpipe: honor the render_condition_enable bit in blits.
This fixes piglit nv_conditional_render-blitframebuffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
f49e201df9 gallium/docs: improve documentation of render condition wrt blits.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Brian Paul
3b66029dd3 svga: use svga_shader_too_large() in compile_vs()
And rework the dummy shader code to match the fragment shader case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:36 -06:00
Brian Paul
3bb18eab72 svga: use svga_shader_too_large() in compile_fs()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Brian Paul
7b2ff54417 svga: added svga_shader_too_large() helper
To check if a shader bytcode exceeds the device limit.  There's no
limit when using GBS.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Jeremy Huddleston Sequoia
b4f34241ec darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context
https://xquartz.macosforge.org/trac/ticket/650

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-31 03:44:51 -07:00
Vinson Lee
83bba8f146 util: Do not use __builtin_clrsb with Intel C++ Compiler.
This patch fixes this build error with icc 14.0.2.

In file included from state_tracker/st_glsl_to_tgsi.cpp(63):
../../src/gallium/auxiliary/util/u_math.h(583): error: identifier "__builtin_clrsb" is undefined
     return 31 - __builtin_clrsb(i);
                 ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-30 19:47:35 -07:00
Lubomir Rintel
90b5747856 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>
2014-05-30 17:10:08 -07:00
Ian Romanick
7b1aeec9cd 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>
2014-05-30 16:33:34 -07:00
Matt Turner
65bccff800 i965/vec4: Allow writemasking on math instructions on Gen7+.
The math instruction was Align1-only on Gen6 and we never updated this
to let it use Align16 features like writemasking on newer platforms.

total instructions in shared programs: 1686120 -> 1685507 (-0.04%)
instructions in affected programs:     48593 -> 47980 (-1.26%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-30 12:20:45 -07:00
Pavel Popov
d292d40207 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>
2014-05-30 12:20:18 -07:00
Brian Paul
ebf229a436 st/wgl: use _debug_printf() instead of fprintf()
This should print output both for debug and release builds.
Suggested by Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
4b05e3cb0f st/wgl: formatting fixes in stw_framebuffer.c
And remove some unneeded #includes and INLINE qualifiers.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
f9595e21bc st/wgl: make stw_lookup_context_locked() an inline function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
bd36cbfa5a st/wgl: fix implementation of wglCreateContextAttribsARB()
wglCreateContextAttribsARB() didn't work previously since it returned
a context ID that wasn't allocated by OPENGL32.DLL.  So if that context
ID was later passed to wglMakeCurrent(), etc. it was rejected.

Now when wglCreateContextAttribsARB() is called we actually call
wglCreateContext() in order to get a valid context ID.  Then we
replace the context data which was created with new context data
which reflects the arguments passed to wglCreateContextAttribsARB().

If there were a DrvCreateContextAttribs() function in the ICD this
work-around wouldn't be necessary.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>

Conflicts:
	src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c
	src/gallium/state_trackers/wgl/stw_getprocaddress.c
2014-05-30 18:52:39 +01:00
Brian Paul
fa55c2402c st/wgl: add debug code to check that pixel format initialization worked
If the assertion fails, it means something is really broken.  Before,
if this happened we reverted to the GDI renderer without any warning.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
e4a5165562 st/wgl: change PFD_SWAP_COPY to PFD_SWAP_EXCHANGE.
To reflect our actual SwapBuffers implementation.  See
stw_st_swap_framebuffer_locked().  This fixes various rendering issues
with SolidEdge.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-30 18:52:39 +01:00
José Fonseca
76bf4bd3c5 docs: Document how to replace Windows built-in OpenGL software rasterizer with llvmpipe.
Just happened to stumble across this registry key while debugging
something else.

This technique is much neater than trying to override opengl32.dll.

Also a few minors cleanups.
2014-05-30 18:52:39 +01:00
Tapani Pälli
56bdffe8c1 scons: add common.c as part of glcpp build
to have _mesa_error_no_memory function available

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79440
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 10:11:44 +03:00
Juha-Pekka Heikkila
fb7baafbbf mesa: Add missing null checks into prog_hash_table.c
Check calloc return values in hash_table_insert() and
hash_table_replace()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 09:22:34 +03:00
Tapani Pälli
c692581ae8 glcpp: link with tests/common.c
So that prog_hash_table can use _mesa_error_no_memory function.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 09:22:24 +03:00
Juha-Pekka Heikkila
7bfe94694c mesa/main: Add missing null check in _mesa_CreatePerfQueryINTEL()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-05-30 07:22:01 +03:00
Juha-Pekka Heikkila
5c9056d37f mesa/drivers: Add extra null check in blitframebuffer_texture()
If texObj == NULL here it mean there is already GL_INVALID_VALUE
or GL_OUT_OF_MEMORY error set to context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:39 +03:00
Juha-Pekka Heikkila
19f1d137f8 glsl: Add null check in loop_analysis.cpp
Check return value from hash_table_find before using it as a pointer

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:12 +03:00
Juha-Pekka Heikkila
77a00c71bb mesa: add missing null check in _mesa_NewHashTable()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:20:53 +03:00
Gary Wong
85b6f36ca5 loader: add optional /sys filesystem method for PCI identification.
Introduce a simple PCI identification method of looking up the answer
the /sys filesystem (available on Linux).  Attempted after libudev, but
before DRM.

Disabled by default (available only when the --enable-sysfs configure
option is specified).

Signed-off-by: Gary Wong <gtw@gnu.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Gary Wong
090c772b8a loader: allow attempting more than one method of PCI identification.
loader_get_pci_id_for_fd() and loader_get_device_name_for_fd() now attempt
all available strategies to identify the hardware, instead of conditionally
compiling in a single test.  The existing libudev and DRM approaches have
been retained, attempting first libudev (if available) and then DRM (if
necessary).

Signed-off-by: Gary Wong <gtw@gnu.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Emil Velikov
febec73147 st/egl: do not link against libloader
Move the link to the final targets, like any other place in
mesa/gallium. This allows better visibilty and will prevent
us from including the library archive twice.

Resolves multiple definition of `loader_get_pci_id_for_fd'

multiple definition of `loader_get_pci_id_for_fd'

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79263
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79382
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-29 20:01:33 +01:00
Emil Velikov
6638c55838 egl_dri2: fix wayland_platform when drm_platform is not set
The build fails with implicit delaration of drmGetCap (xf86drm.h)
Were we're including the header only when building the DRM_PLATFORM.

Wayland backend can operate without DRM_PLATFORM so replace the
guard, and fold in drmGetCap() usage to silence compiler warnings.

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>
2014-05-29 20:01:03 +01:00
Matt Turner
dfd117b857 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>
2014-05-29 10:42:25 -07:00
Jerome Glisse
e3cc0d90e1 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>
2014-05-29 13:32:21 -04:00
Stéphane Marchesin
c0bd206a14 i915g: Support B5G5R5A1 render targets and textures 2014-05-28 19:53:58 -07:00
Stéphane Marchesin
569c026520 i915g: Support R4G4B4A4 render targets and textures 2014-05-28 19:53:55 -07:00
Stéphane Marchesin
9e59c91a73 i915g: Fix copy region code
This fixes a few issues with it, also cleans up the code.
2014-05-28 19:53:51 -07:00
Connor Abbott
fc7e7cfabc glsl/tests: remove generated tests from the repo
They were made unneccesary by the last commit.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:07:07 -07:00
Connor Abbott
a1d8322fbb glsl/tests: call create_test_cases.py in optimization-test
This way, when someone modifies create_test_cases.py and forgets to
commit their changes again, people will notice.

v2: make sure we parse the right directories and check for existance the
right way.

v3 (Ken): Use $PYTHON2 instead of calling python directly.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:45 -07:00
Connor Abbott
6e24111b9c glsl/tests/lower_jumps: fix generated sexpr's for loops
In 088494aa (as well as other commits in the series) Paul Berry modified
the tests for lower_jumps to account for the fact that the s-expression
for the loop IR instruction changed from
(loop () () () () (statements...)) to (loop (statements...)), but he
forgot to update create_test_cases.py which he used to create the tests.
Fix that, so that now create_test_cases.py is synced with the generated
tests.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:16 -07:00
Connor Abbott
bbaec0f76c glsl: be more consistent about printing constants
Make sure that we print the same number of digits when printing 0.0 as
any other floating-point number. This will make generating expected
output files for tests easier. To avoid breaking "make check," update
the generated tests for lower_jumps before the next commit which will
bring create_test_cases.py in line with them.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:05:59 -07:00
Brian Paul
a7aca3919b glsl: replace strncmp("gl_") calls with new is_gl_identifier() helper
Makes things a little easier to read.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-28 15:06:07 -06:00
Brian Paul
f9cecca7a6 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>
2014-05-28 15:06:07 -06:00
Kenneth Graunke
bb9623a1a8 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
2014-05-28 13:12:10 -07:00
José Fonseca
9ec7cb8aa0 egl-static: Fix undefined reference to `loader_*'
Trivial.  Better than a broken build.
2014-05-28 10:33:33 +01:00
Topi Pohjolainen
a6022e5405 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>
2014-05-28 10:32:29 +03:00
Alexandre Courbot
ecee4c4229 nvc0/ir: use SM35 ISA with GK20A
GK20A is mostly compatible with GK104, but uses the SM35 ISA. Use
the GK110 path when this chip is detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Alexandre Courbot
1973d79e27 nvc0: add GK20A 3D class
GK20A is mostly compatible with GK104, but features a new 3D
class. Add it to the relevant header and use it when GK20A is
detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Kenneth Graunke
4b846e231e i965/sf: Replace push/pop in brw_emit_anyprim_setup.
Each of the subroutine emitters alter the predication state, but
otherwise don't change anything (or put it back when they do).
Resetting predication at the end makes these functions idempotent with
regard to the default instruction state - which is a nice property.

With that in place, push/pop is no longer necessary.

v2: Improve whitespace (requested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
471bff4c62 i965/sf: Drop unnecessary push/pop in copy_z_inv_w.
brw_MOV doesn't alter the default instruction state, so this does
nothing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
0f9eeae878 i965/sf: Drop unnecessary push/pop in flatshading code.
brw_JMPI sets predicate_control to BRW_PREDICATE_NONE, but that's
already the value coming in.  Otherwise, nothing changes state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
d9cac44a14 i965/sf: Move brw_compile::flag_value to brw_sf_compile.
This field is only used to track the current value of the flag register
during the SF compile.  It has no place in the common compiler code.

While we're changing every call, drop the 'brw' prefix from the function
since it's static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
e287f5937f i965/sf: Move brw_set_predicate_control_flag_value to brw_sf_emit.c.
Only the Gen4-5 SF program compiler actually uses this function; move
it there.  Soon the fields will be moved out of brw_compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
41afb3ade4 i965/sf: Drop useless push/pop state from flag register mashing code.
There's no point in pushing and popping the default state; the code
between the two stack operations doesn't alter anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
2747f6a1f9 i965/sf: Drop unnecessary push/pop in do_twoside_color.
None of the assembly emitters called between push and pop actually
change the state.  So, we can drop these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
09655bb81b i965: Don't implicitly set predicate default state in brw_CMP.
Previously, brw_CMP with a null destination implicitly set the default
state to make future instructions predicated.  This is messy and
confusing - emitting a CMP that populates the flag register and later
using it to predicate instructions are logically separate.  With the
main compiler, we may even schedule instructions between the CMP and the
user of the flag value.

This patch simplifies brw_CMP to just emit a CMP instruction, and not
mess with predication.  It also updates all necessary callers.  These
mostly fell into two patterns:

1. brw_CMP followed by brw_IF.

   We don't need to do anything special here; brw_IF already sets up
   predication appropriately.

2. brw_CMP followed by a single predicated instruction.

   The old model was to call brw_CMP, emit the next (predicated)
   instruction, then disable predication for any instructions beyond
   that.  Instead, just explicitly set predicate_control on the single
   instruction we want to predicate.  It's no more code, and requires
   less cross-module knowledge.

This drops setting flag_value to 0xff as well, which is a field only
used by the SF compile.  There is only one brw_CMP call in the SF code,
which is in do_twoside_caller, and called at the start of
brw_emit_tri_setup, where flag_value is already 0xff.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
b07c4b1d9d i965: Drop unnecessary predication default state resets in clip code.
Presumably, this was to reset the default state of predication_control
from brw_CMP.  But brw_CMP only sets that if dst is ARF null, which it
isn't here.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
a5bb24d769 i965/sf: Reset flag_value to 0xff before emitting SF subroutines.
When compiling any of the SF program variants, flag_value starts off as
0xff and will be modified when generating code.

brw_emit_anyprim_setup emits several subroutines, saving and restoring
flag_value across each of them.  Since it starts out as 0xff, this is
equivalent to simply setting it to 0xff at the start of each subroutine.

Resetting the value makes more logical sense; each subroutine doesn't
know whether one of the others even executed, much less what it did
to the flag register.

This also lets us to drop the brw_set_predicate_control_flag_value call
from brw_init_compile: predicate is already initialized to
BRW_PREDICATE_NONE by the memset, and the value of flag_value is
irrelevant (as it's only used by the SF compiler).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:00 -07:00
Leo Liu
b3ad853a2c st/omx/enc: implement restricted b frames pattern
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:55 +02:00
Leo Liu
cc6c76e8f6 radeon/vce: implement non-referenced frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:52 +02:00
Leo Liu
8e0eae4c3d vl: add interface for non-referenced frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:32 +02:00
Topi Pohjolainen
57730d67f6 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>
2014-05-27 09:31:27 +03:00
Topi Pohjolainen
c246828c4d 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>
2014-05-27 09:31:07 +03:00
Stéphane Marchesin
328e7e7742 i915g: Fix shader disasm code
This broke when I separated declarations/shader.
2014-05-26 23:08:49 -07:00
Stéphane Marchesin
82a76e61e7 i915g: Fallback to sw for npot copies
i915g's npot support is incomplete, so let's not use it for copies.
This fixes a bunch of piglit tests.
2014-05-26 23:08:49 -07:00
Stéphane Marchesin
b419ca937a i915g: handle more formats in copy
We can handle depth, luminance,... copies by simply replacing the
format with a known format of the same bpp.
2014-05-26 23:08:49 -07:00
Tobias Klausmann
a26e2bc2e3 nvc0: implement clear_buffer
Provide an accelerated path for ARB_clear_buffer_object

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-26 21:17:14 -04:00
Matt Turner
4c7bf8a704 i965: Switch types D->UD when possible to allow compaction.
Number of compacted instructions: 827404 -> 833045 (0.68%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-26 13:58:58 -07:00
Matt Turner
0d3f83f4ad 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
2014-05-26 11:47:15 -07:00
Matt Turner
a39428cf5c 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
2014-05-26 11:47:13 -07:00
Matt Turner
fc025a6719 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>
2014-05-26 11:47:04 -07:00
Matt Turner
ccb1ea8a15 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
2014-05-26 11:46:52 -07:00
Ilia Mirkin
0d699530ff 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>
2014-05-26 14:53:26 -04:00
Ilia Mirkin
ab7bd7093d 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>
2014-05-26 14:00:11 -04:00
Rob Clark
aa78c4586d freedreno/a3xx: texture fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 09:03:09 -04:00
Rob Clark
2456be63e9 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 08:58:17 -04:00
Rob Clark
286863939f freedreno: few caps fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 08:56:27 -04:00
Vinson Lee
f0748b5014 mesa/x86: Fix build with clang <= 3.3.
clang <= 3.3 cpuid.h does not define contants for feature bits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79095
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-25 21:39:30 -07:00
Matt Turner
6148e94e26 i965: Don't treat HW_REGs as barriers if they're immediates.
We had a handful of cases where we'd used brw_imm_*() to generate an
immediate, rather than fs_reg(). We shouldn't do that but we shouldn't
limit scheduling flexibility on account of immediate arguments either.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-25 20:16:46 -07:00
Matt Turner
c938be8ad2 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>
2014-05-25 20:16:41 -07:00
Emil Velikov
7a63bd960c automake: correctly append the version-script
Turns out that the AC conditional did not include the
the version-scripts as expected. Rather it truncated
the remaining linker flags.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-05-25 23:21:47 +01:00
Emil Velikov
239df5b654 targets/libgl-xlib: hide all the exported symbol mayhem
Leave only the gl/glx and mangled gl symbols.
XMesa* was never an official interface and the only
user of it was mesa-demos, while they were still in
the same repo as mesa.

v2: Conditionally use the version-script.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:47 +01:00
Emil Velikov
7e613f4683 targets/osmesa: include mangled gl symbols
Missed out with commit d4c3968c25

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
a75baba2f1 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>
2014-05-25 23:21:46 +01:00
Emil Velikov
ce12bbd107 dri_util: keep __dri2ConfigOptions symbol private
The symbol was added with commit 45e2b51c853(DRI2/GLX: check for
vblank_mode in DRI2 GLX code) but was never used as such according
to git log.

Possibly it was marked as public due to confusion with
__driConfigOptions which was used for dri1 drivers.

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Kai Wasserbäch
97aa256b19 targets/opencl: Fix (static) linking with LLVM (v2)
Without this, I get linking failures (static linking).

The static linking is sort of required for me, because otherwise Steam and
applications using the Steam runtime regularily fail because my LLVM was
compiled and linked against a newer libgcc_s, libstdc++, etc. and uses
features from those newer versions. And instead of Steam just not
starting, my X starts crashing, whenever libGL fails to load a (32 bit)
driver.

Since I hate crashes of X and I don't think Valve/Steam will behave like
a proper distribution soon (rebuilds versus current Debian Testing, since
they base their Steam OS off that), I need a radeonsi which carries its
own LLVM within and doesn't care about what the runtime sets. This means
linking Mesa statically.

v1 → v2: Move logic to configure.ac

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2014-05-25 23:21:46 +01:00
Emil Velikov
eb2241f8a9 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>
2014-05-25 23:21:46 +01:00
Emil Velikov
b52a530ce2 gallium/egl: st_profiles are build time decision, treat them as such
The profiles are present depending on the defines at build time.
Drop the extra functions and feed the defines directly into the
state-tracker at build time.

v2: Drop unused variable i.

Acked-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
a9afdcc3a1 dri_util: set implemented version of the DRI_CORE extension
... rather than the one defined in our internal interface (dri_interface.h)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-05-25 23:21:45 +01:00
Matt Turner
c9fd68408b i965/fs: Don't modify ann_count if not debugging.
If we make ann_count non-zero, annotation_finalize() won't bail.

Not modifying it seems to make the code more clear than would modifying
annotation_finalize().
2014-05-25 10:32:35 -07:00
Matt Turner
c2c639ecf6 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>
2014-05-24 23:03:24 -07:00
Matt Turner
db42dd8952 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>
2014-05-24 23:03:24 -07:00
Matt Turner
492af22fb4 i965: Remove useless typo'd debugging messages.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
f3cb2e6ed7 i965: Move brw_land_fwd_jump() to compilation unit of its use.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
424303db7f i965/fs: Use next_insn_offset rather than nr_insn.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
99af02fb17 i965: Emit 0.0:F sources with type VF instead.
Number of compacted instructions: 817752 -> 827404 (1.18%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
fb977c90d1 i965: Emit ARF:UD for non-present src1 on Gen6+.
Enables the next commits to compact more instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
1acb3a290e i965: Support compacted instructions with immediate sources.
Note the weirdness with src1 subregs. The compacted immediate fields are
uncompacted to bits [127:96] and the high five bits of the subreg
mapping maps to bits [100:96].

Number of compacted instructions: 790085 -> 817752 (3.50%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
8942f44c8d i965: Use next_offset() in instruction compaction code.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
392cbc2f93 i965: Move next_offset() to brw_eu.h for use elsewhere.
Also perform arithmetic on char* rather than void* since the latter is a
GNU C extension not available in C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
e32e69cc27 i965: Rename next_ip() -> next_offset().
That we were comparing its return value with offsets should have been a
clue. :)

Make it take a void *store in preparation for making the function useful
elsewhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
f0f7fb181f i965: Print disassembly after compaction.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
b5fd762474 i965/fs: Make patch_discard_jumps_to_fb_writes return bool.
... to tell us whether it emitted any code. Will be used to determine
whether we need to skip an annotation for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-24 23:03:23 -07:00
Matt Turner
a35b9cb625 i965: Add annotation data structure and support code.
Will be used to print disassembly after jump targets are set and
instructions are compacted, while still retaining higher-level IR
annotations and basic block information.

An array of 'struct annotation' will live along side the generated
assembly. The generators will populate the array with their IR
annotations, and basic block pointers if the instructions began or ended
a basic block pointer.

We'll then update the instruction offset when we compact instructions
and then using the annotations print the disassembly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
59f4e80d53 i965/fs+blorp: Remove left over dump_file arguments.
Were used by the blorp unit test programs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-24 23:03:23 -07:00
Matt Turner
cd1c1d302b i965/fs: Don't hardcode DEBUG_WM in generic fs code.
Similar to Paul's commit e9fa3a944 except brw_fs_generator's debug_flag
is for DEBUG_WM and DEBUG_BLORP.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
9976294e86 i965: Pass in start_offset to brw_compact_instructions().
Let's us avoid recompacting the SIMD8 instructions when we compact the
SIMD16 program.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:22 -07:00
Matt Turner
2afdd2f40b i965: Delete unused brw_blorp_blit_test_compile(). 2014-05-24 23:03:22 -07:00
Matt Turner
dd0e1c3aff i965/cfg: Make DO instruction begin a basic block.
The DO instruction doesn't exist on Gen6+. Since before this commit, DO
always ended a basic block, if it also happened to start one (e.g., a
while loop inside an if statement) the block containing only the DO
would actually contain no hardware instructions.

Pre-Gen6's WHILE instructions jumps to the instruction following the DO,
so strictly speaking we won't be modeling that properly, but I claim
there is actually no functional difference.

This will simplify an upcoming change where we want to mark the first
hardware instruction in the loop as beginning a block, and the last
instruction before the loop as ending one.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:22 -07:00
Jeremy Huddleston Sequoia
04ce3be401 darwin: Guard Core Profile usage behind a testing envvar
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-24 20:41:38 -07:00
Jeremy Huddleston Sequoia
9eb1d36c97 darwin: Write errors in choosing the pixel format to the crash log
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-24 20:41:35 -07:00
Joakim Sindholt
404387ecd7 nv50: count wrapped textures towards the tex_obj count
But don't count their size towards the allocated memory, since that
belongs to whoever created it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
caa34a7a64 nvc0: assert that we have vertex elements state
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
2595682689 nvc0: use PRIxPTR for sizeof()
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
7669e362ab nv50,nvc0: allow 15,16,30 bpp display formats
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
b9142c246d nv50,nvc0: handle guard band defines
[imirkin: moved default case out of switch]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
d479713d25 nv50/ir/tgsi: optimize KIL
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
452a4151aa 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>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
3b0867f35b 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>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
2f2d1b3d9b 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>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
49eccef06b 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>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
200382be85 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>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
7d11b761f2 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>
2014-05-23 12:34:38 -04:00
Pavel Popov
8dc4a98c44 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>
2014-05-23 09:25:04 -07:00
Jon TURNEY
002a3a7427 appleglx: Improve error reporting if CGLChoosePixelFormat() didn't find any matching pixel formats.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-23 15:24:09 +01:00
Jon TURNEY
5a459a036e Fix build of appleglx
Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to
use the applegl direct renderer

Convert src/glx/apple/Makefile to automake

Since the applegl libGL is now built by linking libappleglx into libGL, rather
than by linking selected files into a special libGL:

- Remove duplicate code in apple/glxreply.c and apple/apple_glx.c.  This makes
apple/glxreply.c empty, so remove it

- Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we
need to add those guards to indirect_glx.c, indirect_init.c (via it's
generator), render2.c and vertarr.c so they don't generate anything

Fix and update various includes

glapi_gentable.c (which is only used on darwin), should be included in shared
glapi as well, to provide _glapi_create_table_from_handle()

Note that neither swrast nor indirect is supported in the APPLEGL path at the
moment, which makes things more complex than they need to be.  More untangling
is needed to allow that

v2: Correct apple/Makefile.am for srcdir != builddir

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:07 +01:00
Jon TURNEY
45f9aae004 Make DRI dependencies and build depend on the target
- Don't require xcb-dri[23] etc. if we aren't building for a target with DRM, as
we won't be using dri[23]

- Enable a more fine-grained control of what DRI code is built, so that a libGL
using direct swrast can be built on targets which don't have DRM.

The HAVE_DRI automake conditional is retired in favour of a number of other
conditionals:

HAVE_DRI2 enables building of code using the DRI2 interface (and possibly DRI3
with HAVE_DRI3)

HAVE_DRISW enables building of DRI swrast

HAVE_DRICOMMON enables building of target-independent DRI code, and also enables
some makefile cases where a more detailled decision is made at a lower level.

HAVE_APPLEDRI enables building of an Apple-specific direct rendering interface,
still which requires additional fixing up to build properly.

v2:
Place xfont.c and drisw_glx.c into correct categories.
Update 'make check' as well

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:04 +01:00
Jon TURNEY
ff90a8784c Fix build for darwin
Fix build for darwin, when ./configured --disable-driglx-direct

- darwin ld doesn't support -Bsymbolic or --version-script, so check if ld
supports those options before using them
- define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak
symbols isn't supported
- default to -with-dri-drivers=swrast

v2:
Use -Wl,-Bsymbolic, as before, not -Bsymbolic
Test that ld --version-script works, rather than just looking for it in ld --help
Don't use -Wl,--no-undefined on darwin, either

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:01 +01:00
Emil Velikov
e0372239a5 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>
2014-05-23 15:23:59 +01:00
James Legg
846c715abb 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>
2014-05-23 08:06:02 -06:00
Emil Velikov
d4c3968c25 targets/osmesa: limit the amount of exported symbols
src/gallium/targets/osmesa/Makefile.am |  1 +
src/gallium/targets/osmesa/osmesa.sym  | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 src/gallium/targets/osmesa/osmesa.sym
2014-05-23 07:40:24 -06:00
José Fonseca
172ef0c5a5 gallivm: Disable workaround for PR12833 on LLVM 3.2+.
Fixed upstream.
2014-05-23 11:37:47 +01:00
José Fonseca
2c02f34fcc gallivm: Support MCJIT on Windows.
It works fine, though it requires using ELF objects.

With this change there is nothing preventing us to switch exclusively
to MCJIT, everywhere.  It's still off though.
2014-05-23 11:37:47 +01:00
José Fonseca
94dbc16dc4 mesa/x86: Fix build with clang 3.4.
It defines bit_SSE41 instead of bit_SSE4_1.

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

Trivial.
2014-05-23 11:37:47 +01:00
José Fonseca
c98b704128 mesa: Move declaration to top of block.
To fix MSVC build.  Trivial.
2014-05-23 11:37:47 +01:00
Jordan Justen
57876fee38 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>
2014-05-23 00:56:01 -07:00
Kenneth Graunke
746921cbb4 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>
2014-05-23 00:42:06 -07:00
Kenneth Graunke
7d3985ca6c 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>
2014-05-23 00:42:06 -07:00
Tobias Klausmann
f50361cce7 mesa/x86: fix a typos in SSE4.1 detection
Commit a2fb71e23 introduced 32-bit code for SSE4.1. Fix compilation, and
make sure to check ecx for the SSE4.1 bit.

[imirkin: switch sse4.1 to look at ecx]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-22 21:10:08 -04:00
José Fonseca
cfec135de7 mesa: Rely on USE_X86_64_ASM.
This fixes MinGW x64 builds.  We don't use assembly on any of the
Windows builds, to avoid divergence between MSVC and MinGW when testing.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 22:39:46 +01:00
José Fonseca
c59c8f0363 scons: Fix x86_64 build.
x86/common_x86.c is required also for x86_64 builds.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 22:39:42 +01:00
Carl Worth
03a0471832 docs: Import 10.1.4 release notes, add news item. 2014-05-22 11:29:49 -07:00
Matt Turner
a9bc85f3b2 mesa/x86: Brown bag fix for undeclared variable. 2014-05-22 11:02:36 -07:00
Matt Atwood
f935dfc022 i965: Use SSE4.1 runtime detection for intel_miptree_map.
Previous it was a compile-time decision.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 10:17:16 -07:00
Matt Atwood
a2fb71e23b mesa/x86: add SSE4.1 runtime detection.
Add a bit to _mesa_x86_features for SSE 4.1, along with macros to query.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 10:17:16 -07:00
Matt Turner
8b9302f2b4 mesa/x86: Support SSE 4.1 detection on x86-64.
Uses the cpuid.h header provided by gcc and clang. Other platforms are
encouraged to switch.
2014-05-22 10:17:16 -07:00
Matt Turner
1a31657a9b mesa: Add uninitialized_vars macro from the Linux kernel. 2014-05-22 10:17:16 -07:00
Vinson Lee
5dd927bbfc configure.ac: Do not enable -Wl,--no-undefined on Mac OS X.
This patch fixes this build error on Mac OS X.

  CCLD     libglapi.la
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-21 22:13:13 -07:00
Alexander von Gluck IV
d4225f803b haiku: Add missing u_memory.h for FREE()
Acked-by: Brian Paul <brianp@vmware.com>
2014-05-21 20:58:06 -04:00
Vinson Lee
8479edf3d7 configure.ac: Remove -fstack-protector-strong from LLVM flags.
-fstack-protector-strong is not supported by clang.

This patch fixes this build error on Fedora 20 with clang.

  CXX      gallivm/lp_bld_debug.lo
clang: error: unknown argument: '-fstack-protector-strong'

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75010
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-21 16:07:00 -07:00
Rob Clark
a4d229b099 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>
2014-05-21 17:29:13 -04:00
Timothy Arceri
5a40a00089 mesa: check constant before null check
For most drivers this if statement is always going to fail so check the constant value first.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-22 06:52:03 +10:00
Rob Clark
b81de5352d 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>
2014-05-21 16:11:46 -04:00
Eric Anholt
b11d345ab0 i965: Ask the VBO module to actually use VBOs.
Note that this covers the Begin/End rendering path, but not user vertex
arrays (so we can't drop copy_array_to_vbo_array() code).  Improves
performance of isosurf GLVERTEX|TRIANGLES by 16.7506% +/- 4.98934%
(n=20). No difference on openarena (n=10), which was why this was reverted
back in cbde276580.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-21 11:38:55 -07:00
Rob Clark
f3ba761129 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>
2014-05-21 12:06:38 -04:00
Rob Clark
4da8267c36 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 12:06:38 -04:00
Rob Clark
0d54904c04 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>
2014-05-21 12:06:38 -04:00
Rob Clark
cb9ed57072 rbug: add missing pipe->blit() entrypoint
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-21 12:06:38 -04:00
Anuj Phogat
46737cebd3 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>
2014-05-21 08:43:14 -07:00
Anuj Phogat
bee2915210 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>
2014-05-21 08:43:13 -07:00
Ilia Mirkin
cdeb7004e0 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>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
28360fcad7 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>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
d2a3de19c6 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>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
d3a5cf052c 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>
2014-05-21 09:31:16 -04:00
Kenneth Graunke
1472584397 i965/fs: Assume fragment color clamping is off when precompiling.
Modern applications frequencly use both UNORM buffers and FLOAT buffers
with color clamping disabled.  (FLOAT with clamping explicitly enabled
and SNORM buffers appear to be less common.)  We don't need to emit
saturates in the fragment shader in either of the common cases.

Mesa sets ctx->Color._ClampFragmentColor to false if all the color
buffers are UNORM.  Also, for GL_FIXED_ONLY mode (the default in
legacy OpenGL), it will be false if any FLOAT buffers are bound.
Since the common case is false, that should be our default.

Thanks to Roland Scheidegger for pointing out some faulty logic
in v1 of this patch (unnecessary code and incorrect explanations).

v2: Drop superfluous code and reword commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-21 00:29:30 -07:00
Sarah Sharp
c524f3ef91 egl: Add EGL_CHROMIUM_sync_control extension.
Chromium defined a new GL extension (that isn't registered with Khronos).
We need to add an EGL extension for it, so we can migrate ChromeOS on
Intel systems to use EGL instead of GLX.

http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447

The EGL_CHROMIUM_sync_control extension is similar to the GLX extension
OML_sync_control, but only defines one function,
eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML.

http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jamey Sharp <jamey@minilop.net>
Cc: Ian Romanick <idr@freedesktop.org>
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
2014-05-20 15:19:48 -07:00
Sarah Sharp
f6e50994e1 Import eglextchromium.h from Chromium.
In order to support the (currently unregistered) Chromium-specific EGL
extension eglGetSyncValuesCHROMIUM on Intel systems, we need to import
the Chromium header that defines it.  The file was downloaded from

https://chromium.googlesource.com/chromium/chromium/+/trunk/ui/gl/EGL/eglextchromium.h

It is subject to the license found at

https://chromium.googlesource.com/chromium/chromium/+/trunk/LICENSE

I have imported the header file and added the license text to the top.
The only change was to fix the include guard on the Chromium header to
change the last line from a #define to a #endif, which makes the header
actually compile.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Jamey Sharp <jamey@minilop.net>
Cc: Ian Romanick <idr@freedesktop.org>
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
2014-05-20 11:31:32 -07:00
Jeremy Huddleston Sequoia
7a109268ab darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-20 10:53:43 -07:00
Rob Clark
57e68a91f5 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:52:56 -04:00
Jeremy Huddleston Sequoia
ff5456d1ac glapi: Avoid heap corruption in _glapi_table
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-05-20 01:37:58 -07:00
Rob Clark
52381a7ffb freedreno/a3xx: shadow sampler support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 21:17:25 -04:00
Rob Clark
08b9180819 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-19 21:17:25 -04:00
Rob Clark
1686a0edc0 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 21:17:25 -04:00
Kenneth Graunke
2ecc7268ba 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>
2014-05-19 17:18:55 -07:00
Kenneth Graunke
54540ea691 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>
2014-05-19 17:18:55 -07:00
Kenneth Graunke
d89ce333cc 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>
2014-05-19 17:18:54 -07:00
Kenneth Graunke
2fa3796bc1 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>
2014-05-19 17:18:54 -07:00
Brian Paul
75688254d7 docs: update the prerequisites section
SCons is required for Windows.  Add links to flex/bison for Windows.
Reorder items and improve formatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-19 16:15:16 -06:00
Topi Pohjolainen
21dddb22c1 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>
2014-05-19 11:22:31 -07:00
Kenneth Graunke
0b96d362bf 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>
2014-05-19 11:12:30 -07:00
Roland Scheidegger
1e9cbbb1c4 llvmpipe: do IR counting for shader cache management after optimization.
2ea923cf57 had the side effect of IR counting
now being done after IR optimization instead of before. Some quick analysis
shows that there's roughly 1.5 times more IR instructions before optimization
than after, hence the effective shader cache size got quite a bit smaller.
Could counter this with an increase of the instruction limit but it probably
makes more sense to count them after optimizations, so move that code.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-19 17:07:41 +02:00
Vinson Lee
9e74de884a i965: Rename brw_disasm to brw_disassemble_inst.
Fixes build error introduced with commit
4b04152db0.

  CC       test_eu_compact.o
test_eu_compact.c: In function ‘test_compact_instruction’:
test_eu_compact.c:54:3: error: implicit declaration of function ‘brw_disasm’ [-Werror=implicit-function-declaration]
   brw_disasm(stderr, &src, brw->gen, false);
   ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78888
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-19 00:42:18 -07:00
Kenneth Graunke
13edd5f616 i965: Fix a "discards 'const' qualifier" warning.
Trivial.
2014-05-18 23:36:48 -07:00
Kenneth Graunke
09b4f260a7 i965/fs: Finally kill struct brw_wm_compile (better known as 'c').
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
8b994d0f3b i965/fs: Stop copying the program key.
We already have a perfectly good copy of the program key, and nobody is
going to modify it.  The only reason we copied it was because the
brw_wm_compile structure embedded the key rather than pointing to it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
cca6dc9f0f i965/fs: Rip struct brw_wm_compile out of the visitors and generators.
Instead, just pass the key and prog_data as separate parameters.

This moves it up a level - one step further toward getting rid of it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
2d4ac9b5b8 i965/fs: Plumb a mem_ctx all the way through the FS compile.
'c' is going away, but we still need a memory context that lives
for the duration of the compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
25f8fbbf2f i965/fs: Use 'c' as the mem_ctx in fs_visitor.
Previously, the memory context situation was a bit of a mess:

fs_visitor allocated its own memory context, and freed it in the
destructor.  However, some data produced by fs_visitor (such as the list
of instructions) needs to live beyond when fs_visitor is "done", so the
caller can pass it to fs_generator.

Everything worked out because brw_wm_fs_emit's fs_visitor variables
happen to not go out of scope until the end of the function.  But that
meant that moving the declaration of, say, the SIMD16 fs_visitor
instance, could cause everything to explode.

Using a memory context that exists for the duration of the compile is
clearer, and should be equivalent.

Ultimately, we don't want to use 'c', but this matches the behavior of
fs_generator and gen8_fs_generator, so it'll be simple to change later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
81b11bf093 i965/fs: Actually free program data on the error path.
We throw away the data generated during compilation on the success path,
so we really ought to on the failure path as well.  The caller has no
access to it anyway, so it's purely leaked.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
c96fdeb723 i965/fs: Replace c->key with a direct reference in the generators.
'c' is going away.  This is also a bit shorter.

Marking the key pointer as const will also deter people from changing
it in these classes, as that's absolutely not OK.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
65b2df3ec8 i965/fs: Replace c->key with a direct reference in fs_visitor.
'c' is going away.  This is also shorter.

Marking the key pointer as const will also deter people from changing
it in fs_visitor, as it's absolutely not OK to modify it there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
b61d055d66 i965/fs: Replace c->prog_data with a direct reference in the generators.
'c' is going away.  This is also a bit shorter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
8a04e0de8b i965/fs: Replace c->prog_data with a direct reference in fs_visitor.
'c' is going away.  This is also a bit shorter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
55f4e3a06b i965/fs: Move some flags that affect code generation to fs_visitor.
runtime_check_aads_emit isn't actually used currently, but I believe
we should be using it on Gen4-5, so I haven't eliminated it.
See https://bugs.freedesktop.org/show_bug.cgi?id=78679 for details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
8ef78828fa i965/fs: Move payload register info from brw_wm_compile to fs_visitor.
This data is created by fs_visitor and only used when emitting code,
so keeping it in fs_visitor makes sense.  I decided it would be
reasonable to group these all together in a struct, since they're
highly related.

v2: s/nr_payload_regs/payload.num_regs/ in some comments (chrisf).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
c76e6db05f i965/fs: Simplify gl_SampleMaskIn handling.
As far as I can tell, there's no point in allocating an extra register
and generating a MOV---we can just use the copy provided as part of our
thread payload directly.  It's already in the right format.

Of course, there are zero Piglit tests for this.  We don't actually ship
the extension (GL_ARB_gpu_shader5) that exposes this functionality
either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
5cd7cf58e6 i965/fs: Rename c->sample_mask_reg to sample_mask_in_reg.
This is actually for gl_SampleMaskIn, which is quite different than
gl_SampleMask.  Renaming should help avoid confusion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
db9c915abc i965/fs: Move c->last_scratch into fs_visitor.
Nothing outside of fs_visitor uses it, so we may as well keep it
internal.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
7e28bd797d i965/fs: Move total_scratch calculation into fs_visitor::run().
With this one use gone, c->last_scratch is now only used inside
fs_visitor.  The rest of the driver uses prog_data->total_scratch.

We already compute similar prog_data fields in fs_visitor, so this
seems reasonable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
c51163b0cf i965/fs: Move perf_debug about register spilling to a more obvious spot.
The if (!allocated_without_spills) block is an obvious spot for this
performance warning message.

In the Vec4 backend, scratch is also used for indirect access of
temporary arrays.  The FS backend doesn't implement that yet, but
if it did, this message would be inaccurate, since scratch access
wouldn't necessarily mean spilling.  Moving it preemptively fixes that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
db1449b700 i965: Rename brw/gen8_dump_compile to brw/gen8_disassemble.
"Disassemble" is an accurate description of what this function does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
4b04152db0 i965: Rename brw_disasm/gen8_disassemble to brw/gen8_disassemble_inst.
We're going to use "disassemble" for the function that disassembles
the whole program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Kenneth Graunke
4a2f0e305c i965: Fix dump_prog_cache to handle compacted instructions.
dump_prog_cache has interpreted compacted instructions as full size
instructions, decoding garbage and complaining about invalid values.

We can just use brw_dump_compile to handle this correctly in less code.
The output format changes slightly, but it's still perfectly acceptable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Kenneth Graunke
3285bc97ef i965: Use brw_dump_compile for clip, SF, and old GS programs.
Looping over the instructions and calling brw_disasm doesn't handle
compacted instructions.  In most cases, this hasn't been a problem since
we don't compact prior to Sandybridge.

However, Sandybridge's transform feedback GS program should already be
compacted, and so this ought to fix decoding of that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Ilia Mirkin
5b8f1a0f7c 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>
2014-05-18 17:59:16 -04:00
Ilia Mirkin
4ebaabcccb 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>
2014-05-18 17:59:16 -04:00
Rob Clark
acc1651711 freedreno/a3xx: use util_format_compose_swizzles()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 16:05:06 -04:00
Rob Clark
88ba9de917 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-18 15:23:53 -04:00
Rob Clark
6f84f64643 freedreno: fix caps
In particular, we want mesa to emulate primitive restart for us.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 15:22:55 -04:00
Rob Clark
f7debd4a3e freedreno: fix index buffer offset
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 15:22:25 -04:00
Rob Clark
5646319f25 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-16 20:48:40 -04:00
Rob Clark
9227e6c98c freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-16 20:08:09 -04:00
Roland Scheidegger
3bf2d86c09 gallivm: (trivial) fix compilation with llvm 3.1, 3.2
I actually checked the getModuleIdentifier() function exists with 3.1 but
missed that the file moved...
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=78803
2014-05-17 02:03:35 +02:00
Roland Scheidegger
3a1da0abee gallivm: print out how long it takes to optimize shader IR.
Enabled with GALLIVM_DEBUG=perf (which up to now was only used to print
warnings for unoptimized code).

While some unexpectedly long shader compile times for some shaders were fixed
with 8a9f5ecdb1 this should help recognize such
problems in the future. For now though only available in debug builds (which
are not always suitable for such analysis). And since this uses system time,
it might not be all that accurate (even llvmpipe's own rasterization threads
might be running at the same time, or just other tasks).
(llvmpipe also has LP_DEBUG=counters but this only gives an average per shader
and the the total time for all shaders.)
This prints information like this:
optimizing module fs17_variant0 took 1 msec
optimizing module setup_variant_0 took 0 msec
optimizing module draw_llvm_vs_variant0 took 9 msec
optimizing module draw_llvm_vs_variant0 took 12 msec
optimizing module fs17_variant1 took 2 msec

v2: rebase for recent gallivm compilation changes, and print time for whole
modules instead of functions (otherwise it would be very spammy since it would
include all trivial inline sse2 functions), using the shiny new module names,
prying them off LLVM using new helper (not available through C bindings).
Per function timings, while possibly giving more information (if there'd be
a problem only in for instance the partial not the whole function), don't seem
all that useful for now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 22:50:14 +02:00
Roland Scheidegger
26cac02c51 gallivm: give more verbose names to modules
When we had just one module "gallivm" was an appropriate name. But now we have
modules containing all functions for a particular variant, so give it a
corresponding name (this is really just for helping debugging).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 22:50:14 +02:00
Brian Paul
ef6b6658f9 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>
2014-05-16 07:14:57 -06:00
Matt Turner
730bc124c3 i965: Use binary literals counter select.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 23:31:27 -07:00
Michel Dänzer
2bab95973d 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>
2014-05-16 11:12:45 +09:00
Roland Scheidegger
b416645387 gallivm: remove optimization workaround when not having sse 4.1
This workaround doesn't list any llvm version, but it was introduced
2010-06-10 (e277d5c1f6). It is unlikely
this bug is still present in llvm versions we support (3.1+).
There's no specific test listed, but I ran lp_test_arit (which uses
the mentioned functions) on llvm 3.1 and 3.3 with sse41 disabled and
this pass enabled without issues.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 01:09:34 +02:00
Roland Scheidegger
93731fbeec gallivm: remove workaround for reversing optimization pass order.
32bit code generation and llvm >= 2.7 used a different optimization pass
order - this code was initially introduced (2010-07-23) by
815e79e72c, apparently due to buggy code being
generated with then brand new llvm versions (which was llvm 2.7 plus pre 2.8
devel).
It seems very highly likely that whatever this bug was it has been fixed in
newer llvm versions, though there's no easy way to test this - the mentioned
piglit test has been removed years ago, and even if you'd build it I'm
sceptical the glsl compiler would still produce the required code to trigger
it.
I have no idea what a good order of passes is, but just remove the workaround
and use the same order everywhere.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 01:09:34 +02:00
Matt Turner
8a6f7dfc19 i965/gen8: Make disassembly function match brw's signature.
gen8_dump_compile will be called indirectly by code common used by
generations before and after the gen8 instruction format change.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
1ef52d6ab3 i965: Pass brw_context and assembly separately to brw_dump_compile.
brw_dump_compile will be called indirectly by code common used by
generations before and after the gen8 instruction format change.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
74b252d270 i965: Pull brw_compact_instructions() out of brw_get_program().
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
cce3bea2a7 i965/disasm: Align send instruction meta-information with dst.
Has been misaligned since we added instruction offset prefixes.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
e00fe451b8 i965/disasm: Disassemble the compaction control bit.
brw_disasm doesn't disassemble compacted instructions, so we uncompact
before disassembling them which would unset the compaction control bit.
Instead pass it as a separate argument.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
58bcf5996d i965/cfg: Embed exec_node in bblock_link.
In order to remove bblock_link's inheritance of exec_node. Also makes
linked list walk code much nicer.

Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:40 -07:00
Matt Turner
a77023c992 i965/cfg: Make brw_cfg.h closer to C-includable.
Only bblock_link's inheritance left.

Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:40 -07:00
Matt Turner
d4d843e02f i965/cfg: Protect brw_cfg.h from multiple inclusion.
Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:39 -07:00
Matt Turner
9b0108ddc1 glsl: Add C-callable fprint_ir function.
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:39 -07:00
Topi Pohjolainen
d45fadf11a 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>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
475216a4f0 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>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
b18f6b9b86 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>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
d1829badf5 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>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
9d752c098c 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>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
36caae48b2 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>
2014-05-15 21:39:32 +03:00
Topi Pohjolainen
6aefaa4eb2 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>
2014-05-15 21:39:32 +03:00
Jordan Justen
103057b2b7 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>
2014-05-15 10:49:05 -07:00
Matt Turner
255357f79b i965: Delete current_insn() function. 2014-05-15 10:35:55 -07:00
Matt Turner
006232bcde i965: Remove blorp unit tests.
They've served their purpose (in transitioning blorp to using
fs_generator) and now they just necessitate large amounts of manual
labor to regenerate if the disassembler changes.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 10:35:55 -07:00
Emil Velikov
39ae284a69 egl-static: include libradeonwinsys.la only once
With this and the previous patch, we no longer have multiple
definitions in the final egl_gallium.so.

v2: Drop duplicate libloader link.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com> (v1)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> (v1)
2014-05-15 17:32:31 +01:00
Emil Velikov
d812c74582 gallium/radeon: link in libradeon.la at target level
It makes more sense to link the core and common parts of the driver as the
target is build. Additionally this will help us drop duplicating symbols
for targets that static link mulitple pipe-drivers. Only egl-static needs
that currently with more to come.

To simplify things a bit add HAVE_GALLIUM_RADEON_COMMON variable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-15 17:32:30 +01:00
Emil Velikov
6fcc0b0ba5 gallium/radeon: build only a single common library libradeon
Just fold libllvmradeon in libradeon.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-15 17:32:30 +01:00
Rob Clark
670418740f 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-14 21:26:35 -04:00
Rob Clark
c37889b5ac 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-14 21:26:35 -04:00
Rob Clark
5dcf59e142 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-14 21:25:53 -04:00
Rob Clark
e1896948da freedreno/a3xx: add debug flag to expose glsl130
We are starting to add integer support to the compiler, which does not
get exercised with glsl feature level 120 and without advertising
integer support.  But doing so breaks too many things right now.  So
for now use a debug flag to conditionally expose the functionality
while it is in development.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:20:29 -04:00
Ryan Houdek
ac2a8e3c9d 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-14 21:19:43 -04:00
Ryan Houdek
a889049400 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-14 21:19:21 -04:00
Roland Scheidegger
8620730f8a draw: better llvm names for shaders for debugging.
All shaders had the same name.
We could probably use some identifier per shader too, but for now only use
the variant number.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:35 +02:00
Roland Scheidegger
65ad90bd1b llvmpipe: improve setup shader names (for debugging)
The setup shaders were composed of both a fs shader number and a variant
number. But since they aren't tied to a particular fragment shader, the
former was a fixed zero while the latter was also always zero because
it was never assigned. So, similar to what the fs code does, use a ever
increasing number to give it a more catchy name (unlike fragment shaders
though where this number is for each explicitly created shader, we just use
it for the implicitly created variants).
And while here, fix whitespace a bit.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:29 +02:00
Roland Scheidegger
1d28650b55 llvmpipe: kill off llvmpipe_variant_count
Unused except it was increased for both fs and setup shader variants created.
Probably some leftover from ages ago.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:26 +02:00
Roland Scheidegger
3e817e7e56 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>
2014-05-15 02:35:25 +02:00
Ben Skeggs
9c64cb80d2 nvc0: enable support for maxwell boards
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:54 +10:00
Ben Skeggs
d548d47edf nvc0: add maxwell (sm50) compiler backend
The big missing part here is proper sched data calculations, but
hopefully the chosen placeholder will be sufficient for now.

Passes piglit as well as GK107 does.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:49 +10:00
Ben Skeggs
7b9475fa65 nvc0: maxwell isa has no per-instruction join modifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:46 +10:00
Ben Skeggs
07d3972b49 nvc0: replace immd 0 with $rLASTGPR for emit/restart opcodes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:42 +10:00
Ben Skeggs
3723ff5223 nvc0: move nvc0 lowering pass class definitions into header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:39 +10:00
Ben Skeggs
bede1bdb48 nvc0: bump sched data member to 32-bits
SM50 backend requires 21 bits per instruction, not 8.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:34 +10:00
Ben Skeggs
c42d7556d3 nvc0: use vertex arrays for eng3d blit
Maxwell doesn't have immediate-mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:29 +10:00
Ben Skeggs
edb1020ea5 nvc0: restrict "constant vbo" logic to fermi/kepler classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:25 +10:00
Ben Skeggs
322460fdbc nvc0: replace some vb->stride checks with constant_vbo instead
Maxwell no longer has the methods to set constant attributes, and we'll
want to be treating stride 0 vtxbufs the same as for stride > 0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:21 +10:00
Ben Skeggs
9306c3470f nvc0: add maxwell class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:16 +10:00
Ben Skeggs
0079a375a5 nvc0: allow for easier modification of compiler library routines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:12 +10:00
Ben Skeggs
737477dac3 nvc0: properly distribute macros in source form
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:53:56 +10:00
Emil Velikov
e48054d036 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>
2014-05-14 23:44:08 +01:00
Brad King
6aac2637a6 automake: Honor GL_LIB for gallium libgl-xlib
Use "@GL_LIB@" in src/gallium/targets/libgl-xlib/Makefile.am to produce
the library name specified by the configure --with-gl-lib-name option.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-14 23:44:08 +01:00
Emil Velikov
f57d092199 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>
2014-05-14 23:44:08 +01:00
Roland Scheidegger
8a9f5ecdb1 gallivm: only fetch pointers to constant buffers once
In 1d35f77228 support for multiple constant
buffers was introduced. This meant we had another indirection, and we did
resolve the indirection for each constant buffer access. This looks very
reasonable since llvm can figure out if it's the same pointer, however it
turns out that this can cause llvm compilation time to go through the roof
and beyond (I've seen cases in excess of factor 100, e.g. from 50 ms to more
than 10 seconds (!)), with all the additional time spent in IR optimization
passes (and in the end all of it in DominatorTree::dominate()).
I've been unable to narrow it down a bit more (only some shaders seem affected,
seemingly without much correlation to overall shader complexity or constant
usage) but it is easily avoidable by doing the buffer lookups themeselves just
once (at constant buffer declaration time).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-14 16:23:33 +02:00
Roland Scheidegger
18c6454ad1 gallivm: fix output stream flushing in error case for disassembly.
When there's an error, also need to flush the stream, otherwise an assertion
is hit (meaning you don't actually see the error neither).
2014-05-14 16:23:33 +02:00
Michel Dänzer
c5828b0599 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>
2014-05-14 22:53:30 +09:00
Ilia Mirkin
12d97fb7c1 tgsi: support parsing texture offsets from text tgsi shaders
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 09:40:37 -04:00
Ilia Mirkin
04b7e65814 mesa/st: provide native integers implementation of ir_unop_any
Previously, ir_unop_any was implemented via a dot-product call, which
uses floating point multiplication and addition. The multiplication was
completely pointless, and the addition can just as well be done with an
or. Since we know that the inputs are booleans, they must already be in
canonical 0/~0 format, and the final SNE can also be avoided.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 09:40:37 -04:00
Rob Clark
209522070e gallium/docs: clarify when query results are reset
It wasn't completely clear from the docs, so I had to figure out by
looking at piglit results.  Hopefully this saves the next driver writer
implementing queries some time.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 07:54:02 -04:00
José Fonseca
b18b7781b2 gallivm: Remove lp_func_delete_body.
Not necessary, now that we will free the whole module (hence all
function bodies) immediately after compiling.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
a6f5cc66db gallivm: Remove gallivm_free_function.
Unused.  Deprecated by gallivm_free_ir().

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
0b239d9ed9 llvmpipe: Delete unneeded LLVM stuff earlier.
Same as Frank's change to draw module but for llvmpipe module.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
ef14f0d59f draw: Delete unneeded LLVM stuff earlier.
Free up unneeded LLVM stuff immediately after generating vertex shader
code.  Saves about 500K per shader.

v2: Don't bother calling gallivm_free_function (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
865d0312c0 gallivm: Separate freeing LLVM intermediate data from freeing final code.
Split free_gallivm_state() into two steps.  First step is
gallivm_free_ir() which cleans up the LLVM scaffolding used to generate
code while preserving the code itself.  Second step is
gallivm_free_code() to free the memory occupied by the code.

v2: s/gallivm_teardown/gallivm_free_ir/ (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
2c73102dc3 gallivm: One code memory pool with deferred free.
Provide a JITMemoryManager derivative which puts all generated code into
one memory pool instead of creating a new one each time code is generated.
This saves significant memory per shader as the pool size is 512K and
a small shader occupies just several K.

This memory manager also defers freeing generated code until you tell
it to do so, making it possible to destroy the LLVM engine while keeping
the code, thus enabling future memory savings.

v2: Fix compilation errors with LLVM 3.4 (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
2ea923cf57 gallivm: Run passes per module, not per function.
This is how it is meant to be done nowadays.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
920933e09e gallivm: Use LLVM global context.
I saw that LLVM internally uses its global context for some things, even
when we use our own.  Given ours is also global, might as well use
LLVM's.

However, sepearate contexts can still be enabled with a simple source
code modification, for when the need/benefit arises.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
69f0835ff1 gallivm: Stop using module providers.
Nowadays LLVMModuleProviderRef is just an alias for LLVMModuleRef, so
its use just causes unnecessary confusion.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
9cf67e51b0 gallivm,draw,llvmpipe: Remove support for versions of LLVM prior to 3.1.
Older versions haven't been tested probably don't work anyway.  But more
importantly, code supporting it is hindering further work.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
José Fonseca
ecef2da0b2 configure: Require LLVM 3.1.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
José Fonseca
c0ef9a67d3 scons: Require LLVM 3.1
Support for prior versions will be removed in the following change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
Matt Turner
2012599abb i965: Reformat brw_set_src1 so it can be easily found with grep. 2014-05-13 22:40:01 -07:00
Samuel Iglesias Gonsalvez
e0dc018fd5 i965: fix size assert for gen7 in brw_init_compaction_tables()
It should compare with it's own size.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2014-05-13 22:35:42 -07:00
Iago Toral Quiroga
520dfa4b5c i965: Relax accumulator dependency scheduling on Gen < 6
Many instructions implicitly update the accumulator on Gen < 6. The instruction
scheduling code just calls add_barrier_deps() for each accumulator access on
these platforms, but a large class of operations don't actually update the
accumulator -- mostly move and logical instructions. Teaching the scheduling
code about this would allow more flexibility to schedule instructions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77740
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-13 22:33:59 -07:00
Jonathan Gray
0c0bbe77d0 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>
2014-05-13 22:30:22 -07:00
Carl Worth
a5769ad373 docs: Really add the 10.1.3 release nots this time
Commit a96c3bccf6 intended to add these, but I
forgot to add the file.
2014-05-13 17:30:17 -07:00
Rob Clark
f999c13176 freedreno/a3xx: occlusion query support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 18:33:19 -04:00
Rob Clark
b8f78e1890 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-13 18:33:19 -04:00
Rob Clark
13a0cf4480 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-13 18:33:19 -04:00
Kenneth Graunke
2265bda513 mesa: Dump ARB_vp/fp source and IR when MESA_GLSL=dump.
As far as I can tell, Mesa hasn't had a convenient way to dump ARB_vp/fp
source until now.  Using MESA_GLSL=dump is convenient, since it means
you can use a single environment variable to dump a program's shaders,
no matter which language they're written in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 15:32:16 -07:00
Kenneth Graunke
bd44ac8b5c 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>
2014-05-13 15:32:16 -07:00
Jordan Justen
c51c192891 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>
2014-05-13 14:26:41 -07:00
Jordan Justen
294ada2fef 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>
2014-05-13 14:25:58 -07:00
Jordan Justen
e6d6ed55ab 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>
2014-05-13 14:25:58 -07:00
Jordan Justen
e47d08adef 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>
2014-05-13 14:25:58 -07:00
Jordan Justen
b875f39e29 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>
2014-05-13 14:25:57 -07:00
Rob Clark
521ee86db7 freedreno/a3xx: add point-size
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 16:54:37 -04:00
Rob Clark
a13a798926 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 16:54:20 -04:00
Bryan Cain
4e974a9cf3 glsl_to_tgsi: remove unnecessary dead code elimination pass
With the more advanced dead code elimination pass already being run,
eliminate_dead_code was making no difference in instruction count, and had
an undesirable O(n^2) runtime. So remove it and rename
eliminate_dead_code_advanced to eliminate_dead_code.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
2014-05-13 14:57:55 -05:00
José Fonseca
1646f4d0fb ralloc: Omit detailed license information about talloc.
That information misleads source code auditing tools to think that
ralloc itself is released under LGPL v3.

Instead, simply state talloc is not licensed under a permissive license.

v2: Use wording suggested by Kenneth.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-13 12:48:38 +01:00
Iago Toral Quiroga
5421617325 i965: Avoid redundant call to brw_merge_inputs() in brw_try_draw_prims()
We always call brw_merge_inputs() right before looping over the primitives but
this can be called inside the loop for each primitive too. In the case we do it
for the first primitive the call is redundant and can be skipped.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-13 10:09:35 +02:00
Iago Toral Quiroga
a143fbb322 glsl: Do not call lhs->variable_referenced() multiple times
Instead take the result from the first call and use it where needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-13 10:01:02 +02:00
Topi Pohjolainen
2a549c43a8 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>
2014-05-13 10:04:25 +03:00
Kristian Høgsberg
06842d436e 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>
2014-05-12 15:55:21 -07:00
Timothy Arceri
9c9dd8ca93 glsl: the number of samplers is already calculated so use it
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 07:40:08 +10:00
Eric Anholt
afe3d1556f i965: Stop doing remapping of "special" regs.
Now that we aren't using pixel_[xy] in live variables, nothing is looking
at these regs after the visitor stage.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 09:50:32 -07:00
Eric Anholt
66f5c8df06 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>
2014-05-12 09:49:27 -07:00
Eric Anholt
11bef60d09 i965: Move has_hiz from the slice to the level.
The value depends only on the level, so no need to store the bool per slice.
Shrinks intel_mipmap_slice from 24 bytes to 16, while slotting into an
existing hole in intel_mipmap_level.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-12 09:49:18 -07:00
Topi Pohjolainen
4dc9c314c8 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>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
a2952315ac 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>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
ac4db0aa55 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>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
3a43cd0c3e 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>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
4a92ad5531 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>
2014-05-12 17:48:45 +03:00
Ilia Mirkin
8baed87212 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>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
4467c0c9fb 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>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
64a7ddf40d 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>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
752ce0affb 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>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
863573b9cb 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>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
68f47cad0d 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>
2014-05-11 19:26:31 -04:00
Rob Clark
83b4ec03e7 freedreno/a2xx: fix compiler warning
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-11 08:58:20 -04:00
Marek Olšák
d9e102b220 radeonsi: prepare depth export registers at compile time
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
9baaa5dd4f radeonsi: simplify depth/stencil export code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
bd2df40a84 radeon/llvm: add support for non-scalar system values
The sample position is one of them.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
250aa93e23 radeonsi: add and use a helper function for loading constants
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
86035cd88d radeonsi: only count CS space for state atoms if we're going to draw
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
023d367ae6 radeonsi: remove unused variable exports_ps in si_pipe_shader_ps
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
315f3c171d 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>
2014-05-10 13:58:46 +02:00
Marek Olšák
58c659703b r600g: simplify framebuffer state size computation
Take the upper bound. The number doesn't have to absolutely correct, only safe.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Kenneth Graunke
155f98d49f Revert "i965: Fix depth (array slices) computation for 1D_ARRAY render targets."
This reverts commit e6967270c7.

Chris Forbes pointed out that this is broken for texture views which
restrict the number of slices.  He committed a better fix which makes
this unnecessary.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-09 20:08:38 -07:00
Emil Velikov
a3e78bab7f egl_dri2: cleanup memory leak in dri2_create_context()
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-10 02:09:02 +01:00
Emil Velikov
42770ff94e ilo: destroy the mutex, if winsys creation fails
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-05-10 02:09:02 +01:00
Emil Velikov
326b8e253e 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>
2014-05-10 02:08:36 +01:00
Emil Velikov
e477d12c33 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>
2014-05-10 02:08:36 +01:00
Chia-I Wu
510465016b mesa: propagate FragDepthLayout to gl_program
The information was lost during linking, causing the layout to be treated as
FRAG_DEPTH_LAYOUT_NONE.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 17:21:53 -07:00
Chris Forbes
417f5ea00d glsl: Rename linker's is_varying_var
Both the ast->IR and linker have functions with this name, but different
behavior.

Rename the linker's version to var_counts_against_varying_limit to be
closer to what it is actually used for.

Suggested by Ian a while back.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-10 09:29:13 +12:00
Kenneth Graunke
9584959123 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>
2014-05-09 14:18:13 -07:00
Tom Stellard
93c2ebbd83 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>
2014-05-09 12:16:05 -04:00
Tom Stellard
c5d0008325 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>
2014-05-09 12:16:05 -04:00
Carl Worth
a96c3bccf6 docs: Import 10.1.3 release notes, andd news item. 2014-05-09 07:52:26 -07:00
Thomas Hellstrom
9306b7c171 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>
2014-05-09 08:40:12 +02:00
Tom Stellard
c5f0c98c49 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>
2014-05-09 04:33:03 -04:00
Tom Stellard
c650033b86 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>
2014-05-09 04:32:54 -04:00
Chris Forbes
23e9f06569 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>
2014-05-09 09:46:20 +12:00
Chris Forbes
77d55ef481 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>
2014-05-09 09:46:19 +12:00
Chris Forbes
9269ea599c 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>
2014-05-09 09:46:19 +12:00
Chris Forbes
dd43900b7b 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>
2014-05-09 09:46:19 +12:00
Chris Forbes
cc8c00da88 i965: Fix typo in assert message
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-09 09:46:19 +12:00
Adam Jackson
74388dd24b 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>
2014-05-08 12:05:58 -04:00
Roland Scheidegger
cf93f86957 llvmpipe: change LP_MAX_SHADER_INSTRUCTIONS limit definition.
When the limit was changed to be defined in terms of LP_MAX_SHADER_VARIANTS
(75f1fea14f) when it was increased, this
inadvertently lowered the limit in some branches (that have a lower
LP_MAX_SHADER_VARIANTS number) when merged. So, make sure the limit is always
at least the number it once was.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-08 16:26:49 +02:00
Roland Scheidegger
9af68e9b1d 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>
2014-05-08 16:26:49 +02:00
Kenneth Graunke
e6967270c7 i965: Fix depth (array slices) computation for 1D_ARRAY render targets.
1D array targets store the number of slices in the Height field.

Fixes Piglit's spec/!OpenGL 3.2/layered-rendering/clear-color-all-types
1d_array single_level, at least when used with Meta clears.

Cc: "10.2 10.1 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-05-07 23:42:11 -07:00
Kenneth Graunke
5c399ca8e4 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>
2014-05-07 23:42:11 -07:00
Kenneth Graunke
ecfc418b68 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>
2014-05-07 23:42:11 -07:00
Ilia Mirkin
9d95d64be0 mesa: pass target through to driver when choosing texture format
This only matters for TextureView where the texObj's target has not been
set yet, in all other instances, texObj->target should be the same as
the passed-in target parameter.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
e7047f2917 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>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
5a40fe03f7 nv50/ir: allow load propagation when flags are defined
The old condition disallowed load propagation any time flags were
defined, even with e.g. set and a constbuf reference. The new condition
disallows it only with immediate propagation. (There are no opcodes that
set the condition flag and have an immediate argument.)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
83b900fd0a mesa/st: pass 4-offset TG4 without lowering if supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
d95df4f4e4 gallium: add a cap for supporting 4-offset TG4 opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-07 20:40:46 -04:00
Brian Paul
9ced3fc649 svga: add switch case for PIPE_SHADER_CAP_PREFERRED_IR, remove default case
Remove default switch case so we're warned of missing cases at compile
time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
9b1ae44ae1 tgsi: add missing switch cases in tgsi_exec_get_shader_param()
Add cases for PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS and
PIPE_SHADER_CAP_PREFERRED_IR.  Remove default switch case so we
learn of missing cases at compile time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
baec25635d gallivm: add PIPE_SHADER_CAP_PREFERRED_IR switch case, remove default
Return PIPE_SHADER_IR_TGSI for the PIPE_SHADER_CAP_PREFERRED_IR query.
Remove default switch case so we learn of missing switch cases at
compile time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
ed8bfaba52 gallium: remove enum numbers from shader cap queries
The enum numbers were just cruft.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2014-05-07 11:32:11 -06:00
Ian Romanick
f7bf37cb13 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>
2014-05-07 09:50:14 -07:00
José Fonseca
98934f4aba st/wgl: Advertise WGL_ARB_create_context(_profile).
We added wglCreateContextAttribsARB but not the extension strings.

This allows creation of GL 3.x contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 16:15:45 +01:00
José Fonseca
aee501060b st/wgl: Honour request of 3.1 contexts through core profile where available.
Port 5f493eed69 from GLX.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 16:15:45 +01:00
Kenneth Graunke
9701c6984d 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>
2014-05-06 11:31:31 -07:00
Kenneth Graunke
c1c1cf5f92 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>
2014-05-06 11:31:29 -07:00
Kenneth Graunke
e526ebf35c 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>
2014-05-06 11:31:27 -07:00
Kenneth Graunke
7c8df60f31 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>
2014-05-06 11:31:21 -07:00
Kenneth Graunke
cde8bad1c9 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>
2014-05-06 11:30:54 -07:00
Marek Olšák
2484daa4fd radeonsi: implement ARB_texture_cube_map_array
No LLVM changes needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

v2: updated GL3.txt and relnotes
2014-05-06 17:18:17 +02:00
Marek Olšák
cc71df5652 configure.ac: radeonsi requires EGL_DRM and GBM
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-06 16:59:35 +02:00
Tapani Pälli
e65917f94e 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>
2014-05-06 08:36:40 +03:00
Carl Worth
6dd907c80d docs: Import 10.1.2 release notes, andd news item. 2014-05-05 13:25:44 -07:00
Paulo Sergio Travaglia
97a70f26f2 st/egl: Flush resources before presentation (android - bug 77966)
[olv: Use the real name provided by the patch author.  Ideally this could be
moved to somewhere higher level so that we would not need to create a pipe
context to flush resources.  Plus, it is not clear if flushing resources for
another context is valid.]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-05-05 08:33:14 +08:00
Ilia Mirkin
5cfd45fbc3 docs: mark ARB_stencil_texturing as done for nv50+/r600+
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-04 20:17:25 -04:00
Ilia Mirkin
833f870d9b mesa/st: implement ARB_stencil_texturing
If StencilSampling is enabled on the texture object, pass in an
equivalent stencil-only format.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-04 20:10:14 -04:00
Ilia Mirkin
cee22a0b48 nv50,nvc0: add X8Z24_UNORM, fix stencil-only formats
S8_UINT will become useful when ARB_texture_stencil8 becomes supported by
mesa. The other stencil formats are needed for ARB_stencil_texturing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-04 20:05:44 -04:00
Rob Clark
b7e7ae9f60 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>
2014-05-04 11:08:10 -04:00
Kenneth Graunke
829cb0423d 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>
2014-05-02 23:05:37 -07:00
Ian Romanick
64c4670dd6 mesa: Bump version to 10.3-devel
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 21:43:48 -07:00
2105 changed files with 159811 additions and 74519 deletions

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.
@@ -38,11 +38,10 @@ MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSI
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
MESA_PYTHON2 := python
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))
@@ -82,6 +81,7 @@ SUBDIRS := \
src/mapi \
src/glsl \
src/mesa \
src/util \
src/egl/main
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)

7
CleanSpec.mk Normal file
View File

@@ -0,0 +1,7 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libmesa_*_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/i9*5_dri_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libglapi_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libGLES_mesa_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/mesa_*_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/glsl_compiler_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/STATIC_LIBRARIES/libmesa_glsl_utils_intermediates)

View File

@@ -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
.PHONY: tarballs checksums

View File

@@ -1 +1 @@
10.2.0-devel
10.4.7

18
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,18 @@
# No whitespace commits in stable.
a10bf5c10caf27232d4df8da74d5c35c23eb883d
# The following patches address code which is missing in 10.4
# http://lists.freedesktop.org/archives/mesa-dev/2015-March/078515.html
06084652fefe49c3d6bf1b476ff74ff602fdc22a common: Correct texture init for meta pbo uploads and downloads.
# http://lists.freedesktop.org/archives/mesa-dev/2015-March/078547.html
ccc5ce6f72c1ec86be4dfcef96c0b51fba0faa6d common: Correct PBO 2D_ARRAY handling.
# http://lists.freedesktop.org/archives/mesa-dev/2015-March/078549.html
546aba143d13ba3f993ead4cc30b2404abfc0202 common: Fix PBOs for 1D_ARRAY.
# http://lists.freedesktop.org/archives/mesa-dev/2015-March/078501.html
2b2fa1865248c6e3b7baec81c4f92774759b201f mesa: Indent break statements and add a missing one.
# http://lists.freedesktop.org/archives/mesa-dev/2015-March/078502.html
87109acbed9c9b52f33d58ca06d9048d0ac7a215 mesa: Free memory allocated for luminance in readpixels.

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\.4.*mesa-stable\)' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,8 @@ are exposed in the 3.0 context as extensions.
Feature Status
----------------------------------------------------- ------------------------
GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL 3.0, GLSL 1.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe (*), softpipe (*)
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)
@@ -48,10 +47,11 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLX_ARB_create_context (GLX 1.4 is required) DONE
Multisample anti-aliasing DONE (r300)
(*) llvmpipe and softpipe have fake Multisample anti-aliasing support
GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 1.40 DONE ()
GL 3.1, GLSL 1.40 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
Forward compatible context support/deprecations DONE ()
Instanced drawing (GL_ARB_draw_instanced) DONE (swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (r300, swrast)
@@ -63,10 +63,9 @@ GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
Signed normalized textures (GL_EXT_texture_snorm) DONE (r300)
GL 3.2 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL 3.2, GLSL 1.50 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
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)
@@ -79,10 +78,9 @@ GL 3.2 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLX_ARB_create_context_profile DONE
GL 3.3 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe
GLSL 3.30 DONE ()
GL_ARB_blend_func_extended DONE (softpipe)
GL_ARB_blend_func_extended DONE ()
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)
@@ -94,102 +92,129 @@ GL 3.3 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL_ARB_vertex_type_2_10_10_10_rev DONE ()
GL 4.0:
GL 4.0, GLSL 4.00:
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_draw_buffers_blend DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_draw_indirect DONE (i965, nvc0, radeonsi, llvmpipe, softpipe)
GL_ARB_gpu_shader5 DONE (i965, nvc0)
- 'precise' qualifier DONE
- Dynamically uniform sampler array indices DONE (r600)
- Dynamically uniform UBO array indices DONE (r600)
- Implicit signed -> unsigned conversions DONE
- Fused multiply-add DONE ()
- Packing/bitfield/conversion functions DONE (r600)
- Enhanced textureGather DONE (r600, radeonsi)
- Geometry shader instancing DONE (r600)
- Geometry shader multiple streams DONE ()
- Enhanced per-sample shading DONE (r600)
- Interpolation functions DONE (r600)
- New overload resolution rules DONE
GL_ARB_gpu_shader_fp64 started (Dave)
GL_ARB_sample_shading DONE (i965, nv50, nvc0, r600, radeonsi)
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_tessellation_shader started (Chris, Ilia)
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_texture_query_lod DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi)
GL 4.1:
GL 4.1, GLSL 4.10:
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
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_ARB_shader_precision started (Micah)
GL_ARB_vertex_attrib_64bit started (Dave)
GL_ARB_viewport_array DONE (i965, nv50, nvc0, r600, llvmpipe)
GL 4.2:
GL 4.2, GLSL 4.20:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_texture_compression_bptc DONE (i965, nvc0, r600, radeonsi)
GL_ARB_compressed_texture_pixel_storage DONE (all drivers)
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_base_instance DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
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_internalformat_query DONE (i965, nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_map_buffer_alignment DONE (all drivers)
GL 4.3:
GL 4.3, GLSL 4.30:
GLSL 4.3 not started
GL_ARB_arrays_of_arrays started
GL_ARB_ES3_compatibility DONE (i965)
GL_ARB_arrays_of_arrays started (Timothy)
GL_ARB_ES3_compatibility DONE (all drivers that support GLSL 3.30)
GL_ARB_clear_buffer_object DONE (all drivers)
GL_ARB_compute_shader started (Paul Berry)
GL_ARB_copy_image not started
GL_ARB_compute_shader in progress (jljusten)
GL_ARB_copy_image DONE (i965)
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location not started
GL_ARB_fragment_layer_viewport not started
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
GL_ARB_fragment_layer_viewport DONE (nv50, nvc0, r600, llvmpipe)
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_multi_draw_indirect DONE (i965, nvc0, radeonsi, llvmpipe, softpipe)
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_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi, llvmpipe)
GL_ARB_texture_query_levels DONE (all drivers that support GLSL 1.30)
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
GL_ARB_texture_view DONE (i965)
GL_ARB_texture_view DONE (i965, nv50, nvc0)
GL_ARB_vertex_attrib_binding DONE (all drivers)
GL 4.4:
GL 4.4, GLSL 4.40:
GLSL 4.4 not started
GL_MAX_VERTEX_ATTRIB_STRIDE not started
GL_MAX_VERTEX_ATTRIB_STRIDE DONE (all drivers)
GL_ARB_buffer_storage DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_clear_texture not started
GL_ARB_clear_texture DONE (i965)
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_mirror_clamp_to_edge DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi, swrast, llvmpipe, softpipe)
GL_ARB_texture_stencil8 not started
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL 4.5, GLSL 4.50:
GL_ARB_ES3_1_compatibility not started
GL_ARB_clip_control DONE (nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_conditional_render_inverted DONE (i965, nv50, nvc0, llvmpipe, softpipe)
GL_ARB_cull_distance not started
GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600)
GL_ARB_direct_state_access not started
GL_ARB_get_texture_sub_image started (Brian Paul)
GL_ARB_shader_texture_image_samples not started
GL_ARB_texture_barrier DONE (nv50, nvc0, r300, r600, radeonsi)
GL_KHR_context_flush_control DONE (all - but needs GLX/EXT extension to be useful)
GL_KHR_robust_buffer_access_behavior not started
GL_KHR_robustness 90% done (the ARB variant)
These are the extensions cherry-picked to make GLES 3.1
GLES3.1, GLSL ES 3.1
GL_ARB_arrays_of_arrays started (Timothy)
GL_ARB_compute_shader in progress (jljusten)
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
GL_ARB_framebuffer_no_attachments not started
GL_ARB_program_interface_query not started
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_shader_image_load_store in progress (curro)
GL_ARB_shader_storage_buffer_object not started
GL_ARB_separate_shader_objects DONE (all drivers)
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
GL_ARB_vertex_attrib_binding DONE (all drivers)
GS5 Enhanced textureGather DONE (i965, nvc0, r600, radeonsi)
GS5 Packing/bitfield/conversion functions DONE (i965, nvc0, r600)
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)
More info about these features and the work involved can be found at

View File

@@ -97,20 +97,22 @@ shared libraries in a single pass.</p>
<dt><code>CC, CFLAGS, CXX, CXXFLAGS</code></dt>
<dd><p>These environment variables
control the C and C++ compilers used during the build. By default,
<code>gcc</code> and <code>g++</code> are used with the options
<code>"-g -O2"</code>.</p>
<code>gcc</code> and <code>g++</code> are used and the debug/optimisation
level is left unchanged.</p>
</dd>
<dt><code>LDFLAGS</code></dt>
<dd><p>An environment variable specifying flags to
pass when linking programs. These are normally empty, but can be used
to direct the linker to use libraries in nonstandard directories. For
example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p>
pass when linking programs. These should be empty and
<code>PKG_CONFIG_PATH</code> is recommended to be used instead. If needed
it can be used to direct the linker to use libraries in nonstandard
directories. For example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p>
</dd>
<dt><code>PKG_CONFIG_PATH</code></dt>
<dd><p>When available, the
<code>pkg-config</code> utility is used to search for external libraries
<dd><p>The
<code>pkg-config</code> utility is a hard requirement for cofiguring and
building mesa. It is used to search for external libraries
on the system. This environment variable is used to control the search
path for <code>pkg-config</code>. For instance, setting
<code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for
@@ -135,14 +137,32 @@ one of these architectures is detected. This option ensures that
assembly will not be used.</p>
</dd>
<dt><code>--enable-32-bit</code></dt>
<dt><code>--enable-64-bit</code></dt>
<dd><p>By default, the build will compile code as directed by the environment
variables
<code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
<code>gcc</code>, these options offer a helper to add the compiler flags
to force 32- or 64-bit code generation as used on the x86 and x86_64
architectures. Note that these options are mutually exclusive.</p>
<dt><code>--build=</code></dt>
<dt><code>--host=</code></dt>
<dd><p>By default, the build will compile code for the architecture that
it's running on. In order to build cross-compile Mesa on a x86-64 machine
that is to run on a i686, one would need to set the options to:</p>
<p><code>--build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu</code></p>
Note that these can vary from distribution to distribution. For more
information check with the
<a href="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Specifying-Target-Triplets.html">
autoconf manual</a>.
Note that you will need to correctly set <code>PKG_CONFIG_PATH</code> as well.
<p>In some cases a single compiler is capable of handling both architectures
(multilib) in that case one would need to set the <code>CC,CXX</code> variables
appending the correct machine options. Seek your compiler documentation for
further information -
<a href="https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.html"> gcc
machine dependent options</a></p>
<p>In addition to specifying correct <code>PKG_CONFIG_PATH</code> for the target
architecture, the following should be sufficient to configure multilib Mesa</p>
<code>./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu ...</code>
</dd>
</dl>
@@ -194,7 +214,9 @@ kernel DRM modules are not available.
<dt><code>--enable-glx-tls</code> <dd><p>
Enable Thread Local Storage (TLS) in
GLX.
<dt><code>--with-expat=DIR</code> <dd> The DRI-enabled libGL uses expat to
<dt><code>--with-expat=DIR</code>
<dd><p><strong>DEPRECATED</strong>, use <code>PKG_CONFIG_PATH</code> instead.</p>
<p>The DRI-enabled libGL uses expat to
parse the DRI configuration files in <code>/etc/drirc</code> and
<code>~/.drirc</code>. This option allows a specific expat installation
to be used. For example, <code>--with-expat=/usr/local</code> will

View File

@@ -218,15 +218,93 @@ 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>
<a href="http://cworth.org/~cworth/mesa-stable-queue/">Mesa Stable Queue</a>
page.
<h2>Cherry-picking candidates for a stable branch</h2>
<h2>Criteria for accepting patches to the stable branch</h2>
<p>
Please use <code>git cherry-pick -x &lt;commit&gt;</code> for cherry-picking a commit
from master to a stable branch.
</p>
Mesa has a designated release manager for each stable branch, and the release
manager is the only developer that should be pushing changes to these
branches. Everyone else should simply nominate patches using the mechanism
described above.
The stable-release manager will work with the list of nominated patches, and
for each patch that meets the crtieria below will cherry-pick the patch with:
<code>git cherry-pick -x &lt;commit&gt;</code>. The <code>-x</code> option is
important so that the picked patch references the comit ID of the original
patch.
The stable-release manager may at times need to force-push changes to the
stable branches, for example, to drop a previously-picked patch that was later
identified as causing a regression). These force-pushes may cause changes to
be lost from the stable branch if developers push things directly. Consider
yourself warned.
The stable-release manager is also given broad discretion in rejecting patches
that have been nominated for the stable branch. The most basic rule is that
the stable branch is for bug fixes only, (no new features, no
regressions). Here is a non-exhaustive list of some reasons that a patch may
be rejected:
<ul>
<li>Patch introduces a regression. Any reported build breakage or other
regression caused by a particular patch, (game no longer work, piglit test
changes from PASS to FAIL), is justification for rejecting a patch.</li>
<li>Patch is too large, (say, larger than 100 lines)</li>
<li>Patch is not a fix. For example, a commit that moves code around with no
functional change should be rejected.</li>
<li>Patch fix is not clearly described. For example, a commit message
of only a single line, no description of the bug, no mention of bugzilla,
etc.</li>
<li>Patch has not obviously been reviewed, For example, the commit message
has no Reviewed-by, Signed-off-by, nor Tested-by tags from anyone but the
author.</li>
<li>Patch has not already been merged to the master branch. As a rule, bug
fixes should never be applied first to a stable branch. Patches should land
first on the master branch and then be cherry-picked to a stable
branch. (This is to avoid future releases causing regressions if the patch
is not also applied to master.) The only things that might look like
exceptions would be backports of patches from master that happen to look
significantly different.</li>
<li>Patch depends on too many other patches. Ideally, all stable-branch
patches should be self-contained. It sometimes occurs that a single, logical
bug-fix occurs as two separate patches on master, (such as an original
patch, then a subsequent fix-up to that patch). In such a case, these two
patches should be squashed into a single, self-contained patch for the
stable branch. (Of course, if the squashing makes the patch too large, then
that could be a reason to reject the patch.)</li>
<li>Patch includes new feature development, not bug fixes. New OpenGL
features, extensions, etc. should be applied to Mesa master and included in
the next major release. Stable releases are intended only for bug fixes.
Note: As an exception to this rule, the stable-release manager may accept
hardware-enabling "features". For example, backports of new code to support
a newly-developed hardware product can be accepted if they can be reasonably
determined to not have effects on other hardware.</li>
<li>Patch is a performance optimization. As a rule, performance patches are
not candidates for the stable branch. The only exception might be a case
where an application's performance was recently severely impacted so as to
become unusable. The fix for this performance regression could then be
considered for a stable branch. The optimization must also be
non-controversial and the patches still need to meet the other criteria of
being simple and self-contained</li>
<li>Patch introduces a new failure mode (such as an assert). While the new
assert might technically be correct, for example to make Mesa more
conformant, this is not the kind of "bug fix" we want in a stable
release. The potential problem here is that an OpenGL program that was
previously working, (even if technically non-compliant with the
specification), could stop working after this patch. So that would be a
regression that is unaacceptable for the stable branch.</li>
</ul>
<h2>Making a New Mesa Release</h2>
@@ -237,64 +315,205 @@ These are the instructions for making a new Mesa release.
<h3>Get latest source files</h3>
<p>
Use git to get the latest Mesa files from the git repository, from whatever
branch is relevant.
branch is relevant. This document uses the convention X.Y.Z for the release
being created, which should be created from a branch named X.Y.
</p>
<h3>Verify and update version info in VERSION</h3>
<h3>Perform basic testing</h3>
<p>
Create a docs/relnotes/x.y.z.html file.
The bin/bugzilla_mesa.sh and bin/shortlog_mesa.sh scripts can be used to
create the HTML-formatted lists of bugfixes and changes to include in the file.
Link the new docs/relnotes/x.y.z.html file into the main <a href="relnotes.html">relnotes.html</a> file.
The release manager should, at the very least, test the code by compiling it,
installing it, and running the latest piglit to ensure that no piglit tests
have regressed since the previous release.
</p>
<p>
Update <a href="index.html">docs/index.html</a>.
The release manager should do this testing with at least one hardware driver,
(say, whatever is contained in the local development machine), as well as on
both Gallium and non-Gallium software drivers. The software testing can be
performed by running piglit with the following environment-variable set:
</p>
<p>
Tag the files with the release name (in the form <b>mesa-x.y</b>)
with: <code>git tag -s mesa-x.y -m "Mesa x.y Release"</code>
Then: <code>git push origin mesa-x.y</code>
</p>
<h3>Make the tarballs</h3>
<p>
Make the distribution files. From inside the Mesa directory:
<pre>
./autogen.sh
make tarballs
LIBGL_ALWAYS_SOFTWARE=1
</pre>
And Gallium vs. non-Gallium software drivers can be obtained by using the
following configure flags on separate builds:
<pre>
--with-dri-drivers=swrast
--with-gallium-drivers=swrast
</pre>
<p>
After the tarballs are created, the md5 checksums for the files will
be computed.
Add them to the docs/relnotes/x.y.html file.
Note: If both options are given in one build, both swrast_dri.so drivers will
be compiled, but only one will be installed. The following command can be used
to ensure the correct driver is being tested:
</p>
<pre>
LIBGL_ALWAYS_SOFTWARE=1 glxinfo | grep "renderer string"
</pre>
If any regressions are found in this testing with piglit, stop here, and do
not perform a release until regressions are fixed.
<h3>Update version in file VERSION</h3>
<p>
Increment the version contained in the file VERSION at Mesa's top-level, then
commit this change.
</p>
<h3>Create release notes for the new release</h3>
<p>
Create a new file docs/relnotes/X.Y.Z.html, (follow the style of the previous
release notes). Note that the sha256sums section of the release notes should
be empty at this point.
</p>
<p>
Copy the distribution files to a temporary directory, unpack them,
compile everything, and run some demos to be sure everything works.
</p>
Two scripts are available to help generate portions of the release notes:
<pre>
./bin/bugzilla_mesa.sh
./bin/shortlog_mesa.sh
</pre>
<h3>Update the website and announce the release</h3>
<p>
Make a new directory for the release on annarchy.freedesktop.org with:
<br>
<code>
mkdir /srv/ftp.freedesktop.org/pub/mesa/x.y
</code>
The first script identifies commits that reference bugzilla bugs and obtains
the descriptions of those bugs from bugzilla. The second script generates a
log of all commits. In both cases, HTML-formatted lists are printed to stdout
to be included in the release notes.
</p>
<p>
Basically, to upload the tarball files with:
<br>
<code>
rsync -avP -e ssh MesaLib-x.y.* USERNAME@annarchy.freedesktop.org:/srv/ftp.freedesktop.org/pub/mesa/x.y/
</code>
Commit these changes
</p>
<h3>Make the release archives, signatures, and the release tag</h3>
<p>
From inside the Mesa directory:
<pre>
./autogen.sh
make -j1 tarballs
</pre>
<p>
After the tarballs are created, the sha256 checksums for the files will
be computed and printed. These will be used in a step below.
</p>
<p>
It's important at this point to also verify that the constructed tar file
actually builds:
</p>
<pre>
tar xjf MesaLib-X.Y.Z.tar.bz2
cd Mesa-X.Y.Z
./configure --enable-gallium-llvm
make -j6
make install
</pre>
<p>
Some touch testing should also be performed at this point, (run glxgears or
more involved OpenGL programs against the installed Mesa).
</p>
<p>
Create detached GPG signatures for each of the archive files created above:
</p>
<pre>
gpg --sign --detach MesaLib-X.Y.Z.tar.gz
gpg --sign --detach MesaLib-X.Y.Z.tar.bz2
gpg --sign --detach MesaLib-X.Y.Z.zip
</pre>
<p>
Tag the commit used for the build:
</p>
<pre>
git tag -s mesa-X.Y.X -m "Mesa X.Y.Z release"
</pre>
<p>
Note: It would be nice to investigate and fix the issue that causes the
tarballs target to fail with multiple build process, such as with "-j4". It
would also be nice to incorporate all of the above commands into a single
makefile target. And instead of a custom "tarballs" target, we should
incorporate things into the standard "make dist" and "make distcheck" targets.
</p>
<h3>Add the sha256sums to the release notes</h3>
<p>
Edit docs/relnotes/X.Y.Z.html to add the sha256sums printed as part of "make
tarballs" in the previous step. Commit this change.
</p>
<h3>Push all commits and the tag creates above</h3>
<p>
This is the first step that cannot easily be undone. The release is going
forward from this point:
</p>
<pre>
git push origin X.Y --tags
</pre>
<h3>Install the release files and signatures on the distribution server</h3>
<p>
The following commands can be used to copy the release archive files and
signatures to the freedesktop.org server:
</p>
<pre>
scp MesaLib-X.Y.Z* people.freedesktop.org:
ssh people.freedesktop.org
cd /srv/ftp.freedesktop.org/pub/mesa
mkdir X.Y.Z
cd X.Y.Z
mv ~/MesaLib-X.Y.Z* .
</pre>
<h3>Back on mesa master, andd the new release notes into the tree</h3>
<p>
Something like the following steps will do the trick:
</p>
<pre>
cp docs/relnotes/X.Y.Z.html /tmp
git checkout master
cp /tmp/X.Y.Z.html docs/relnotes
git add docs/relnotes/X.Y.Z.html
</pre>
<p>
Also, edit docs/relnotes.html to add a link to the new release notes, and edit
docs/index.html to add a news entry. Then commit and push:
</p>
<pre>
git commit -a -m "docs: Import X.Y.Z release notes, add news item."
git push origin
</pre>
<h3>Update the mesa3d.org website</h3>
<p>
NOTE: The recent release managers have not been performing this step
themselves, but leaving this to Brian Paul, (who has access to the
sourceforge.net hosting for mesa3d.org). Brian is more than willing to grant
the permission necessary to future release managers to do this step on their
own.
</p>
<p>
@@ -306,13 +525,22 @@ sftp USERNAME,mesa3d@web.sourceforge.net
</code>
</p>
<h3>Announce the release</h3>
<p>
Make an announcement on the mailing lists:
<em>mesa-dev@lists.freedesktop.org</em>,
<em>mesa-users@lists.freedesktop.org</em>
and
<em>mesa-announce@lists.freedesktop.org</em>
Follow the template of previously-sent release announcements. The following
command can be used to generate the log of changes to be included in the
release announcement:
<pre>
git shortlog mesa-X.Y.Z-1..mesa-X.Y.Z
</pre>
</p>
</div>

View File

@@ -77,13 +77,6 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</dd>
<dt><code>--enable-gallium-egl</code></dt>
<dd>
<p>Enable the optional <code>egl_gallium</code> driver.</p>
</dd>
<dt><code>--with-egl-platforms</code></dt>
<dd>

View File

@@ -16,6 +16,133 @@
<h1>News</h1>
<h2>December 14, 2014</h2>
<p>
<a href="relnotes/10.4.html">Mesa 10.4</a> is released. This is a new
development release. See the release notes for more information about
the release.
</p>
<h2>November 8, 2014</h2>
<p>
<a href="relnotes/10.3.3.html">Mesa 10.3.3</a> is released.
This is a bug-fix release.
</p>
<h2>October 24, 2014</h2>
<p>
<a href="relnotes/10.3.2.html">Mesa 10.3.2</a> is released.
This is a bug-fix release.
</p>
<h2>October 12, 2014</h2>
<p>
<a href="relnotes/10.2.9.html">Mesa 10.2.9</a>
and <a href="relnotes/10.3.1.html">Mesa 10.3.1</a> are released.
These are bug-fix releases from the 10.2 and 10.3 branches, respectively.
<br>
NOTE: It is anticipated that 10.2.9 will be the final release in the 10.2
series. Users of 10.2 are encouraged to migrate to the 10.3 series in order
to obtain future fixes.
</p>
<h2>September 19, 2014</h2>
<p>
<a href="relnotes/10.3.html">Mesa 10.3</a> is released. This is a new
development release. See the release notes for more information about
the release.
</p>
<p>
Also, <a href="relnotes/10.2.8.html">Mesa 10.2.8</a> is released.
This is a bug fix release from the 10.2 branch.
</p>
<h2>September 6, 2014</h2>
<p>
<a href="relnotes/10.2.7.html">Mesa 10.2.7</a> is released.
This is a bug-fix release.
</p>
<h2>August 19, 2014</h2>
<p>
<a href="relnotes/10.2.6.html">Mesa 10.2.6</a> is released.
This is a bug-fix release.
</p>
<h2>August 2, 2014</h2>
<p>
<a href="relnotes/10.2.5.html">Mesa 10.2.5</a> is released.
This is a bug-fix release.
</p>
<h2>July 18, 2014</h2>
<p>
<a href="relnotes/10.2.4.html">Mesa 10.2.4</a> is released.
This is a bug-fix release.
</p>
<h2>July 7, 2014</h2>
<p>
<a href="relnotes/10.2.3.html">Mesa 10.2.3</a> is released.
This is a bug-fix release.
</p>
<h2>July 5, 2014</h2>
<p>
Mesa demos 8.2.0 is released.
See the <a href="http://lists.freedesktop.org/archives/mesa-announce/2014-July/000100.html">announcement</a> for more information about the release.
You can download it from <a href="ftp://ftp.freedesktop.org/pub/mesa/demos/8.2.0/">ftp.freedesktop.org/pub/mesa/demos/8.2.0/</a>.
</p>
<h2>June 24, 2014</h2>
<p>
<a href="relnotes/10.1.6.html">Mesa 10.1.6</a>
and <a href="relnotes/10.2.2.html">Mesa 10.2.2</a> are released.
These are bug-fix releases from the 10.1 and 10.2 branches, respectively.
</p>
<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>
<p>
Also, <a href="relnotes/10.1.5.html">Mesa 10.1.5</a> is released.
This is a bug fix release from the 10.1 branch.
</p>
<h2>May 20, 2014</h2>
<p>
<a href="relnotes/10.1.4.html">Mesa 10.1.4</a> is released.
This is a bug-fix release.
</p>
<h2>May 9, 2014</h2>
<p>
<a href="relnotes/10.1.3.html">Mesa 10.1.3</a> is released.
This is a bug-fix release, and is being released sooner than
originally scheduled to fix a performance regression (vmware
swapbuffers falling back to software) introduced to the
10.1.2 release.
</p>
<h2>May 5, 2014</h2>
<p>
<a href="relnotes/10.1.2.html">Mesa 10.1.2</a> is released.
This is a bug-fix release.
</p>
<h2>April 18, 2014</h2>
<p>
<a href="relnotes/10.1.1.html">Mesa 10.1.1</a> is released.

View File

@@ -34,16 +34,25 @@
<h2>1.1 General</h2>
<ul>
<li><a href="http://www.python.org/">Python</a> - Python is required.
Version 2.6.4 or later should work.
</li>
<br>
<li><a href="http://www.scons.org/">SCons</a> is required for building on
Windows and optional for Linux (it's an alternative to autoconf/automake.)
</li>
<br>
<li>lex / yacc - for building the GLSL compiler.
<br>
<br>
On Linux systems, flex and bison are used.
Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
<br>
<br>
On Windows with MinGW, install flex and bison with:
<pre>mingw-get install msys-flex msys-bison</pre>
</li>
<li>python - Python is needed for building the Gallium components.
Version 2.6.4 or later should work.
For MSVC on Windows, you can find flex/bison programs on the
<a href="ftp://ftp.freedesktop.org/pub/mesa/windows-utils/">Mesa ftp site</a>.
</li>
</ul>

View File

@@ -43,11 +43,7 @@ It's the fastest software rasterizer for Mesa.
</p>
</li>
<li>
<p>LLVM: version 2.9 recommended; 2.6 or later required.</p>
<p><b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
</p>
<p>LLVM: version 3.4 recommended; 3.3 or later required.</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
@@ -101,13 +97,15 @@ but the rest of these instructions assume that scons is used.
For Windows the procedure is similar except the target:
<pre>
scons build=debug libgl-gdi
scons platform=windows build=debug libgl-gdi
</pre>
<h1>Using</h1>
On Linux, building will create a drop-in alternative for libGL.so into
<h2>Linux</h2>
<p>On Linux, building will create a drop-in alternative for libGL.so into</p>
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
@@ -117,15 +115,45 @@ or
lib/gallium/libGL.so
</pre>
To use it set the LD_LIBRARY_PATH environment variable accordingly.
<p>To use it set the LD_LIBRARY_PATH environment variable accordingly.</p>
For performance evaluation pass debug=no to scons, and use the corresponding
lib directory without the "-debug" suffix.
<p>For performance evaluation pass build=release to scons, and use the corresponding
lib directory without the "-debug" suffix.</p>
On Windows, building will create a drop-in alternative for opengl32.dll. To use
it put it in the same directory as the application. It can also be used by
<h2>Windows</h2>
<p>
On Windows, building will create
<code>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll</code>
which is a drop-in alternative for system's <code>opengl32.dll</code>. To use
it put it in the same directory as your application. It can also be used by
replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
</p>
<p>
There is however an easy way to replace the OpenGL software renderer that comes
with Microsoft Windows 7 (or later) with llvmpipe (that is, on systems without
any OpenGL drivers):
</p>
<ul>
<li><p>copy build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll to C:\Windows\SysWOW64\mesadrv.dll</p></li>
<li><p>load this registry settings:</p>
<pre>REGEDIT4
; http://technet.microsoft.com/en-us/library/cc749368.aspx
; http://www.msfn.org/board/topic/143241-portable-windows-7-build-from-winpe-30/page-5#entry942596
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL]
"DLL"="mesadrv.dll"
"DriverVersion"=dword:00000001
"Flags"=dword:00000001
"Version"=dword:00000002
</pre>
</li>
<li>Ditto for 64 bits drivers if you need them.</li>
</ul>
<h1>Profiling</h1>

View File

@@ -21,6 +21,26 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
<li><a href="relnotes/10.4.html">10.4 release notes</a>
<li><a href="relnotes/10.3.3.html">10.3.3 release notes</a>
<li><a href="relnotes/10.3.2.html">10.3.2 release notes</a>
<li><a href="relnotes/10.3.1.html">10.3.1 release notes</a>
<li><a href="relnotes/10.2.9.html">10.2.9 release notes</a>
<li><a href="relnotes/10.3.html">10.3 release notes</a>
<li><a href="relnotes/10.2.8.html">10.2.8 release notes</a>
<li><a href="relnotes/10.2.7.html">10.2.7 release notes</a>
<li><a href="relnotes/10.2.6.html">10.2.6 release notes</a>
<li><a href="relnotes/10.2.5.html">10.2.5 release notes</a>
<li><a href="relnotes/10.2.4.html">10.2.4 release notes</a>
<li><a href="relnotes/10.2.3.html">10.2.3 release notes</a>
<li><a href="relnotes/10.2.2.html">10.2.2 release notes</a>
<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.6.html">10.1.6 release notes</a>
<li><a href="relnotes/10.1.5.html">10.1.5 release notes</a>
<li><a href="relnotes/10.1.4.html">10.1.4 release notes</a>
<li><a href="relnotes/10.1.3.html">10.1.3 release notes</a>
<li><a href="relnotes/10.1.2.html">10.1.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>

179
docs/relnotes/10.1.2.html Normal file
View File

@@ -0,0 +1,179 @@
<!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.2 Release Notes / (May 5, 2014)</h1>
<p>
Mesa 10.1.2 is a bug fix release which fixes bugs found since the 10.1.1 release.
</p>
<p>
Mesa 10.1.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>
37d79f94b1f41852a89d1fc3900bea76 MesaLib-10.1.2.tar.gz
28b60d15ac9f364da1e0155911eaf44e MesaLib-10.1.2.tar.bz2
05300039085a65fc53c5472c4bb5747a MesaLib-10.1.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=27499">Bug 27499</a> - [855GM i915] GL_LINE_STIPPLE displays incorrect colors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75723">Bug 75723</a> - (regression since Linux 3.14?) brw_get_graphics_reset_status: Assertion `brw-&gt;hw_ctx != ((void *)0)' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76894">Bug 76894</a> - Piglit/spec/EXT_framebuffer_object/fbo-bind-renderbuffer failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77702">Bug 77702</a> - [i965 Bisected]Piglit spec/NV_conditional_render_blitframebuffer fails</li>
</ul>
<h2>Changes</h2>
<p>Ander Conselvan de Oliveira (2):</p>
<ul>
<li>gbm/dri: Fix out-of-memory error path in dri_device_create()</li>
<li>egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM</li>
</ul>
<p>Anuj Phogat (27):</p>
<ul>
<li>mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)</li>
<li>swrast: Add glBlitFramebuffer to commands affected by conditional rendering</li>
<li>mesa: Fix error condition for multisample proxy texture targets</li>
<li>i965: Put an assertion to check valid varying_to_slot[varying]</li>
<li>i965: Fix component mask and varying_to_slot mapping for gl_Layer</li>
<li>i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex</li>
<li>mesa: Add helper function _mesa_is_format_integer()</li>
<li>mesa: Add error condition for integer formats in glGetTexImage()</li>
<li>mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()</li>
<li>mesa: Fix error code generation in glReadPixels()</li>
<li>glsl: Allow overlapping locations for vertex input attributes</li>
<li>mesa: Fix querying location of nth element of an array variable</li>
<li>mesa: Use location VERT_ATTRIB_GENERIC0 for vertex attribute 0</li>
<li>glsl: Compile error if fs defines conflicting qualifiers for gl_FragCoord</li>
<li>glsl: Compile error if fs uses gl_FragCoord before first redeclaration</li>
<li>mesa: Add entry for extension ARB_texture_stencil8</li>
<li>mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()</li>
<li>i965: Fix crash in do_blit_readpixels()</li>
<li>mesa: Add missing types in _mesa_texstore_xx_xx() functions</li>
<li>mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions</li>
<li>mesa: Add new helper function _mesa_unpack_depth_stencil_row()</li>
<li>mesa: Add support to unpack depth-stencil texture in to FLOAT_32_UNSIGNED_INT_24_8_REV</li>
<li>mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()</li>
<li>i965: Add glBlitFramebuffer to commands affected by conditional rendering</li>
<li>glsl: Use switch to allow adding more shader types</li>
<li>glsl: Link error if fs defines conflicting qualifiers for gl_FragCoord</li>
<li>glsl: Apply the link error conditions to GL_ARB_fragment_coord_conventions</li>
</ul>
<p>Benjamin Bellec (1):</p>
<ul>
<li>mesa: fix GetStringi error message with correct function name</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>swrast: allocate swrast_texture_image::ImageSlices array if needed</li>
</ul>
<p>Carl Worth (4):</p>
<ul>
<li>docs: Add the MD5 sums for the 10.1.1 release tar files.</li>
<li>cherry-ignore: Ignore a patch causing a regression</li>
<li>cherry-ignore: Drop an ignored patch now that piglit has been updated.</li>
<li>Update VERSION to 10.1.2</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>glsl: Only allow `invariant` on shader in/out between stages.</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix render-to-texture in non-FinishRenderTexture cases.</li>
</ul>
<p>Ian Romanick (1):</p>
<ul>
<li>dri3: Enable GLX_MESA_query_renderer on DRI3 too</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Don't enable reset notification support on Gen4-5.</li>
<li>i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.</li>
</ul>
<p>Marek Olšák (10):</p>
<ul>
<li>r300g: don't crash when getting NULL colorbuffers</li>
<li>st/mesa: remove trailing NULL colorbuffers</li>
<li>r600g: fix edge flags and layered rendering on R600-R700</li>
<li>r600g: disable async DMA on R700</li>
<li>r600g: fix MSAA resolve on R6xx when the destination is 1D-tiled</li>
<li>r600g: fix flushing on RV670, RS780, RS880 again</li>
<li>r600g: fix buffer copying on R600-R700</li>
<li>r600g: fix for broken CULL_FRONT behavior on R6xx</li>
<li>r600g: fix for an MSAA hang on RV770</li>
<li>r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC</li>
</ul>
<p>Michel Dänzer (2):</p>
<ul>
<li>r600g: Disable LLVM by default at runtime for graphics</li>
<li>st/mesa: Fix NULL pointer dereference for incomplete framebuffers</li>
</ul>
<p>Neil Roberts (1):</p>
<ul>
<li>wayland: Fix the logic in disabling the prime capability</li>
</ul>
<p>Samuel Iglesias Gonsalvez (1):</p>
<ul>
<li>mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Cache render target surface</li>
</ul>
<p>nick (1):</p>
<ul>
<li>swrast: Fix vertex color in _swsetup_Translate()</li>
</ul>
</div>
</body>
</html>

90
docs/relnotes/10.1.3.html Normal file
View File

@@ -0,0 +1,90 @@
<!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.3 Release Notes / (May 9, 2014)</h1>
<p>
Mesa 10.1.3 is a bug fix release which fixes bugs found since the 10.1.2 release.
</p>
<p>
Note: Mesa 10.1.3 is being released sooner than originally scheduled to make
available a fix for a performance rgression that was inadvertently introduced
to Mesa 10.1.2. The performance regression is reported to make vmware
swapbuffers fall back to software.
</p>
<p>
Mesa 10.1.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>MD5 checksums</h2>
<pre>
665fe1656aaa2c37b32042068aff92cb MesaLib-10.1.3.tar.gz
ba6dbe2b9cab0b4de840c996b9b6a3ad MesaLib-10.1.3.tar.bz2
4e6f26330a63d3c47e62ac4bdead39e8 MesaLib-10.1.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=77245">Bug 77245</a> - Bogus GL_ARB_explicit_attrib_location layout identifier warnings</li>
</ul>
<h2>Changes</h2>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add MD5 sums for Mesa 10.1.2</li>
<li>get-pick-list.sh: Require explicit "10.1" for nominating stable patches</li>
<li>VERSION: Update to 10.1.3</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>mesa: Fix MaxNumLayers for 1D array textures.</li>
<li>i965: Fix depth (array slices) computation for 1D_ARRAY render targets.</li>
</ul>
<p>Tapani Pälli (1):</p>
<ul>
<li>glsl: fix bogus layout qualifier warnings</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Fix performance regression introduced by commit "Cache render target surface"</li>
</ul>
</div>
</body>
</html>

100
docs/relnotes/10.1.4.html Normal file
View File

@@ -0,0 +1,100 @@
<!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.4 Release Notes / (May 20, 2014)</h1>
<p>
Mesa 10.1.4 is a bug fix release which fixes bugs found since the 10.1.3 release.
</p>
<p>
Mesa 10.1.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>MD5 checksums</h2>
<pre>
e934365d77f384bfaec844999440bef8 MesaLib-10.1.4.tar.gz
6fddee101f49b7409cd29994c34ddee7 MesaLib-10.1.4.tar.bz2
ba5f48e7d5e373922c804c2651fec6c1 MesaLib-10.1.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=78225">Bug 78225</a> - Compile error due to undefined reference to `gbm_dri_backend', fix attached</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78537">Bug 78537</a> - no anisotropic filtering in a native Half-Life 2</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix double-freeing of dispatch tables inside glBegin/End.</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add MD5 sums for 10.1.3</li>
<li>cherry-ignore: Roland and Michel agreed to drop these patches.</li>
<li>VERSION: Update to 10.1.4</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>configure: error out if building GBM without dri</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/vs: Use samplers for UBOs in the VS like we do for non-UBO pulls.</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>nv50/ir: make sure to reverse cond codes on all the OP_SET variants</li>
<li>nv50: fix setting of texture ms info to be per-stage</li>
<li>nv50/ir: fix integer mul lowering for u32 x u32 -&gt; high u32</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Fix anisotropic filtering state setup</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>configure.ac: Add LLVM_VERSION_PATCH to DEFINES</li>
<li>radeonsi: Enable geometry shaders with LLVM 3.4.1</li>
</ul>
</div>
</body>
</html>

105
docs/relnotes/10.1.5.html Normal file
View File

@@ -0,0 +1,105 @@
<!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.5 Release Notes / (June 6, 2014)</h1>
<p>
Mesa 10.1.5 is a bug fix release which fixes bugs found since the 10.1.4 release.
</p>
<p>
Mesa 10.1.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>
b0aceaa75bc9a9b2d9215a113e2ad488b5cf85c99005a7624f8cf7c37c5d0eaa MesaLib-10.1.5.tar.gz
bc6c5ec7836f254a49d055a29d9aa34c97c54c038f47ad3a00fa57a5fef15bbc MesaLib-10.1.5.tar.bz2
78b7255cab0af7918945452a84de7989096ebcdd27e99b31c56c0589274cbc77 MesaLib-10.1.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=79115">Bug 79115</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79421">Bug 79421</a> - </li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>glsl: fix use-after free bug/crash in ast_declarator_list::hir()</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>docs: Add md5sums for 10.1.4 release</li>
<li>Merge remote-tracking branch 'origin/10.1' into 10.1</li>
<li>cherry-ignore: Ignore two commits.</li>
<li>Ignore a patch that is not needed for the 10.1 branch.</li>
<li>Update version to 10.1.5</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>glx: do not leak dri3Display</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv50/ir: fix s32 x s32 -&gt; high s32 multiply logic</li>
<li>nv50/ir: fix constant folding for OP_MUL subop HIGH</li>
</ul>
<p>James Legg (1):</p>
<ul>
<li>mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT</li>
</ul>
<p>Jeremy Huddleston Sequoia (2):</p>
<ul>
<li>glapi: Avoid heap corruption in _glapi_table</li>
<li>darwin: Fix test for kCGLPFAOpenGLProfile support at runtime</li>
</ul>
<p>Pavel Popov (2):</p>
<ul>
<li>i965: Properly return *RESET* status in glGetGraphicsResetStatusARB</li>
<li>i965: Fix Line Stipple enable bit in 3DSTATE_SF for Haswell.</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>llvmpipe: fix crash when not all attachments are populated in a fb</li>
</ul>
</div>
</body>
</html>

138
docs/relnotes/10.1.6.html Normal file
View File

@@ -0,0 +1,138 @@
<!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.6 Release Notes / (June 24, 2014)</h1>
<p>
Mesa 10.1.6 is a bug fix release which fixes bugs found since the 10.1.5 release.
</p>
<p>
Mesa 10.1.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>
cde60e06b340d7598802fe4a4484b3fb8befd714f9ab9caabe1f27d3149e8815 MesaLib-10.1.6.tar.bz2
e4e726d7805a442f7ed07d12f71335e6126796ec85328a5989eb5348a8042d00 MesaLib-10.1.6.tar.gz
bf7e3f721a7ad0c2057a034834b6fea688e64f26a66cf8d1caa2827e405e72dd MesaLib-10.1.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=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=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=78581">Bug 78581</a> - </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>
</ul>
<h2>Changes</h2>
<p>Adrian Negreanu (7):</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, mesa_gen_matypes: pull in timespec POSIX definition</li>
<li>android, dricore: undefined reference to _mesa_streaming_load_memcpy</li>
</ul>
<p>Beren Minor (1):</p>
<ul>
<li>egl/main: Fix eglMakeCurrent when releasing context from current thread.</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add SHA256 checksums for the 10.1.5 release</li>
<li>cherry-ignore: Add a patch to ignore</li>
<li>Update VERSION to 10.1.6</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 (1):</p>
<ul>
<li>configure: error out when building opencl without LLVM</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.</li>
</ul>
<p>José Fonseca (3):</p>
<ul>
<li>mesa/main: Make get_hash.c values constant.</li>
<li>mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.</li>
<li>mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).</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>Roland Scheidegger (1):</p>
<ul>
<li>draw: (trivial) fix clamping of viewport index</li>
</ul>
<p>Tobias Klausmann (1):</p>
<ul>
<li>nv50/ir: clear subop when folding constant expressions</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>
</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.2 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>

211
docs/relnotes/10.2.7.html Normal file
View File

@@ -0,0 +1,211 @@
<!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>
cb67dfaabf88acba29aa2cf0dd58ee17b21ebf9594f8d1226c41794da8de3e9d MesaLib-10.2.7.tar.gz
27b958063a4c002071f14ed45c7d2a1ee52cd85e4ac8876e8a1c273495a7d43f MesaLib-10.2.7.tar.bz2
a2796a2d5bbbc2edd22857ecc267cba68dfe5d0296f5d84ba7510877b216cc40 MesaLib-10.2.7.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=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>

130
docs/relnotes/10.2.8.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.8 Release Notes / September 19, 2014</h1>
<p>
Mesa 10.2.8 is a bug fix release which fixes bugs found since the 10.2.7 release.
</p>
<p>
Mesa 10.2.8 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>
4c5a25ccaf1a9734bbd10d62a1420cc8fd35a1060ce679f2fc846769a25fbeec MesaLib-10.2.8.tar.gz
1ef9ad3f241788d454f2ff8c9d65b6849dfc31c8fe91f70fd2930b81c8af1398 MesaLib-10.2.8.tar.bz2
d26218da3b44734b1d555267b4c63c48803c4c8b14d2bc53071be57014da37fa MesaLib-10.2.8.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=77493">Bug 77493</a> - lp_test_arit fails with llvm &gt;= llvm-3.5svn r206094</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82539">Bug 82539</a> - vmw_screen_dri.lo In file included from vmw_screen_dri.c:41: vmwgfx_drm.h:32:17: error: drm.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82882">Bug 82882</a> - [swrast] piglit glsl-fs-uniform-bool-1 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83432">Bug 83432</a> - r600_query.c:269:r600_emit_query_end: Assertion `ctx-&gt;num_pipelinestat_queries &gt; 0' failed [Gallium HUD]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83567">Bug 83567</a> - Mesa 10.2.6 does not compile with llvm 3.5</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83735">Bug 83735</a> - [mesa-10.2.x] broken with llvm-3.5 and old CPUs</li>
</ul>
<h2>Changes</h2>
<p>Aaron Watry (1):</p>
<ul>
<li>gallivm: Fix build after LLVM commit 211259</li>
</ul>
<p>Christoph Bumiller (2):</p>
<ul>
<li>nv50/ir/util: fix BitSet issues</li>
<li>nvc0/ir: clarify recursion fix to finding first tex uses</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>docs: Add sha256 sums for the 10.2.7 release</li>
<li>configure: bail out if building svga without libdrm</li>
<li>Update VERSION to 10.2.8</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nv50/ir: avoid array overrun when checking for supported mods</li>
<li>nouveau: only enable the depth test if there actually is a depth buffer</li>
<li>nouveau: only enable stencil func if the visual has stencil bits</li>
<li>nouveau: change internal variables to avoid conflicts with macro args</li>
</ul>
<p>Jonathan Gray (1):</p>
<ul>
<li>configure.ac: strip _GNU_SOURCE from llvm-config output</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>gallivm: Disable workaround for PR12833 on LLVM 3.2+.</li>
</ul>
<p>Maarten Lankhorst (4):</p>
<ul>
<li>nouveau: re-allocate bo's on overflow</li>
<li>nouveau: fix MPEG4 hw decoding</li>
<li>nouveau: rework reference frame handling</li>
<li>nouveau: remove unneeded assert</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>r600g,radeonsi: make sure there's enough CS space before resuming queries</li>
<li>mesa: set UniformBooleanTrue = 1.0f by default</li>
<li>st/mesa: use 1.0f as boolean true on drivers without integer support</li>
</ul>
<p>Richard Sandiford (1):</p>
<ul>
<li>gallivm: Fix uses of 2^24</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: set mcpu when initializing llvm execution engine</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>winsys/svga: Fix incorrect type usage in IOCTL v2</li>
</ul>
</div>
</body>
</html>

101
docs/relnotes/10.2.9.html Normal file
View File

@@ -0,0 +1,101 @@
<!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.9 Release Notes / October 12, 2014</h1>
<p>
Mesa 10.2.9 is a bug fix release which fixes bugs found since the 10.2.8 release.
This is the final planned release for the 10.2 branch.
</p>
<p>
Mesa 10.2.9 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>
f8d62857eed8f604a57710c58a8ffcfb8dab2dc4977ec27c956c7c4fd14032f6 MesaLib-10.2.9.tar.gz
f6031f8b7113a92325b60635c504c510490eebb2e707119bbff7bd86aa34657d MesaLib-10.2.9.tar.bz2
11c0ef4f3308fc29d9f15a77fd8f4842a946fce9e830250a1c95b171a446171a MesaLib-10.2.9.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=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">Bug 83570</a> - Glyphy demo throws unhandled Integer division by zero exception</li>
</ul>
<h2>Changes</h2>
<p>Andreas Pokorny (2):</p>
<ul>
<li>egl/drm: expose KHR_image_pixmap extension</li>
<li>i915: Fix black buffers when importing prime fds</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.2.8 release</li>
<li>Update VERSION to 10.2.9</li>
</ul>
<p>Ilia Mirkin (1):</p>
<ul>
<li>nv50/ir: avoid deleting pseudo instructions too early</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>radeonsi: release GS rings at context destruction</li>
<li>radeonsi: properly destroy the GS copy shader and scratch_bo for compute</li>
<li>st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix idiv</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Fix regression in xa_yuv_planar_blit()</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>configure.ac: Compute LLVM_VERSION_PATCH using llvm-config</li>
</ul>
<p>rconde (1):</p>
<ul>
<li>gallivm,tgsi: fix idiv by zero crash</li>
</ul>
</div>
</body>
</html>

View File

@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.2 Release Notes / TBD</h1>
<h1>Mesa 10.2 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2 is a new development release.
@@ -33,7 +33,9 @@ because compatibility contexts are not supported.
<h2>MD5 checksums</h2>
<pre>
TBD.
c87bfb6dd5cbcf1fdef42e5ccd972581 MesaLib-10.2.0.tar.gz
7aaba90bd7169a94ae2fe83febdec963 MesaLib-10.2.0.tar.bz2
58b203aca15dadc25ab4d1126db1052b MesaLib-10.2.0.zip
</pre>
@@ -67,6 +69,27 @@ 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>
<li>The environment variable GALLIUM_MSAA that forced a multisample GLX visual was removed.</li>
</ul>
</div>

158
docs/relnotes/10.3.1.html Normal file
View File

@@ -0,0 +1,158 @@
<!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.3.1 Release Notes / October 12, 2014</h1>
<p>
Mesa 10.3.1 is a bug fix release which fixes bugs found since the 10.3 release.
</p>
<p>
Mesa 10.3.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>SHA256 checksums</h2>
<pre>
155afcbad17be8bb80282c761b957d5cc716c14a1fa16c4f5ee04e76df729c6d MesaLib-10.3.1.tar.gz
b081d077d717e5d56f2d59677490856052c41573e50378ff86d6c72456714add MesaLib-10.3.1.tar.bz2
07a14febfed06412d519e091a62d24513fee6745f1a6f8a8f1956bfe04b77d15 MesaLib-10.3.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=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83506">Bug 83506</a> - [UBO] row_major layout ignored inside structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83533">Bug 83533</a> - [UBO] nested structures don't get appropriate padding</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">Bug 83570</a> - Glyphy demo throws unhandled Integer division by zero exception</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83741">Bug 83741</a> - [UBO] row_major layout partially ignored for arrays of structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84178">Bug 84178</a> - Big glamor regression in Xorg server 1.6.99.1 GIT: x11perf 1.5 Test: PutImage XY 500x500 Square</li>
</ul>
<h2>Changes</h2>
<p>Andreas Pokorny (2):</p>
<ul>
<li>egl/drm: expose KHR_image_pixmap extension</li>
<li>i915: Fix black buffers when importing prime fds</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix prog_optimize.c assertions triggered by SWZ opcode</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add 10.3 sha256 sums, news item and link release notes</li>
<li>Update VERSION to 10.3.1</li>
</ul>
<p>Ian Romanick (4):</p>
<ul>
<li>glsl: Make sure fields after small structs have correct padding</li>
<li>glsl: Make sure row-major array-of-structure get correct layout</li>
<li>glsl: Round struct size up to at least 16 bytes</li>
<li>glsl: Strip arrayness from ir_type_dereference_variable too</li>
</ul>
<p>Ilia Mirkin (5):</p>
<ul>
<li>nv50/ir: avoid deleting pseudo instructions too early</li>
<li>gm107/ir: fix manual TXD for array targets</li>
<li>gm107/ir: fix texture argument order</li>
<li>gm107/ir: add support for indirect const buffer selection</li>
<li>gm107/ir: take relative pfetch offset into account</li>
</ul>
<p>Keith Packard (1):</p>
<ul>
<li>glx/dri3: Provide error diagnostics when DRI3 allocation fails</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).</li>
<li>mesa: Set correct array element in vbo_exec_vtx_init.</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>radeonsi: release GS rings at context destruction</li>
<li>radeonsi: properly destroy the GS copy shader and scratch_bo for compute</li>
<li>st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers</li>
</ul>
<p>Richard Sandiford (2):</p>
<ul>
<li>mesa: Fix alpha component in unpack_R8G8B8X8_SRGB.</li>
<li>swrast: Fix handling of MESA_FORMAT_L8A8_SRGB for big-endian</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix idiv</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Fix regression in xa_yuv_planar_blit()</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>clover: Add support to mem objects for multiple destructor callbacks v2</li>
<li>configure.ac: Compute LLVM_VERSION_PATCH using llvm-config</li>
</ul>
<p>Tomasz Figa (3):</p>
<ul>
<li>util: Include in Android builds</li>
<li>st/mesa: Generate format_info.c in Android builds</li>
<li>st/mesa: Fix paths used in Android builds</li>
</ul>
<p>rconde (1):</p>
<ul>
<li>gallivm,tgsi: fix idiv by zero crash</li>
</ul>
</div>
</body>
</html>

115
docs/relnotes/10.3.2.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 10.3.2 Release Notes / October 24, 2014</h1>
<p>
Mesa 10.3.2 is a bug fix release which fixes bugs found since the 10.3 release.
</p>
<p>
Mesa 10.3.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>
e65f8e691f06f111c1aeb3a376b13c9cc88cb162bee2709e0e7e6b0e6628ca75 MesaLib-10.3.2.tar.gz
e9849bcb9aa9acd98a753d6d46d2e7d7238d3367036e11357a60efd16de8bea3 MesaLib-10.3.2.tar.bz2
427dc0d670d38e713ebff2675665ec2fe4ff7d04ce227bd54de946999fc1d234 MesaLib-10.3.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=81680">Bug 81680</a> - [r600g] Firefox crashes with hardware acceleration turned on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84140">Bug 84140</a> - mplayer crashes playing some files using vdpau output</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84662">Bug 84662</a> - Long pauses with Unreal demo Elemental on R9270X since : Always flush the HDP cache before submitting a CS to the GPU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85267">Bug 85267</a> - vlc crashes with vdpau (Radeon 3850HD) [r600]</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix spurious wglGetProcAddress / GL_INVALID_OPERATION error</li>
<li>st/wgl: add WINAPI qualifiers on wgl function typedefs</li>
<li>glsl: fix several use-after-free bugs</li>
</ul>
<p>Daniel Manjarres (1):</p>
<ul>
<li>glx: Fix glxUseXFont for glxWindow and glxPixmaps</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>mesa: fix GetTexImage for 1D array depth textures</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.1 release</li>
<li>Update VERSION to 10.3.2</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>gm107/ir: add dnz emission for fmul</li>
<li>gk110/ir: add dnz flag emission for fmul/fmad</li>
<li>nouveau: 3d textures are unsupported, limit 3d levels to 1</li>
<li>st/gbm: fix order of arguments passed to is_format_supported</li>
</ul>
<p>Kenneth Graunke (3):</p>
<ul>
<li>i965: Add a BRW_MOCS_PTE #define.</li>
<li>i965: Use BDW_MOCS_PTE for renderbuffers.</li>
<li>i965: Fix register write checks.</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>st/mesa: use pipe_sampler_view_release for releasing sampler views</li>
<li>glsl_to_tgsi: fix the value of gl_FrontFacing with native integers</li>
</ul>
<p>Michel Dänzer (4):</p>
<ul>
<li>radeonsi: Clear sampler view flags when binding a buffer</li>
<li>r600g,radeonsi: Always use GTT again for PIPE_USAGE_STREAM buffers</li>
<li>winsys/radeon: Use separate caching buffer manager for each set of flags</li>
<li>r600g: Drop references to destroyed blend state</li>
</ul>
</div>
</body>
</html>

209
docs/relnotes/10.3.3.html Normal file
View File

@@ -0,0 +1,209 @@
<!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.3.3 Release Notes / November 8, 2014</h1>
<p>
Mesa 10.3.3 is a bug fix release which fixes bugs found since the 10.3.2 release.
</p>
<p>
Mesa 10.3.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>
23a0c36d88cd5d8968ae6454160de2878192fd1d37b5d606adca1f1b7e788b79 MesaLib-10.3.3.tar.gz
0e4eee4a2ddf86456eed2fc44da367f95471f74249636710491e85cc256c4753 MesaLib-10.3.3.tar.bz2
a83648f17d776b7cf6c813fbb15782d2644b937dc6a7c53d8c0d1b35411f4840 MesaLib-10.3.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=70410">Bug 70410</a> - egl-static/Makefile: linking fails with llvm &gt;= 3.4</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82921">Bug 82921</a> - layout(location=0) emits error &gt;= MAX_UNIFORM_LOCATIONS due to integer underflow</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83574">Bug 83574</a> - [llvmpipe] [softpipe] piglit arb_explicit_uniform_location-use-of-unused-loc regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85454">Bug 85454</a> - Unigine Sanctuary with Wine crashes on Mesa Git</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85918">Bug 85918</a> - Mesa: MSVC 2010/2012 Compile error</li>
</ul>
<h2>Changes</h2>
<p>Anuj Phogat (2):</p>
<ul>
<li>glsl: Fix crash due to negative array index</li>
<li>glsl: Use signed array index in update_max_array_access()</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.2 release</li>
<li>Update version to 10.3.3</li>
</ul>
<p>Ilia Mirkin (27):</p>
<ul>
<li>freedreno/ir3: fix FSLT/etc handling to return 0/-1 instead of 0/1.0</li>
<li>freedreno/ir3: INEG operates on src0, not src1</li>
<li>freedreno/ir3: add UARL support</li>
<li>freedreno/ir3: negate result of USLT/etc</li>
<li>freedreno/ir3: use unsigned comparison for UIF</li>
<li>freedreno/ir3: add TXL support</li>
<li>freedreno/ir3: fix UCMP handling</li>
<li>freedreno/ir3: implement UMUL correctly</li>
<li>freedreno: add default .dir-locals.el for emacs settings</li>
<li>freedreno/ir3: make texture instruction construction more dynamic</li>
<li>freedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument</li>
<li>freedreno/ir3: add TXQ support</li>
<li>freedreno/ir3: add TXB2 support</li>
<li>freedreno: dual-source render targets are not supported</li>
<li>freedreno: instanced drawing/compute not yet supported</li>
<li>freedreno/ir3: avoid fan-in sources referring to same instruction</li>
<li>freedreno/ir3: add IDIV/UDIV support</li>
<li>freedreno/ir3: add UMOD support, based on UDIV</li>
<li>freedreno/ir3: add MOD support</li>
<li>freedreno/ir3: add ISSG support</li>
<li>freedreno/ir3: add UMAD support</li>
<li>freedreno/ir3: make TXQ return integers, not floats</li>
<li>freedreno/ir3: shadow comes before array</li>
<li>freedreno/ir3: add texture offset support</li>
<li>freedreno/ir3: add TXD support and expose ARB_shader_texture_lod</li>
<li>freedreno/ir3: add TXF support</li>
<li>freedreno: positions come out as integers, not half-integers</li>
</ul>
<p>Jan Vesely (1):</p>
<ul>
<li>configure: include llvm systemlibs when using static llvm</li>
</ul>
<p>Marek Olšák (5):</p>
<ul>
<li>r600g: fix polygon mode for points and lines and point/line fill modes</li>
<li>radeonsi: fix polygon mode for points and lines and point/line fill modes</li>
<li>radeonsi: fix incorrect index buffer max size for lowered 8-bit indices</li>
<li>Revert "st/mesa: set MaxUnrollIterations = 255"</li>
<li>r300g: remove enabled/disabled hyperz and AA compression messages</li>
</ul>
<p>Mauro Rossi (1):</p>
<ul>
<li>gallium/nouveau: fully build the driver under android</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeon/llvm: Dynamically allocate branch/loop stack arrays</li>
</ul>
<p>Rob Clark (62):</p>
<ul>
<li>freedreno/ir3: detect scheduler fail</li>
<li>freedreno/ir3: add TXB</li>
<li>freedreno/ir3: add DDX/DDY</li>
<li>freedreno/ir3: bit of debug</li>
<li>freedreno/ir3: fix error in bail logic</li>
<li>freedreno/ir3: fix constlen with relative addressing</li>
<li>freedreno/ir3: add no-copy-propagate fallback step</li>
<li>freedreno: don't overflow cmdstream buffer so much</li>
<li>freedreno/ir3: fix potential segfault in RA</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: enable hw primitive-restart</li>
<li>freedreno/a3xx: handle rendering to layer != 0</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: format fixes</li>
<li>util/u_format: add _is_alpha()</li>
<li>freedreno/a3xx: alpha render-target shenanigans</li>
<li>freedreno/ir3: catch incorrect usage of tmp-dst</li>
<li>freedreno/ir3: add missing put_dst</li>
<li>freedreno: "fix" problems with excessive flushes</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: 3d/array textures</li>
<li>freedreno: add DRM_CONF_SHARE_FD</li>
<li>freedreno/a3xx: more texture array fixes</li>
<li>freedreno/a3xx: initial texture border-color</li>
<li>freedreno: fix compiler warning</li>
<li>freedreno: don't advertise mirror-clamp support</li>
<li>freedreno: update generated headers</li>
<li>freedreno: we have more than 0 viewports!</li>
<li>freedreno: turn missing caps into compile warnings</li>
<li>freedreno/a3xx: add LOD_BIAS</li>
<li>freedreno/a3xx: add flat interpolation mode</li>
<li>freedreno/a3xx: add 32bit integer vtx formats</li>
<li>freedreno/a3xx: fix border color order</li>
<li>freedreno: move bind_sampler_states to per-generation</li>
<li>freedreno: add texcoord clamp support to lowering</li>
<li>freedreno/a3xx: add support to emulate GL_CLAMP</li>
<li>freedreno/a3xx: re-emit shaders on variant change</li>
<li>freedreno/lowering: fix token calculation for lowering</li>
<li>freedreno: destroy transfer pool after blitter</li>
<li>freedreno: max-texture-lod-bias should be 15.0f</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: handle large shader program sizes</li>
<li>freedreno/a3xx: emit all immediates in one shot</li>
<li>freedreno/ir3: fix lockups with lame FRAG shaders</li>
<li>freedreno/a3xx: handle VS only outputting BCOLOR</li>
<li>freedreno: query fixes</li>
<li>freedreno/a3xx: refactor vertex state emit</li>
<li>freedreno/a3xx: refactor/optimize emit</li>
<li>freedreno/ir3: optimize shader key comparision</li>
<li>freedreno: inline fd_draw_emit()</li>
<li>freedreno: fix layer_stride</li>
<li>freedreno: update generated headers</li>
<li>freedreno/ir3: large const support</li>
<li>freedreno/a3xx: more layer/level fixes</li>
<li>freedreno/ir3: comment + better fxn name</li>
<li>freedreno/ir3: fix potential gpu lockup with kill</li>
<li>freedreno/a3xx: disable early-z when we have kill's</li>
<li>freedreno/ir3: add debug flag to disable cp</li>
<li>freedreno: clear vs scissor</li>
<li>freedreno: mark scissor state dirty when enable bit changes</li>
<li>freedreno/a3xx: fix viewport state during clear</li>
<li>freedreno/a3xx: fix depth/stencil restore format</li>
</ul>
<p>Tapani Pälli (2):</p>
<ul>
<li>glsl: fix uniform location count used for glsl types</li>
<li>mesa: check that uniform exists in glUniform* functions</li>
</ul>
</div>
</body>
</html>

335
docs/relnotes/10.3.html Normal file
View File

@@ -0,0 +1,335 @@
<!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.3 Release Notes / September 19, 2014</h1>
<p>
Mesa 10.3 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.3.1.
</p>
<p>
Mesa 10.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>
9a1bf52040fc3dda81e83a35f944f1c3f532847dbe9fdf57161265cf71ea1bae MesaLib-10.3.0.tar.gz
0283bfe710fa449ed82e465cfa09612a269e19abb7e0382082608062ce7960b5 MesaLib-10.3.0.tar.bz2
221420763c2c3a244836a736e735612c4a6a0377b4e5223fca1e612f49906789 MesaLib-10.3.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_ES3_compatibility on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe</li>
<li>GL_ARB_clear_texture on i965</li>
<li>GL_ARB_compressed_texture_pixel_storage on all drivers</li>
<li>GL_ARB_conditional_render_inverted on i965, nvc0, softpipe, llvmpipe</li>
<li>GL_ARB_derivative_control on i965, nv50, nvc0, r600</li>
<li>GL_ARB_draw_indirect on nvc0, radeonsi</li>
<li>GL_ARB_explicit_uniform_location (all drivers that support GLSL)</li>
<li>GL_ARB_fragment_layer_viewport on nv50, nvc0, llvmpipe, r600</li>
<li>GL_ARB_gpu_shader5 on i965/gen7, nvc0</li>
<li>GL_ARB_multi_draw_indirect on nvc0, radeonsi</li>
<li>GL_ARB_sample_shading on radeonsi</li>
<li>GL_ARB_seamless_cubemap_per_texture on i965, llvmpipe, nvc0, r600, radeonsi, softpipe</li>
<li>GL_ARB_stencil_texturing on nv50, nvc0, r600, and radeonsi</li>
<li>GL_ARB_texture_barrier on nv50, nvc0, r300, r600, radeonsi</li>
<li>GL_ARB_texture_compression_bptc on i965/gen7+, nvc0, r600/evergreen+, radeonsi</li>
<li>GL_ARB_texture_cube_map_array on radeonsi</li>
<li>GL_ARB_texture_gather on r600, radeonsi</li>
<li>GL_ARB_texture_query_levels on nv50, nvc0, llvmpipe, r600, radeonsi, softpipe</li>
<li>GL_ARB_texture_query_lod on r600, radeonsi</li>
<li>GL_ARB_viewport_array on nvc0</li>
<li>GL_AMD_vertex_shader_viewport_index on i965/gen7+, r600</li>
<li>GL_OES_compressed_ETC1_RGB8_texture on nv30, nv50, nvc0, r300, r600, radeonsi, softpipe, llvmpipe</li>
<li>GLX_MESA_query_renderer on nv30, nv50, nvc0, r300, r600, radeonsi, softpipe, llvmpipe</li>
<li>A new software rasterizer driver (kms_swrast_dri.so) that works with
DRM drivers that don't have a full-fledged GEM (such as qxl or simpledrm)</li>
<li>Distribute the Khronos GL/glcorearb.h header file.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50754">Bug 50754</a> - Building 32 bit mesa on 64 bit OS fails since change for automake</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53617">Bug 53617</a> - [llvmpipe] piglit fbo-depthtex regression</li>
<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=56127">Bug 56127</a> - [ILK bisected]unigine-sanctruary performance reduced by 98%</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=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=68365">Bug 68365</a> - [SNB Bisected]Piglit spec_ARB_framebuffer_object_fbo-blit-stretch fail</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=73846">Bug 73846</a> - [llvmpipe] lp_test_format fails with llvm-3.5svn &gt;= r199602</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=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=75010">Bug 75010</a> - clang: error: unknown argument: '-fstack-protector-strong'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75478">Bug 75478</a> - [BDW]Some Piglit and Ogles2conform cases cause GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75664">Bug 75664</a> - Unigine Valley &amp; Heaven &quot;error: syntax error, unexpected EXTENSION, expecting $end&quot; IVB HD4000</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75878">Bug 75878</a> - [BDW] GPU hang running Raytracer WebGL demo</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=76223">Bug 76223</a> - [radeonsi] luxmark segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76939">Bug 76939</a> - [BDW] GPU hang when running “Metro:Last Light “ /“Crusader Kings II”</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77245">Bug 77245</a> - Bogus GL_ARB_explicit_attrib_location layout identifier warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77493">Bug 77493</a> - lp_test_arit fails with llvm &gt;= llvm-3.5svn r206094</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77703">Bug 77703</a> - [ILK Bisected]Piglit glean_texCombine4 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77704">Bug 77704</a> - [IVB/HSW Bisected]Ogles3conform GL3Tests_shadow_shadow_execution_frag.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77705">Bug 77705</a> - [SNB/IVB/HSW/BYT/BDW Bisected]Ogles3conform GL3Tests/packed_pixels/packed_pixels_pixelstore.test segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77707">Bug 77707</a> - [ILK Bisected]Ogles2conform GL_sin_sin_float_frag_xvary.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77740">Bug 77740</a> - i965: Relax accumulator dependency scheduling on Gen &lt; 6</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77852">Bug 77852</a> - [BDW]Piglit spec_ARB_framebuffer_object_fbo-drawbuffers-none_glBlitFramebuffer fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77856">Bug 77856</a> - [BDW]Piglit spec_OpenGL_3.0_clearbuffer-mixed-format 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=78225">Bug 78225</a> - Compile error due to undefined reference to `gbm_dri_backend', fix attached</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78258">Bug 78258</a> - make check link_varyings.gl_ClipDistance failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78403">Bug 78403</a> - query_renderer_implementation_unittest.cpp:144:4: error: expected primary-expression before . token</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78468">Bug 78468</a> - Compiling of shader gets stuck in infinite loop</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78537">Bug 78537</a> - no anisotropic filtering in a native Half-Life 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78546">Bug 78546</a> - [swrast] piglit copyteximage-border regression</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=78648">Bug 78648</a> - Texture artifacts in Kerbal Space Program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78665">Bug 78665</a> - macros in builtin_functions.cpp make invalid assumptions about M_PI definitions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78679">Bug 78679</a> - Gen4-5 code lost: runtime_check_aads_emit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78691">Bug 78691</a> - [G45 - Tesseract] Mesa 10.1.2 implementation error: Unsupported opcode 169872468 in FS</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78692">Bug 78692</a> - Football Manager 2014, gameplay rendered black &amp; white</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78716">Bug 78716</a> - Fix Mesa bugs for running Unreal Engine 4.1 Cave effects demo compiled for Linux</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78803">Bug 78803</a> - gallivm/lp_bld_debug.cpp:42:28: fatal error: llvm/IR/Module.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78842">Bug 78842</a> - [swrast] piglit fcc-read-after-clear copy rb regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78843">Bug 78843</a> - [swrast] piglit copyteximage 1D regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78872">Bug 78872</a> - [ILK Bisected]Piglit spec_ARB_depth_buffer_float_fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit Aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78875">Bug 78875</a> - [ILK Bisected]Webglc conformance/uniforms/uniform-default-values.html fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78888">Bug 78888</a> - test_eu_compact.c:54:3: error: implicit declaration of function brw_disasm [-Werror=implicit-function-declaration]</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=79095">Bug 79095</a> - x86/common_x86.c:348:14: error: use of undeclared identifier 'bit_SSE4_1'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79115">Bug 79115</a> - glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0) doesn't unbind stencil buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79263">Bug 79263</a> - Linking error in egl_gallium.la when compiling 32 bit on multiarch</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79294">Bug 79294</a> - Xlib-based build broken on non x86/x86-64 architectures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79373">Bug 79373</a> - Non-const initializers for matrix and vector constructors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79382">Bug 79382</a> - build error: multiple definition of `loader_get_pci_id_for_fd'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79421">Bug 79421</a> - [llvmpipe] SIGSEGV src/gallium/drivers/llvmpipe/lp_rast_priv.h:218</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79440">Bug 79440</a> - prog_hash_table.c:146: undefined reference to `_mesa_error_no_memory'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79469">Bug 79469</a> - Commit e3cc0d90e14e62a0a787b6c07a6df0f5c84039be breaks unigine heaven</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79534">Bug 79534</a> - gen&lt;7 renders garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79616">Bug 79616</a> - L4D2 crash on startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79724">Bug 79724</a> - switch statement type check</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=79809">Bug 79809</a> - radeonsi: mouse cursor corruption using weston on AMD Kaveri</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79823">Bug 79823</a> - [NV30/gallium] Mozilla apps freeze on startup with nouveau-dri-10.2.1 libs on dual-screen</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79885">Bug 79885</a> - commit b52a530 (gallium/egl: st_profiles are build time decision, treat them as such) broke egl</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79903">Bug 79903</a> - [HSW Bisected]Some Piglit and Ogles2conform cases fail</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=79948">Bug 79948</a> - [i965] Incorrect pixels when using discard and uniform loads</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80015">Bug 80015</a> - Transparency glitches in native Civilization 5 (Civ5) port</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>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80211">Bug 80211</a> - [ILK/SNB Bisected]Piglit shaders_glsl-fs-copy-propagation-texcoords-1 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80247">Bug 80247</a> - Khronos conformance test ES3-CTS.gtf.GL3Tests.transform_feedback.transform_feedback_vertex_id fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80254">Bug 80254</a> - pipe_loader_sw.c:90: undefined reference to `dri_create_sw_winsys'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80541">Bug 80541</a> - [softpipe] piglit levelclamp regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80561">Bug 80561</a> - Incorrect implementation of some VDPAU APIs.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80614">Bug 80614</a> - [regression] Error in `omxregister-bellagio': munmap_chunk(): invalid pointer: 0x00007f5f76626dab</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80778">Bug 80778</a> - [bisected regression] piglit spec/glsl-1.50/compiler/incorrect-in-layout-qualifier-repeated-prim.geom</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80827">Bug 80827</a> - [radeonsi,R9 270X] Corruptions in window menus in KDE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80880">Bug 80880</a> - Unreal Engine 4 demos fail GLSL compiler assertion</li>
<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>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81020">Bug 81020</a> - [radeonsi][regresssion] Wireframe of background rendered through objects in Half-Life 2: Episode 2 with MSAA enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81150">Bug 81150</a> - [SNB]Piglit spec_arb_shading_language_packing_execution_built-in-functions_fs-packSnorm4x8 fails</li>
<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>
<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>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81828">Bug 81828</a> - [BDW Bisected]Ogles3conform GL3Tests_packed_pixels_packed_pixels_pbo.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81834">Bug 81834</a> - TGSI constant buffer overrun causes assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81857">Bug 81857</a> - [SNB+]Piglit spec_glsl-1.30_execution_switch_fs-default_last sporadically fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81967">Bug 81967</a> - [regression] Selections in Blender renders wrong</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=82159">Bug 82159</a> - No rule to make target `../../../../src/mesa/libmesa.la', needed by `collision'.</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=82268">Bug 82268</a> - Add support for the OpenRISC architecture (or1k)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82428">Bug 82428</a> - [radeonsi,R9 270X] System lockup when using mplayer/mpv with VDPAU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82472">Bug 82472</a> - piglit 16385-consecutive-chars regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82483">Bug 82483</a> - format_srgb.h:145: undefined reference to `util_format_srgb_to_linear_8unorm_table'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82517">Bug 82517</a> - [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82534">Bug 82534</a> - src\egl\main\eglapi.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2E02</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82536">Bug 82536</a> - u_current.h:72: undefined reference to `__imp__glapi_Dispatch'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82538">Bug 82538</a> - Super Maryo Chronicles fails with st/mesa assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82539">Bug 82539</a> - vmw_screen_dri.lo In file included from vmw_screen_dri.c:41: vmwgfx_drm.h:32:17: error: drm.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82546">Bug 82546</a> - [regression] libOSMesa build failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82574">Bug 82574</a> - GLSL: opt_vectorize goes wrong on texture lookups</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82628">Bug 82628</a> - bisected: GALLIUM_HUD hangs radeon 7970M (PRIME)</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=82796">Bug 82796</a> - [IVB/BYT-M/HSW/BDW Bisected]Synmark2_v6.0_OglTerrainFlyInst/OglTerrainPanInst cannot run as image validation failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82804">Bug 82804</a> - unreal engine 4 rendering errors</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=82828">Bug 82828</a> - Regression: Crash in 3Dmark2001</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82846">Bug 82846</a> - [BDW Bisected] Gpu hang when running Lightsmark v2008/Warsow v1.0/Xonotic v0.7/unigine-demos</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82881">Bug 82881</a> - test_vec4_register_coalesce regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82882">Bug 82882</a> - [swrast] piglit glsl-fs-uniform-bool-1 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82929">Bug 82929</a> - [BDW Bisected]glxgears causes X hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83046">Bug 83046</a> - [BDW bisected]] Warsow v1.0/Xonotic v0.7/Gputest v0.5_triangle_fullscreen/synmark2_v6/GLBenchmark v2.5.0/GLBenchmark v2.7.0/Ungine-demos performance reduced 30%~60%</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=83081">Bug 83081</a> - [BDW Bisected]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 is core dumped</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83127">Bug 83127</a> - [ILK Bisected]Piglit glean_texCombine fails</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>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83432">Bug 83432</a> - r600_query.c:269:r600_emit_query_end: Assertion `ctx-&gt;num_pipelinestat_queries &gt; 0' failed [Gallium HUD]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83468">Bug 83468</a> - [UBO] Using bool from UBO as if-statement condition asserts</li>
</ul>
<h2>Changes</h2>
<ul>
<li>Removed support for the GL_ATI_envmap_bumpmap extension</li>
<li>The hacky --enable-32/64-bit is no longer available in configure. To build
32/64 bit mesa refer to the default method recommended by your distribution</li>
</li>The environment variable GALLIUM_MSAA that forced a multisample GLX visual was removed.</li>
</ul>
</div>
</body>
</html>

97
docs/relnotes/10.4.1.html Normal file
View File

@@ -0,0 +1,97 @@
<!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.4.1 Release Notes / December 29, 2014</h1>
<p>
Mesa 10.4.1 is a bug fix release which fixes bugs found since the 10.4.0 release.
</p>
<p>
Mesa 10.4.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>SHA256 checksums</h2>
<pre>
5311285e791a6bfaa468ad002bd1e1164acb3eaa040b5a1bf958bdb7c27e0a9d MesaLib-10.4.1.tar.gz
91e8b71c8aff4cb92022a09a872b1c5d1ae5bfec8c6c84dbc4221333da5bf1ca MesaLib-10.4.1.tar.bz2
e09c8135f5a86ecb21182c6f8959aafd39ae2f98858fdf7c0e25df65b5abcdb8 MesaLib-10.4.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=82585">Bug 82585</a> - geometry shader with optional out variable segfaults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82991">Bug 82991</a> - Inverted bumpmap in webgl applications</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83908">Bug 83908</a> - [i965] Incorrect icon colors in Steam Big Picture</li>
</ul>
<h2>Changes</h2>
<p>Andres Gomez (1):</p>
<ul>
<li>i965/brw_reg: struct constructor now needs explicit negate and abs values.</li>
</ul>
<p>Cody Northrop (1):</p>
<ul>
<li>i965: Require pixel alignment for GPU copy blit</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>docs: Add 10.4 sha256 sums, news item and link release notes</li>
<li>Revert "glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)"</li>
<li>Update version to 10.4.1</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>linker: Wrap access of producer_var with a NULL check</li>
<li>linker: Assign varying locations geometry shader inputs for SSO</li>
</ul>
<p>Mario Kleiner (4):</p>
<ul>
<li>glx/dri3: Fix glXWaitForSbcOML() to handle targetSBC==0 correctly. (v2)</li>
<li>glx/dri3: Track separate (ust, msc) for PresentPixmap vs. PresentNotifyMsc (v2)</li>
<li>glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)</li>
<li>glx/dri3: Don't fail on glXSwapBuffersMscOML(dpy, window, 0, 0, 0) (v2)</li>
</ul>
<p>Maxence Le Doré (1):</p>
<ul>
<li>glsl: Add gl_MaxViewports to available builtin constants</li>
</ul>
</div>
</body>
</html>

127
docs/relnotes/10.4.2.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.4.2 Release Notes / January 12, 2015</h1>
<p>
Mesa 10.4.2 is a bug fix release which fixes bugs found since the 10.4.1 release.
</p>
<p>
Mesa 10.4.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>
e303e77dd774df0d051b2870b165f98c97084a55980f884731df89c1b56a6146 MesaLib-10.4.2.tar.gz
08a119937d9f2aa2f66dd5de97baffc2a6e675f549e40e699a31f5485d15327f MesaLib-10.4.2.tar.bz2
c2c2921a80a3395824f02bee4572a6a17d6a12a928a3e497618eeea04fb06490 MesaLib-10.4.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=85529">Bug 85529</a> - Surfaces not drawn in Unvanquished</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87619">Bug 87619</a> - Changes to state such as render targets change fragment shader without marking it dirty.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87658">Bug 87658</a> - [llvmpipe] SEGV in sse2_has_daz on ancient Pentium4-M</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87913">Bug 87913</a> - CPU cacheline size of 0 can be returned by CPUID leaf 0x80000006 in some virtual machines</li>
</ul>
<h2>Changes</h2>
<p>Chad Versace (2):</p>
<ul>
<li>i965: Use safer pointer arithmetic in intel_texsubimage_tiled_memcpy()</li>
<li>i965: Use safer pointer arithmetic in gather_oa_results()</li>
</ul>
<p>Dave Airlie (3):</p>
<ul>
<li>Revert "r600g/sb: fix issues cause by GLSL switching to loops for switch"</li>
<li>r600g: fix regression since UCMP change</li>
<li>r600g/sb: implement r600 gpr index workaround. (v3.1)</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.1 release</li>
<li>Update version to 10.4.2</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv50,nvc0: set vertex id base to index_bias</li>
<li>nv50/ir: fix texture offsets in release builds</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Add missing BRW_NEW_*_PROG_DATA to texture/renderbuffer atoms.</li>
<li>i965: Fix start/base_vertex_location for &gt;1 prims but !BRW_NEW_VERTICES.</li>
</ul>
<p>Leonid Shatz (1):</p>
<ul>
<li>gallium/util: make sure cache line size is not zero</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>glsl_to_tgsi: fix a bug in copy propagation</li>
<li>vbo: ignore primitive restart if FixedIndex is enabled in DrawArrays</li>
<li>st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEX</li>
<li>radeonsi: fix VertexID for OpenGL</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallium/util: fix crash with daz detection on x86</li>
</ul>
<p>Tiziano Bacocco (1):</p>
<ul>
<li>nv50,nvc0: implement half_pixel_center</li>
</ul>
<p>Vadim Girlin (1):</p>
<ul>
<li>r600g/sb: fix issues with loops created for switch</li>
</ul>
</div>
</body>
</html>

145
docs/relnotes/10.4.3.html Normal file
View File

@@ -0,0 +1,145 @@
<!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.4.3 Release Notes / January 24, 2015</h1>
<p>
Mesa 10.4.3 is a bug fix release which fixes bugs found since the 10.4.2 release.
</p>
<p>
Mesa 10.4.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>
c53eaafc83d9c6315f63e0904d9954d929b841b0b2be7a328eeb6e14f1376129 MesaLib-10.4.3.tar.gz
ef6ecc9c2f36c9f78d1662382a69ae961f38f03af3a0c3268e53f351aa1978ad MesaLib-10.4.3.tar.bz2
179325fc8ec66529d3b0d0c43ef61a33a44d91daa126c3bbdd1efdfd25a7db1d MesaLib-10.4.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=80568">Bug 80568</a> - [gen4] GPU Crash During Google Chrome Operation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85367">Bug 85367</a> - [gen4] GPU hang in glmark-es2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85696">Bug 85696</a> - r600g+nine: Bioshock shader failure after 7b1c0cbc90d456384b0950ad21faa3c61a6b43ff</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88219">Bug 88219</a> - include/c11/threads_posix.h:197: undefined reference to `pthread_mutex_lock'</li>
</ul>
<h2>Changes</h2>
<p>Axel Davy (39):</p>
<ul>
<li>st/nine: Add new texture format strings</li>
<li>st/nine: Correctly advertise D3DPMISCCAPS_CLIPTLVERTS</li>
<li>st/nine: NineBaseTexture9: fix setting of last_layer</li>
<li>st/nine: CubeTexture: fix GetLevelDesc</li>
<li>st/nine: Fix crash when deleting non-implicit swapchain</li>
<li>st/nine: Return D3DERR_INVALIDCALL when trying to create a texture of bad format</li>
<li>st/nine: NineBaseTexture9: update sampler view creation</li>
<li>st/nine: Check if srgb format is supported before trying to use it.</li>
<li>st/nine: Add ATI1 and ATI2 support</li>
<li>st/nine: Rework of boolean constants</li>
<li>st/nine: Convert integer constants to floats before storing them when cards don't support integers</li>
<li>st/nine: Remove some shader unused code</li>
<li>st/nine: Saturate oFog and oPts vs outputs</li>
<li>st/nine: Correctly declare NineTranslateInstruction_Mkxn inputs</li>
<li>st/nine: Fix typo for M4x4</li>
<li>st/nine: Fix POW implementation</li>
<li>st/nine: Handle RSQ special cases</li>
<li>st/nine: Handle NRM with input of null norm</li>
<li>st/nine: Correct LOG on negative values</li>
<li>st/nine: Rewrite LOOP implementation, and a0 aL handling</li>
<li>st/nine: Fix CND implementation</li>
<li>st/nine: Clamp ps 1.X constants</li>
<li>st/nine: Fix some fixed function pipeline operation</li>
<li>st/nine: Implement TEXCOORD special behaviours</li>
<li>st/nine: Fill missing dst and src number for some instructions.</li>
<li>st/nine: Fix TEXM3x3 and implement TEXM3x3VSPEC</li>
<li>st/nine: implement TEXM3x2DEPTH</li>
<li>st/nine: Implement TEXM3x2TEX</li>
<li>st/nine: Implement TEXM3x3SPEC</li>
<li>st/nine: Implement TEXDEPTH</li>
<li>st/nine: Implement TEXDP3</li>
<li>st/nine: Implement TEXDP3TEX</li>
<li>st/nine: Implement TEXREG2AR, TEXREG2GB and TEXREG2RGB</li>
<li>st/nine: Correct rules for relative adressing and constants.</li>
<li>st/nine: Remove unused code for ps</li>
<li>st/nine: Fix sm3 relative addressing for non-debug build</li>
<li>st/nine: Add variables containing the size of the constant buffers</li>
<li>st/nine: Allocate the correct size for the user constant buffer</li>
<li>st/nine: Allocate vs constbuf buffer for indirect addressing once.</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.2 release</li>
<li>Update version to 10.4.3</li>
</ul>
<p>Jason Ekstrand (1):</p>
<ul>
<li>mesa: Fix clamping to -1.0 in snorm_to_float</li>
</ul>
<p>Jonathan Gray (1):</p>
<ul>
<li>glsl: Link glsl_test with pthreads library.</li>
</ul>
<p>Jose Fonseca (1):</p>
<ul>
<li>nine: Drop use of TGSI_OPCODE_CND.</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Respect the no_8 flag on Gen6, not just Gen7+.</li>
<li>i965: Work around mysterious Gen4 GPU hangs with minimal state changes.</li>
</ul>
<p>Stanislaw Halik (1):</p>
<ul>
<li>st/nine: Hack to generate resource if it doesn't exist when getting view</li>
</ul>
<p>Xavier Bouchoux (3):</p>
<ul>
<li>st/nine: Additional defines to d3dtypes.h</li>
<li>st/nine: Add missing c++ declaration for IDirect3DVolumeTexture9</li>
<li>st/nine: Fix D3DRS_POINTSPRITE support</li>
</ul>
</div>
</body>
</html>

100
docs/relnotes/10.4.4.html Normal file
View File

@@ -0,0 +1,100 @@
<!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.4.4 Release Notes / February 06, 2015</h1>
<p>
Mesa 10.4.4 is a bug fix release which fixes bugs found since the 10.4.3 release.
</p>
<p>
Mesa 10.4.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>
5cb427eaf980cb8555953e9928f5797979ed783e277745d5f8cbae8bc5364086 MesaLib-10.4.4.tar.gz
f18a967e9c4d80e054b2fdff8c130ce6e6d1f8eecfc42c9f354f8628d8b4df1c MesaLib-10.4.4.tar.bz2
86baad73b77920c80fe58402a905e7dd17e3ea10ead6ea7d3afdc0a56c860bd7 MesaLib-10.4.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=88662">Bug 88662</a> - unaligned access to gl_dlist_node</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88930">Bug 88930</a> - [osmesa] osbuffer-&gt;textures should be indexed by attachment type</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix display list 8-byte alignment issue</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.3 release</li>
<li>Update version to 10.4.4</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>egl: Pass the correct X visual depth to xcb_put_image().</li>
</ul>
<p>Mario Kleiner (1):</p>
<ul>
<li>glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>gallium/util: Don't use __builtin_clrsb in util_last_bit().</li>
</ul>
<p>Niels Ole Salscheider (1):</p>
<ul>
<li>configure: Link against all LLVM targets when building clover</li>
</ul>
<p>Park, Jeongmin (1):</p>
<ul>
<li>st/osmesa: Fix osbuffer-&gt;textures indexing</li>
</ul>
<p>Ville Syrjälä (1):</p>
<ul>
<li>i965: Fix max_wm_threads for CHV</li>
</ul>
</div>
</body>
</html>

114
docs/relnotes/10.4.5.html Normal file
View File

@@ -0,0 +1,114 @@
<!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.4.5 Release Notes / February 21, 2015</h1>
<p>
Mesa 10.4.5 is a bug fix release which fixes bugs found since the 10.4.4 release.
</p>
<p>
Mesa 10.4.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>
e12bbdaee9a758617e8ebd0bb0e987f72addd11db2e4da25ba695e386cd63843 MesaLib-10.4.5.tar.gz
bf60000700a9d58e3aca2bfeee7e781053b0d839e61a95b1883e05a2dee247a0 MesaLib-10.4.5.tar.bz2
3b926de8eee500bb67cf85332c51292f826cc539b8636382aadbb8e70c76527a MesaLib-10.4.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=82477">Bug 82477</a> - [softpipe] piglit fp-long-alu regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88658">Bug 88658</a> - (bisected) Slow video playback on Kabini</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89069">Bug 89069</a> - Lack of grass in The Talos Principle on radeonsi (native\wine\nine)</li>
</ul>
<h2>Changes</h2>
<p>Carl Worth (1):</p>
<ul>
<li>Revert use of Mesa IR optimizer for ARB_fragment_programs</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.4 release</li>
<li>get-pick-list.sh: Require explicit "10.4" for nominating stable patches</li>
<li>Update version to 10.4.5</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>nvc0: bail out of 2d blits with non-A8_UNORM alpha formats</li>
<li>st/mesa: treat resource-less xfb buffers as if they weren't there</li>
<li>nvc0: allow holes in xfb target lists</li>
</ul>
<p>Jeremy Huddleston Sequoia (2):</p>
<ul>
<li>darwin: build fix</li>
<li>darwin: build fix</li>
</ul>
<p>Kenneth Graunke (4):</p>
<ul>
<li>i965: Override swizzles for integer luminance formats.</li>
<li>i965: Use a gl_color_union for sampler border color.</li>
<li>i965: Fix integer border color on Haswell.</li>
<li>glsl: Reduce memory consumption of copy propagation passes.</li>
</ul>
<p>Laura Ekstrand (1):</p>
<ul>
<li>main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.</li>
</ul>
<p>Marek Olšák (5):</p>
<ul>
<li>r600g,radeonsi: don't append to streamout buffers that haven't been used yet</li>
<li>radeonsi: fix instanced arrays with non-zero start instance</li>
<li>radeonsi: small fix in SPI state</li>
<li>mesa: fix AtomicBuffer typo in _mesa_DeleteBuffers</li>
<li>radeonsi: fix a crash if a stencil ref state is set before a DSA state</li>
</ul>
<p>Michel Dänzer (2):</p>
<ul>
<li>st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB</li>
<li>Revert "radeon/llvm: enable unsafe math for graphics shaders"</li>
</ul>
</div>
</body>
</html>

143
docs/relnotes/10.4.6.html Normal file
View File

@@ -0,0 +1,143 @@
<!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.4.6 Release Notes / March 06, 2015</h1>
<p>
Mesa 10.4.6 is a bug fix release which fixes bugs found since the 10.4.5 release.
</p>
<p>
Mesa 10.4.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>
46c9082142e811c01e49a2c332a9ac0a1eb98f2908985fb9df216539d7eaeaf4 MesaLib-10.4.6.tar.gz
d8baedd20e79ccd98a5a7b05e23d59a30892e68de1fcc057ca6873dafca02735 MesaLib-10.4.6.tar.bz2
6aded6eac7f0d4d55117b8b581d8424710bbb4c768fc90f7b881f29311a751aa MesaLib-10.4.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=45348">Bug 45348</a> - [swrast] piglit fbo-drawbuffers-arbfp regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84613">Bug 84613</a> - [G965, bisected] piglit regressions : glslparsertest.glsl2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87516">Bug 87516</a> - glProgramBinary violates spec</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88885">Bug 88885</a> - Transform feedback uses incorrect interleaving if a previous draw did not write gl_Position</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89180">Bug 89180</a> - [IVB regression] Rendering issues in Mass Effect through VMware Workstation</li>
</ul>
<h2>Changes</h2>
<p>Abdiel Janulgue (2):</p>
<ul>
<li>glsl: Don't optimize min/max into saturate when EmitNoSat is set</li>
<li>st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported</li>
</ul>
<p>Andreas Boll (1):</p>
<ul>
<li>glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA</li>
</ul>
<p>Brian Paul (2):</p>
<ul>
<li>swrast: fix multiple color buffer writing</li>
<li>st/mesa: fix sampler view reference counting bug in glDraw/CopyPixels</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965/gs: Check newly-generated GS-out VUE map against correct stage</li>
</ul>
<p>Eduardo Lima Mitev (1):</p>
<ul>
<li>mesa: Fix error validating args for TexSubImage3D</li>
</ul>
<p>Emil Velikov (6):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.5 release</li>
<li>install-lib-links: remove the .install-lib-links file</li>
<li>Revert "mesa: Correct backwards NULL check."</li>
<li>mesa: cherry-pick the second half of commit 2aa71e9485a</li>
<li>Revert "gallivm: Update for RTDyldMemoryManager becoming an unique_ptr."</li>
<li>Update version to 10.4.6</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>mesa: Add missing error checks in _mesa_ProgramBinary</li>
<li>mesa: Ensure that length is set to zero in _mesa_GetProgramBinary</li>
<li>mesa: Always generate GL_INVALID_OPERATION in _mesa_GetProgramBinary</li>
</ul>
<p>Jonathan Gray (1):</p>
<ul>
<li>auxilary/os: correct sysctl use in os_get_total_physical_memory()</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>gallivm: Update for RTDyldMemoryManager becoming an unique_ptr.</li>
</ul>
<p>Leo Liu (1):</p>
<ul>
<li>st/omx/dec/h264: fix picture out-of-order with poc type 0 v2</li>
</ul>
<p>Lucas Stach (1):</p>
<ul>
<li>install-lib-links: don't depend on .libs directory</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>vbo: fix an unitialized-variable warning</li>
<li>radeonsi: fix point sprites</li>
</ul>
<p>Matt Turner (4):</p>
<ul>
<li>glsl: Rewrite and fix min/max to saturate optimization.</li>
<li>mesa: Correct backwards NULL check.</li>
<li>i965/fs: Don't use backend_visitor::instructions after creating the CFG.</li>
<li>mesa: Correct backwards NULL check.</li>
</ul>
</div>
</body>
</html>

134
docs/relnotes/10.4.7.html Normal file
View File

@@ -0,0 +1,134 @@
<!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.4.7 Release Notes / March 20, 2015</h1>
<p>
Mesa 10.4.7 is a bug fix release which fixes bugs found since the 10.4.6 release.
</p>
<p>
Mesa 10.4.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>
9e7b59267199658808f8b33e0410b86fbafbdcd52378658b9df65fac9d24947f MesaLib-10.4.7.tar.gz
2c351c98671f9a7ab3fd9c601bb7a255801b1580f5dd0992639f99152801b0d2 MesaLib-10.4.7.tar.bz2
d14ac578b5ce16560757b53fbd1cb4d6b34652f8e110e4b10a019adc82e67ffd MesaLib-10.4.7.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=79202">Bug 79202</a> - valgrind errors in glsl-fs-uniform-array-loop-unroll.shader_test; random code generation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89156">Bug 89156</a> - r300g: GL_COMPRESSED_RED_RGTC1 / ATI1N support broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89224">Bug 89224</a> - Incorrect rendering of Unigine Valley running in VM on VMware Workstation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89530">Bug 89530</a> - FTBFS in loader: missing fstat</li>
</ul>
<h2>Changes</h2>
<p>Andrey Sudnik (1):</p>
<ul>
<li>i965/vec4: Don't lose the saturate modifier in copy propagation.</li>
</ul>
<p>Daniel Stone (1):</p>
<ul>
<li>egl: Take alpha bits into account when selecting GBM formats</li>
</ul>
<p>Emil Velikov (6):</p>
<ul>
<li>docs: Add sha256 sums for the 10.4.6 release</li>
<li>cherry-ignore: add not applicable/rejected commits</li>
<li>mesa: rename format_info.c to format_info.h</li>
<li>loader: include &lt;sys/stat.h&gt; for non-sysfs builds</li>
<li>auxiliary/os: fix the android build - s/drm_munmap/os_munmap/</li>
<li>Update version to 10.4.7</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>i965: Fix out-of-bounds accesses into pull_constant_loc array</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>freedreno: move fb state copy after checking for size change</li>
<li>freedreno/ir3: fix array count returned by TXQ</li>
<li>freedreno/ir3: get the # of miplevels from getinfo</li>
<li>freedreno: fix slice pitch calculations</li>
</ul>
<p>Marc-Andre Lureau (1):</p>
<ul>
<li>gallium/auxiliary/indices: fix start param</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>r300g: fix RGTC1 and LATC1 SNORM formats</li>
<li>r300g: fix a crash when resolving into an sRGB texture</li>
<li>r300g: fix sRGB-&gt;sRGB blits</li>
<li>radeonsi: increase coords array size for radeon_llvm_emit_prepare_cube_coords</li>
</ul>
<p>Mario Kleiner (1):</p>
<ul>
<li>glx: Handle out-of-sequence swap completion events correctly. (v2)</li>
</ul>
<p>Matt Turner (2):</p>
<ul>
<li>r300g: Use PATH_MAX instead of limiting ourselves to 100 chars.</li>
<li>r300g: Check return value of snprintf().</li>
</ul>
<p>Rob Clark (2):</p>
<ul>
<li>freedreno/ir3: fix silly typo for binning pass shaders</li>
<li>freedreno: update generated headers</li>
</ul>
<p>Samuel Iglesias Gonsalvez (1):</p>
<ul>
<li>glsl: optimize (0 cmp x + y) into (-x cmp y).</li>
</ul>
<p>Stefan Dösinger (1):</p>
<ul>
<li>r300g: Fix the ATI1N swizzle (RGTC1 and LATC1)</li>
</ul>
</div>
</body>
</html>

259
docs/relnotes/10.4.html Normal file
View File

@@ -0,0 +1,259 @@
<!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.4 Release Notes / December 14, 2014</h1>
<p>
Mesa 10.4 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.4.1.
</p>
<p>
Mesa 10.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>
abfbfd2d91ce81491c5bb6923ae649212ad5f82d0bee277de8704cc948dc221e MesaLib-10.4.0.tar.gz
98a7dff3a1a6708c79789de8b9a05d8042e867067f70e8f30387c15026233219 MesaLib-10.4.0.tar.bz2
443a6d46d0691b5ac811d8d30091b1716c365689b16d49c57cf273c2b76086fe MesaLib-10.4.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_conditional_render_inverted on nv50</li>
<li>GL_ARB_sample_shading on r600</li>
<li>GL_ARB_texture_view on nv50, nvc0</li>
<li>GL_ARB_clip_control on nv50, nvc0, r300, r600, radeonsi, llvmpipe, softpipe</li>
<li>GL_KHR_context_flush_control on all drivers</li>
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79963">Bug 79963</a> - [ILK Bisected]some piglit and ogles2conform cases fail </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29661">Bug 29661</a> - MSVC built u_format_test fails on Windows</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38873">Bug 38873</a> - [855gm] gnome-shell misrendered</li>
<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=60879">Bug 60879</a> - [radeonsi] X11 can't start with acceleration enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61415">Bug 61415</a> - Clover ignores --with-opencl-libdir path</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=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=67672">Bug 67672</a> - [llvmpipe] lp_test_arit fails on old CPUs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69200">Bug 69200</a> - [Bisected]Piglit glx/glx-multithread-shader-compile aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70410">Bug 70410</a> - egl-static/Makefile: linking fails with llvm &gt;= 3.4</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=72819">Bug 72819</a> - [855GM] Incorrect drop shadow color on windows and strange white rectangle when showing/hiding GLX-dock...</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74563">Bug 74563</a> - Surfaceless contexts are not properly released by DRI drivers</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=75011">Bug 75011</a> - [hyperz] Performance drop since git-01e6371 (disable hyperz by default) with radeonsi</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75112">Bug 75112</a> - Meta Bug for HyperZ issues on r600g and radeonsi</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76252">Bug 76252</a> - Dynamic loading/unloading of opengl32.dll results in a deadlock</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76861">Bug 76861</a> - mid3 generates slow code for constant arguments</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77957">Bug 77957</a> - Variably-indexed constant arrays result in terrible shader code</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78468">Bug 78468</a> - Compiling of shader gets stuck in infinite loop</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78770">Bug 78770</a> - [SNB bisected]Webglc conformance/textures/texture-size-limit.html fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79155">Bug 79155</a> - [Tesseract Game] Global Illumination: Medium Causes Color Distortion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80011">Bug 80011</a> - [softpipe] tgsi/tgsi_exec.c:2023:exec_txf: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80012">Bug 80012</a> - [softpipe] draw/draw_gs.c:113:tgsi_fetch_gs_outputs: Assertion `!util_is_inf_or_nan(output[slot][0])' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80050">Bug 80050</a> - [855GM] Incorrect drop shadow color under windows in Cinnamon persists with MESA 10.1.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80247">Bug 80247</a> - Khronos conformance test ES3-CTS.gtf.GL3Tests.transform_feedback.transform_feedback_vertex_id fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80561">Bug 80561</a> - Incorrect implementation of some VDPAU APIs.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80615">Bug 80615</a> - Files in bellagio directory [omx tracker] don't respect installation folder</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80848">Bug 80848</a> - [dri3] Building mesa fails with dri3 enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81680">Bug 81680</a> - [r600g] Firefox crashes with hardware acceleration turned on</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=82472">Bug 82472</a> - piglit 16385-consecutive-chars regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82537">Bug 82537</a> - Stunt Rally GLSL compiler assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82538">Bug 82538</a> - Super Maryo Chronicles fails with st/mesa assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82539">Bug 82539</a> - vmw_screen_dri.lo In file included from vmw_screen_dri.c:41: vmwgfx_drm.h:32:17: error: drm.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82796">Bug 82796</a> - [IVB/BYT-M/HSW/BDW Bisected]Synmark2_v6.0_OglTerrainFlyInst/OglTerrainPanInst cannot run as image validation failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82804">Bug 82804</a> - unreal engine 4 rendering errors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82828">Bug 82828</a> - Regression: Crash in 3Dmark2001</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82846">Bug 82846</a> - [BDW Bisected] Gpu hang when running Lightsmark v2008/Warsow v1.0/Xonotic v0.7/unigine-demos</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82881">Bug 82881</a> - test_vec4_register_coalesce regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82882">Bug 82882</a> - [swrast] piglit glsl-fs-uniform-bool-1 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82921">Bug 82921</a> - layout(location=0) emits error &gt;= MAX_UNIFORM_LOCATIONS due to integer underflow</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82929">Bug 82929</a> - [BDW Bisected]glxgears causes X hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</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=83080">Bug 83080</a> - [SNB+ Bisected]ES3-CTS.shaders.loops.do_while_constant_iterations.mixed_break_continue_fragment fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83081">Bug 83081</a> - [BDW Bisected]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 is core dumped</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83127">Bug 83127</a> - [ILK Bisected]Piglit glean_texCombine fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83148">Bug 83148</a> - Unity invisible under Ubuntu 14.04 and 14.10</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>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83380">Bug 83380</a> - Linking fails when not writing gl_Position.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83418">Bug 83418</a> - EU IV is incorrectly rendered after git1409011930.d571f2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83432">Bug 83432</a> - r600_query.c:269:r600_emit_query_end: Assertion `ctx-&gt;num_pipelinestat_queries &gt; 0' failed [Gallium HUD]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83463">Bug 83463</a> - [swrast] piglit glsl-vs-clamp-1 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83468">Bug 83468</a> - [UBO] Using bool from UBO as if-statement condition asserts</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83500">Bug 83500</a> - si_dma_copy_tile causes GPU hangs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83506">Bug 83506</a> - [UBO] row_major layout ignored inside structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83533">Bug 83533</a> - [UBO] nested structures don't get appropriate padding</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83573">Bug 83573</a> - [swrast] piglit fs-op-not-bool-using-if regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83574">Bug 83574</a> - [llvmpipe] [softpipe] piglit arb_explicit_uniform_location-use-of-unused-loc regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83741">Bug 83741</a> - [UBO] row_major layout partially ignored for arrays of structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83777">Bug 83777</a> - [regression] ilo fails to build</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83934">Bug 83934</a> - Structures must have same name to be considered same type.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84140">Bug 84140</a> - mplayer crashes playing some files using vdpau output</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84145">Bug 84145</a> - UE4: Realistic Rendering Demo render blue</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84178">Bug 84178</a> - Big glamor regression in Xorg server 1.6.99.1 GIT: x11perf 1.5 Test: PutImage XY 500x500 Square</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84355">Bug 84355</a> - texture2DProjLod and textureCubeLod are not supported when using GLES.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84529">Bug 84529</a> - [IVB bisected] glean fragProg1 CMP test failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84538">Bug 84538</a> - lp_test_format.c:226:4: error: too few arguments to function gallivm_create</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84539">Bug 84539</a> - brw_fs_register_coalesce.cpp:183: bool fs_visitor::register_coalesce(): Assertion `src_size &lt;= 11' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84557">Bug 84557</a> - [HSW] &quot;Emit ELSE/ENDIF JIP with type D on Gen 7&quot; causes Atomic Afterlife and GPU hangs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84651">Bug 84651</a> - Distorted graphics or black window when running Battle.net app on Intel hardware via wine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84662">Bug 84662</a> - Long pauses with Unreal demo Elemental on R9270X since : Always flush the HDP cache before submitting a CS to the GPU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84777">Bug 84777</a> - [BSW]Piglit spec_glsl-1.50_execution_geometry-basic fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84807">Bug 84807</a> - Build issue starting between bf4aecfb2acc8d0dc815105d2f36eccbc97c284b and a3e9582f09249ad27716ba82c7dfcee685b65d51</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85189">Bug 85189</a> - llvm/invocation.cpp: In function 'void {anonymous}::optimize(llvm::Module*, unsigned int, const std::vector&lt;llvm::Function*&gt;&amp;)': llvm/invocation.cpp:324:18: error: expected type-specifier</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85267">Bug 85267</a> - vlc crashes with vdpau (Radeon 3850HD) [r600]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85377">Bug 85377</a> - lp_test_format failure with llvm-3.6</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85425">Bug 85425</a> - [bisected] Compiler error in clip control operations in meta</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85429">Bug 85429</a> - indirect.c:296: multiple definition of `__indirect_glNewList'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85454">Bug 85454</a> - Unigine Sanctuary with Wine crashes on Mesa Git</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85647">Bug 85647</a> - Random radeonsi crashes with mesa 10.3.x</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85683">Bug 85683</a> - [i965 Bisected]Piglit shaders_glsl-vs-raytrace-bug26691 segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85691">Bug 85691</a> - 'glsl: Drop constant 0.0 components from dot products.' broke piglit shaders/glsl-gnome-shell-dim-window and a few others with Gallium</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86025">Bug 86025</a> - src\glsl\list.h(535) : error C2143: syntax error : missing ';' before 'type'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86089">Bug 86089</a> - [r600g][mesa 10.4.0-dev] shader failure - r600_sb::bc_finalizer::cf_peephole() when starting Second Life</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86145">Bug 86145</a> - Pipeline statistic counter values for VF always 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86618">Bug 86618</a> - [NV96] neg modifiers not working in MIN and MAX operations</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86760">Bug 86760</a> - mesa doesn't build: recipe for target 'r600_llvm.lo' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86764">Bug 86764</a> - [SNB+ Bisected]Piglit glean/pointSprite fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86788">Bug 86788</a> - (bisected) 32bit UrbanTerror 4.1 timedemo sse4.1 segfault...</li>
</ul>
<h2>Changes</h2>
<ul>
<li>The environment variable GALLIUM_MSAA that forced a multisample GLX visual was removed.</li>
</ul>
</div>
</body>
</html>

1868
include/D3D9/d3d9.h Normal file

File diff suppressed because it is too large Load Diff

387
include/D3D9/d3d9caps.h Normal file
View File

@@ -0,0 +1,387 @@
/*
* Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* 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 AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _D3D9CAPS_H_
#define _D3D9CAPS_H_
#include "d3d9types.h"
/* Caps flags */
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000
#define D3DCAPS2_RESERVED 0x02000000
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000
#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000
#define D3DCAPS2_CANSHARERESOURCE 0x80000000
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020
#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200
#define D3DCAPS3_DXVAHD 0x00000400
#define D3DCAPS3_RESERVED 0x8000001F
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000
#define D3DPRESENT_INTERVAL_ONE 0x00000001
#define D3DPRESENT_INTERVAL_TWO 0x00000002
#define D3DPRESENT_INTERVAL_THREE 0x00000004
#define D3DPRESENT_INTERVAL_FOUR 0x00000008
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000
#define D3DCURSORCAPS_COLOR 0x00000001
#define D3DCURSORCAPS_LOWRES 0x00000002
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000
#define D3DDEVCAPS_PUREDEVICE 0x00100000
#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000
#define D3DDEVCAPS_RTPATCHES 0x00400000
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000
#define D3DDEVCAPS_NPATCHES 0x01000000
#define D3DPMISCCAPS_MASKZ 0x00000002
#define D3DPMISCCAPS_CULLNONE 0x00000010
#define D3DPMISCCAPS_CULLCW 0x00000020
#define D3DPMISCCAPS_CULLCCW 0x00000040
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400
#define D3DPMISCCAPS_BLENDOP 0x00000800
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000
#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000
#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000
#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000
#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000
#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000
#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000
#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000
#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000
#define D3DPRASTERCAPS_DITHER 0x00000001
#define D3DPRASTERCAPS_ZTEST 0x00000010
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080
#define D3DPRASTERCAPS_FOGTABLE 0x00000100
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000
#define D3DPRASTERCAPS_FOGRANGE 0x00010000
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000
#define D3DPRASTERCAPS_WBUFFER 0x00040000
#define D3DPRASTERCAPS_WFOG 0x00100000
#define D3DPRASTERCAPS_ZFOG 0x00200000
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000
#define D3DPRASTERCAPS_SCISSORTEST 0x01000000
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000
#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000
#define D3DPCMPCAPS_NEVER 0x00000001
#define D3DPCMPCAPS_LESS 0x00000002
#define D3DPCMPCAPS_EQUAL 0x00000004
#define D3DPCMPCAPS_LESSEQUAL 0x00000008
#define D3DPCMPCAPS_GREATER 0x00000010
#define D3DPCMPCAPS_NOTEQUAL 0x00000020
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040
#define D3DPCMPCAPS_ALWAYS 0x00000080
#define D3DPBLENDCAPS_ZERO 0x00000001
#define D3DPBLENDCAPS_ONE 0x00000002
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008
#define D3DPBLENDCAPS_SRCALPHA 0x00000010
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020
#define D3DPBLENDCAPS_DESTALPHA 0x00000040
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000
#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000
#ifndef D3D_DISABLE_9EX
# define D3DPBLENDCAPS_SRCCOLOR2 0x00004000
# define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000
#endif
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001
#define D3DPTEXTURECAPS_POW2 0x00000002
#define D3DPTEXTURECAPS_ALPHA 0x00000004
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100
#define D3DPTEXTURECAPS_PROJECTED 0x00000400
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000
#define D3DPTEXTURECAPS_MIPMAP 0x00004000
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000
#define D3DPTADDRESSCAPS_WRAP 0x00000001
#define D3DPTADDRESSCAPS_MIRROR 0x00000002
#define D3DPTADDRESSCAPS_CLAMP 0x00000004
#define D3DPTADDRESSCAPS_BORDER 0x00000008
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010
#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020
#define D3DLINECAPS_TEXTURE 0x00000001
#define D3DLINECAPS_ZTEST 0x00000002
#define D3DLINECAPS_BLEND 0x00000004
#define D3DLINECAPS_ALPHACMP 0x00000008
#define D3DLINECAPS_FOG 0x00000010
#define D3DLINECAPS_ANTIALIAS 0x00000020
#define D3DSTENCILCAPS_KEEP 0x00000001
#define D3DSTENCILCAPS_ZERO 0x00000002
#define D3DSTENCILCAPS_REPLACE 0x00000004
#define D3DSTENCILCAPS_INCRSAT 0x00000008
#define D3DSTENCILCAPS_DECRSAT 0x00000010
#define D3DSTENCILCAPS_INVERT 0x00000020
#define D3DSTENCILCAPS_INCR 0x00000040
#define D3DSTENCILCAPS_DECR 0x00000080
#define D3DSTENCILCAPS_TWOSIDED 0x00000100
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000FFFF
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000
#define D3DFVFCAPS_PSIZE 0x00100000
#define D3DTEXOPCAPS_DISABLE 0x00000001
#define D3DTEXOPCAPS_SELECTARG1 0x00000002
#define D3DTEXOPCAPS_SELECTARG2 0x00000004
#define D3DTEXOPCAPS_MODULATE 0x00000008
#define D3DTEXOPCAPS_MODULATE2X 0x00000010
#define D3DTEXOPCAPS_MODULATE4X 0x00000020
#define D3DTEXOPCAPS_ADD 0x00000040
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100
#define D3DTEXOPCAPS_SUBTRACT 0x00000200
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000
#define D3DTEXOPCAPS_PREMODULATE 0x00010000
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000
#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000
#define D3DTEXOPCAPS_LERP 0x02000000
#define D3DVTXPCAPS_TEXGEN 0x00000001
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020
#define D3DVTXPCAPS_TWEENING 0x00000040
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200
#define D3DDEVCAPS2_STREAMOFFSET 0x00000001
#define D3DDEVCAPS2_DMAPNPATCH 0x00000002
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040
#define D3DDTCAPS_UBYTE4 0x00000001
#define D3DDTCAPS_UBYTE4N 0x00000002
#define D3DDTCAPS_SHORT2N 0x00000004
#define D3DDTCAPS_SHORT4N 0x00000008
#define D3DDTCAPS_USHORT2N 0x00000010
#define D3DDTCAPS_USHORT4N 0x00000020
#define D3DDTCAPS_UDEC3 0x00000040
#define D3DDTCAPS_DEC3N 0x00000080
#define D3DDTCAPS_FLOAT16_2 0x00000100
#define D3DDTCAPS_FLOAT16_4 0x00000200
#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DVS20_MAX_NUMTEMPS 32
#define D3DVS20_MIN_NUMTEMPS 12
#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1
#define D3DVS20CAPS_PREDICATION (1 << 0)
#define D3DPS20CAPS_ARBITRARYSWIZZLE (1 << 0)
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1 << 1)
#define D3DPS20CAPS_PREDICATION (1 << 2)
#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1 << 3)
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1 << 4)
#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMTEMPS 32
#define D3DPS20_MIN_NUMTEMPS 12
#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4
#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0
#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512
#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96
#define D3DMIN30SHADERINSTRUCTIONS 512
#define D3DMAX30SHADERINSTRUCTIONS 32768
/* Structs */
typedef struct _D3DVSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
} D3DVSHADERCAPS2_0, *PD3DVSHADERCAPS2_0, *LPD3DVSHADERCAPS2_0;
typedef struct _D3DPSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
INT NumInstructionSlots;
} D3DPSHADERCAPS2_0, *PD3DPSHADERCAPS2_0, *LPD3DPSHADERCAPS2_0;
typedef struct _D3DCAPS9 {
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
DWORD CursorCaps;
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps;
DWORD CubeTextureFilterCaps;
DWORD VolumeTextureFilterCaps;
DWORD TextureAddressCaps;
DWORD VolumeTextureAddressCaps;
DWORD LineCaps;
DWORD MaxTextureWidth;
DWORD MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount;
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride;
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst;
DWORD PixelShaderVersion;
float PixelShader1xMaxValue;
DWORD DevCaps2;
float MaxNpatchTessellationLevel;
DWORD Reserved5;
UINT MasterAdapterOrdinal;
UINT AdapterOrdinalInGroup;
UINT NumberOfAdaptersInGroup;
DWORD DeclTypes;
DWORD NumSimultaneousRTs;
DWORD StretchRectFilterCaps;
D3DVSHADERCAPS2_0 VS20Caps;
D3DPSHADERCAPS2_0 PS20Caps;
DWORD VertexTextureFilterCaps;
DWORD MaxVShaderInstructionsExecuted;
DWORD MaxPShaderInstructionsExecuted;
DWORD MaxVertexShader30InstructionSlots;
DWORD MaxPixelShader30InstructionSlots;
} D3DCAPS9, *PD3DCAPS9, *LPD3DCAPS9;
typedef struct _D3DCONTENTPROTECTIONCAPS {
DWORD Caps;
GUID KeyExchangeType;
UINT BufferAlignmentStart;
UINT BlockAlignmentSize;
ULONGLONG ProtectedMemorySize;
} D3DCONTENTPROTECTIONCAPS, *PD3DCONTENTPROTECTIONCAPS, *LPD3DCONTENTPROTECTIONCAPS;
typedef struct _D3DOVERLAYCAPS {
UINT Caps;
UINT MaxOverlayDisplayWidth;
UINT MaxOverlayDisplayHeight;
} D3DOVERLAYCAPS, *PD3DOVERLAYCAPS, *LPD3DOVERLAYCAPS;
#endif /* _D3D9CAPS_H_ */

1810
include/D3D9/d3d9types.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -646,6 +646,7 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
#endif /* EGL_NV_system_time */
#include <EGL/eglmesaext.h>
#include <EGL/eglextchromium.h>
#ifdef __cplusplus
}

View File

@@ -0,0 +1,60 @@
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file contains Chromium-specific EGL extensions declarations.
#ifndef GPU_EGL_EGLEXTCHROMIUM_H_
#define GPU_EGL_EGLEXTCHROMIUM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <EGL/eglplatform.h>
/* EGLSyncControlCHROMIUM requires 64-bit uint support */
#if KHRONOS_SUPPORT_INT64
#ifndef EGL_CHROMIUM_sync_control
#define EGL_CHROMIUM_sync_control 1
typedef khronos_uint64_t EGLuint64CHROMIUM;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(
EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC)
(EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif // GPU_EGL_EGLEXTCHROMIUM_H_

View File

@@ -106,6 +106,7 @@
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextures MANGLE(BindTextures)
#define glBindTextureUnit MANGLE(BindTextureUnit)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
#define glBindTransformFeedback MANGLE(BindTransformFeedback)
#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
@@ -129,6 +130,7 @@
#define glBinormalPointerEXT MANGLE(BinormalPointerEXT)
#define glBitmap MANGLE(Bitmap)
#define glBitmapxOES MANGLE(BitmapxOES)
#define glBlendBarrierKHR MANGLE(BlendBarrierKHR)
#define glBlendBarrierNV MANGLE(BlendBarrierNV)
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
@@ -157,9 +159,11 @@
#define glBlendParameteriNV MANGLE(BlendParameteriNV)
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
#define glBlitFramebuffer MANGLE(BlitFramebuffer)
#define glBlitNamedFramebuffer MANGLE(BlitNamedFramebuffer)
#define glBufferAddressRangeNV MANGLE(BufferAddressRangeNV)
#define glBufferDataARB MANGLE(BufferDataARB)
#define glBufferData MANGLE(BufferData)
#define glBufferPageCommitmentARB MANGLE(BufferPageCommitmentARB)
#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
#define glBufferStorage MANGLE(BufferStorage)
#define glBufferSubDataARB MANGLE(BufferSubDataARB)
@@ -169,6 +173,7 @@
#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
#define glCheckFramebufferStatus MANGLE(CheckFramebufferStatus)
#define glCheckNamedFramebufferStatusEXT MANGLE(CheckNamedFramebufferStatusEXT)
#define glCheckNamedFramebufferStatus MANGLE(CheckNamedFramebufferStatus)
#define glClampColorARB MANGLE(ClampColorARB)
#define glClampColor MANGLE(ClampColor)
#define glClearAccum MANGLE(ClearAccum)
@@ -191,7 +196,13 @@
#define glClearIndex MANGLE(ClearIndex)
#define glClear MANGLE(Clear)
#define glClearNamedBufferDataEXT MANGLE(ClearNamedBufferDataEXT)
#define glClearNamedBufferData MANGLE(ClearNamedBufferData)
#define glClearNamedBufferSubDataEXT MANGLE(ClearNamedBufferSubDataEXT)
#define glClearNamedBufferSubData MANGLE(ClearNamedBufferSubData)
#define glClearNamedFramebufferfi MANGLE(ClearNamedFramebufferfi)
#define glClearNamedFramebufferfv MANGLE(ClearNamedFramebufferfv)
#define glClearNamedFramebufferiv MANGLE(ClearNamedFramebufferiv)
#define glClearNamedFramebufferuiv MANGLE(ClearNamedFramebufferuiv)
#define glClearStencil MANGLE(ClearStencil)
#define glClearTexImage MANGLE(ClearTexImage)
#define glClearTexSubImage MANGLE(ClearTexSubImage)
@@ -200,6 +211,7 @@
#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
#define glClientWaitSync MANGLE(ClientWaitSync)
#define glClipControl MANGLE(ClipControl)
#define glClipPlanefOES MANGLE(ClipPlanefOES)
#define glClipPlane MANGLE(ClipPlane)
#define glClipPlanexOES MANGLE(ClipPlanexOES)
@@ -308,8 +320,11 @@
#define glCompressedTextureImage2DEXT MANGLE(CompressedTextureImage2DEXT)
#define glCompressedTextureImage3DEXT MANGLE(CompressedTextureImage3DEXT)
#define glCompressedTextureSubImage1DEXT MANGLE(CompressedTextureSubImage1DEXT)
#define glCompressedTextureSubImage1D MANGLE(CompressedTextureSubImage1D)
#define glCompressedTextureSubImage2DEXT MANGLE(CompressedTextureSubImage2DEXT)
#define glCompressedTextureSubImage2D MANGLE(CompressedTextureSubImage2D)
#define glCompressedTextureSubImage3DEXT MANGLE(CompressedTextureSubImage3DEXT)
#define glCompressedTextureSubImage3D MANGLE(CompressedTextureSubImage3D)
#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
@@ -340,6 +355,7 @@
#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT)
#define glCopyMultiTexSubImage2DEXT MANGLE(CopyMultiTexSubImage2DEXT)
#define glCopyMultiTexSubImage3DEXT MANGLE(CopyMultiTexSubImage3DEXT)
#define glCopyNamedBufferSubData MANGLE(CopyNamedBufferSubData)
#define glCopyPathNV MANGLE(CopyPathNV)
#define glCopyPixels MANGLE(CopyPixels)
#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
@@ -355,20 +371,32 @@
#define glCopyTextureImage1DEXT MANGLE(CopyTextureImage1DEXT)
#define glCopyTextureImage2DEXT MANGLE(CopyTextureImage2DEXT)
#define glCopyTextureSubImage1DEXT MANGLE(CopyTextureSubImage1DEXT)
#define glCopyTextureSubImage1D MANGLE(CopyTextureSubImage1D)
#define glCopyTextureSubImage2DEXT MANGLE(CopyTextureSubImage2DEXT)
#define glCopyTextureSubImage2D MANGLE(CopyTextureSubImage2D)
#define glCopyTextureSubImage3DEXT MANGLE(CopyTextureSubImage3DEXT)
#define glCopyTextureSubImage3D MANGLE(CopyTextureSubImage3D)
#define glCoverFillPathInstancedNV MANGLE(CoverFillPathInstancedNV)
#define glCoverFillPathNV MANGLE(CoverFillPathNV)
#define glCoverStrokePathInstancedNV MANGLE(CoverStrokePathInstancedNV)
#define glCoverStrokePathNV MANGLE(CoverStrokePathNV)
#define glCreateBuffers MANGLE(CreateBuffers)
#define glCreateFramebuffers MANGLE(CreateFramebuffers)
#define glCreatePerfQueryINTEL MANGLE(CreatePerfQueryINTEL)
#define glCreateProgram MANGLE(CreateProgram)
#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
#define glCreateProgramPipelines MANGLE(CreateProgramPipelines)
#define glCreateQueries MANGLE(CreateQueries)
#define glCreateRenderbuffers MANGLE(CreateRenderbuffers)
#define glCreateSamplers MANGLE(CreateSamplers)
#define glCreateShader MANGLE(CreateShader)
#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
#define glCreateTextures MANGLE(CreateTextures)
#define glCreateTransformFeedbacks MANGLE(CreateTransformFeedbacks)
#define glCreateVertexArrays MANGLE(CreateVertexArrays)
#define glCullFace MANGLE(CullFace)
#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
@@ -441,6 +469,7 @@
#define glDisable MANGLE(Disable)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexArrayAttribEXT MANGLE(DisableVertexArrayAttribEXT)
#define glDisableVertexArrayAttrib MANGLE(DisableVertexArrayAttrib)
#define glDisableVertexArrayEXT MANGLE(DisableVertexArrayEXT)
#define glDisableVertexAttribAPPLE MANGLE(DisableVertexAttribAPPLE)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
@@ -501,6 +530,7 @@
#define glEnable MANGLE(Enable)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexArrayAttribEXT MANGLE(EnableVertexArrayAttribEXT)
#define glEnableVertexArrayAttrib MANGLE(EnableVertexArrayAttrib)
#define glEnableVertexArrayEXT MANGLE(EnableVertexArrayEXT)
#define glEnableVertexAttribAPPLE MANGLE(EnableVertexAttribAPPLE)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
@@ -555,6 +585,7 @@
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
#define glFlushMappedNamedBufferRange MANGLE(FlushMappedNamedBufferRange)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushStaticDataIBM MANGLE(FlushStaticDataIBM)
@@ -628,6 +659,7 @@
#define glGenerateMipmap MANGLE(GenerateMipmap)
#define glGenerateMultiTexMipmapEXT MANGLE(GenerateMultiTexMipmapEXT)
#define glGenerateTextureMipmapEXT MANGLE(GenerateTextureMipmapEXT)
#define glGenerateTextureMipmap MANGLE(GenerateTextureMipmap)
#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
#define glGenFencesNV MANGLE(GenFencesNV)
#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
@@ -705,6 +737,8 @@
#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
#define glGetCompressedTextureImageEXT MANGLE(GetCompressedTextureImageEXT)
#define glGetCompressedTextureImage MANGLE(GetCompressedTextureImage)
#define glGetCompressedTextureSubImage MANGLE(GetCompressedTextureSubImage)
#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
@@ -743,6 +777,7 @@
#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
#define glGetFramebufferParameteriv MANGLE(GetFramebufferParameteriv)
#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
#define glGetGraphicsResetStatus MANGLE(GetGraphicsResetStatus)
#define glGetHandleARB MANGLE(GetHandleARB)
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
#define glGetHistogram MANGLE(GetHistogram)
@@ -809,12 +844,18 @@
#define glGetMultiTexParameterIivEXT MANGLE(GetMultiTexParameterIivEXT)
#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT)
#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT)
#define glGetNamedBufferParameteri64v MANGLE(GetNamedBufferParameteri64v)
#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT)
#define glGetNamedBufferParameteriv MANGLE(GetNamedBufferParameteriv)
#define glGetNamedBufferParameterui64vNV MANGLE(GetNamedBufferParameterui64vNV)
#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT)
#define glGetNamedBufferPointerv MANGLE(GetNamedBufferPointerv)
#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT)
#define glGetNamedBufferSubData MANGLE(GetNamedBufferSubData)
#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT)
#define glGetNamedFramebufferAttachmentParameteriv MANGLE(GetNamedFramebufferAttachmentParameteriv)
#define glGetNamedFramebufferParameterivEXT MANGLE(GetNamedFramebufferParameterivEXT)
#define glGetNamedFramebufferParameteriv MANGLE(GetNamedFramebufferParameteriv)
#define glGetNamedProgramivEXT MANGLE(GetNamedProgramivEXT)
#define glGetNamedProgramLocalParameterdvEXT MANGLE(GetNamedProgramLocalParameterdvEXT)
#define glGetNamedProgramLocalParameterfvEXT MANGLE(GetNamedProgramLocalParameterfvEXT)
@@ -822,27 +863,46 @@
#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetNamedRenderbufferParameteriv MANGLE(GetNamedRenderbufferParameteriv)
#define glGetNamedStringARB MANGLE(GetNamedStringARB)
#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
#define glGetnColorTableARB MANGLE(GetnColorTableARB)
#define glGetnColorTable MANGLE(GetnColorTable)
#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
#define glGetnCompressedTexImage MANGLE(GetnCompressedTexImage)
#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
#define glGetnConvolutionFilter MANGLE(GetnConvolutionFilter)
#define glGetNextPerfQueryIdINTEL MANGLE(GetNextPerfQueryIdINTEL)
#define glGetnHistogramARB MANGLE(GetnHistogramARB)
#define glGetnHistogram MANGLE(GetnHistogram)
#define glGetnMapdvARB MANGLE(GetnMapdvARB)
#define glGetnMapdv MANGLE(GetnMapdv)
#define glGetnMapfvARB MANGLE(GetnMapfvARB)
#define glGetnMapfv MANGLE(GetnMapfv)
#define glGetnMapivARB MANGLE(GetnMapivARB)
#define glGetnMapiv MANGLE(GetnMapiv)
#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
#define glGetnMinmax MANGLE(GetnMinmax)
#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
#define glGetnPixelMapfv MANGLE(GetnPixelMapfv)
#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
#define glGetnPixelMapuiv MANGLE(GetnPixelMapuiv)
#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
#define glGetnPixelMapusv MANGLE(GetnPixelMapusv)
#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
#define glGetnPolygonStipple MANGLE(GetnPolygonStipple)
#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
#define glGetnSeparableFilter MANGLE(GetnSeparableFilter)
#define glGetnTexImageARB MANGLE(GetnTexImageARB)
#define glGetnTexImage MANGLE(GetnTexImage)
#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
#define glGetnUniformdv MANGLE(GetnUniformdv)
#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
#define glGetnUniformfv MANGLE(GetnUniformfv)
#define glGetnUniformivARB MANGLE(GetnUniformivARB)
#define glGetnUniformiv MANGLE(GetnUniformiv)
#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
#define glGetnUniformuiv MANGLE(GetnUniformuiv)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectLabelEXT MANGLE(GetObjectLabelEXT)
@@ -909,6 +969,7 @@
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
#define glGetProgramResourcefvNV MANGLE(GetProgramResourcefvNV)
#define glGetProgramResourceIndex MANGLE(GetProgramResourceIndex)
#define glGetProgramResourceiv MANGLE(GetProgramResourceiv)
#define glGetProgramResourceLocationIndex MANGLE(GetProgramResourceLocationIndex)
@@ -973,15 +1034,26 @@
#define glGetTextureHandleARB MANGLE(GetTextureHandleARB)
#define glGetTextureHandleNV MANGLE(GetTextureHandleNV)
#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
#define glGetTextureImage MANGLE(GetTextureImage)
#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
#define glGetTextureLevelParameterfv MANGLE(GetTextureLevelParameterfv)
#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
#define glGetTextureLevelParameteriv MANGLE(GetTextureLevelParameteriv)
#define glGetTextureParameterfvEXT MANGLE(GetTextureParameterfvEXT)
#define glGetTextureParameterfv MANGLE(GetTextureParameterfv)
#define glGetTextureParameterIivEXT MANGLE(GetTextureParameterIivEXT)
#define glGetTextureParameterIiv MANGLE(GetTextureParameterIiv)
#define glGetTextureParameterIuivEXT MANGLE(GetTextureParameterIuivEXT)
#define glGetTextureParameterIuiv MANGLE(GetTextureParameterIuiv)
#define glGetTextureParameterivEXT MANGLE(GetTextureParameterivEXT)
#define glGetTextureParameteriv MANGLE(GetTextureParameteriv)
#define glGetTextureSamplerHandleARB MANGLE(GetTextureSamplerHandleARB)
#define glGetTextureSamplerHandleNV MANGLE(GetTextureSamplerHandleNV)
#define glGetTextureSubImage MANGLE(GetTextureSubImage)
#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
#define glGetTransformFeedbacki64_v MANGLE(GetTransformFeedbacki64_v)
#define glGetTransformFeedbacki_v MANGLE(GetTransformFeedbacki_v)
#define glGetTransformFeedbackiv MANGLE(GetTransformFeedbackiv)
#define glGetTransformFeedbackVaryingEXT MANGLE(GetTransformFeedbackVaryingEXT)
#define glGetTransformFeedbackVarying MANGLE(GetTransformFeedbackVarying)
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
@@ -1008,8 +1080,11 @@
#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
#define glGetVaryingLocationNV MANGLE(GetVaryingLocationNV)
#define glGetVertexArrayIndexed64iv MANGLE(GetVertexArrayIndexed64iv)
#define glGetVertexArrayIndexediv MANGLE(GetVertexArrayIndexediv)
#define glGetVertexArrayIntegeri_vEXT MANGLE(GetVertexArrayIntegeri_vEXT)
#define glGetVertexArrayIntegervEXT MANGLE(GetVertexArrayIntegervEXT)
#define glGetVertexArrayiv MANGLE(GetVertexArrayiv)
#define glGetVertexArrayPointeri_vEXT MANGLE(GetVertexArrayPointeri_vEXT)
#define glGetVertexArrayPointervEXT MANGLE(GetVertexArrayPointervEXT)
#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI)
@@ -1089,6 +1164,8 @@
#define glInvalidateBufferData MANGLE(InvalidateBufferData)
#define glInvalidateBufferSubData MANGLE(InvalidateBufferSubData)
#define glInvalidateFramebuffer MANGLE(InvalidateFramebuffer)
#define glInvalidateNamedFramebufferData MANGLE(InvalidateNamedFramebufferData)
#define glInvalidateNamedFramebufferSubData MANGLE(InvalidateNamedFramebufferSubData)
#define glInvalidateSubFramebuffer MANGLE(InvalidateSubFramebuffer)
#define glInvalidateTexImage MANGLE(InvalidateTexImage)
#define glInvalidateTexSubImage MANGLE(InvalidateTexSubImage)
@@ -1202,7 +1279,9 @@
#define glMapGrid2f MANGLE(MapGrid2f)
#define glMapGrid2xOES MANGLE(MapGrid2xOES)
#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
#define glMapNamedBuffer MANGLE(MapNamedBuffer)
#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
#define glMapNamedBufferRange MANGLE(MapNamedBufferRange)
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
@@ -1222,14 +1301,20 @@
#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
#define glMatrixLoad3x2fNV MANGLE(MatrixLoad3x2fNV)
#define glMatrixLoad3x3fNV MANGLE(MatrixLoad3x3fNV)
#define glMatrixLoaddEXT MANGLE(MatrixLoaddEXT)
#define glMatrixLoadfEXT MANGLE(MatrixLoadfEXT)
#define glMatrixLoadIdentityEXT MANGLE(MatrixLoadIdentityEXT)
#define glMatrixLoadTranspose3x3fNV MANGLE(MatrixLoadTranspose3x3fNV)
#define glMatrixLoadTransposedEXT MANGLE(MatrixLoadTransposedEXT)
#define glMatrixLoadTransposefEXT MANGLE(MatrixLoadTransposefEXT)
#define glMatrixMode MANGLE(MatrixMode)
#define glMatrixMult3x2fNV MANGLE(MatrixMult3x2fNV)
#define glMatrixMult3x3fNV MANGLE(MatrixMult3x3fNV)
#define glMatrixMultdEXT MANGLE(MatrixMultdEXT)
#define glMatrixMultfEXT MANGLE(MatrixMultfEXT)
#define glMatrixMultTranspose3x3fNV MANGLE(MatrixMultTranspose3x3fNV)
#define glMatrixMultTransposedEXT MANGLE(MatrixMultTransposedEXT)
#define glMatrixMultTransposefEXT MANGLE(MatrixMultTransposefEXT)
#define glMatrixOrthoEXT MANGLE(MatrixOrthoEXT)
@@ -1241,6 +1326,7 @@
#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMemoryBarrierByRegion MANGLE(MemoryBarrierByRegion)
#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
#define glMemoryBarrier MANGLE(MemoryBarrier)
#define glMinmaxEXT MANGLE(MinmaxEXT)
@@ -1249,6 +1335,7 @@
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArraysIndirectAMD MANGLE(MultiDrawArraysIndirectAMD)
#define glMultiDrawArraysIndirectBindlessCountNV MANGLE(MultiDrawArraysIndirectBindlessCountNV)
#define glMultiDrawArraysIndirectBindlessNV MANGLE(MultiDrawArraysIndirectBindlessNV)
#define glMultiDrawArraysIndirectCountARB MANGLE(MultiDrawArraysIndirectCountARB)
#define glMultiDrawArraysIndirect MANGLE(MultiDrawArraysIndirect)
@@ -1257,6 +1344,7 @@
#define glMultiDrawElementsBaseVertex MANGLE(MultiDrawElementsBaseVertex)
#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
#define glMultiDrawElementsIndirectAMD MANGLE(MultiDrawElementsIndirectAMD)
#define glMultiDrawElementsIndirectBindlessCountNV MANGLE(MultiDrawElementsIndirectBindlessCountNV)
#define glMultiDrawElementsIndirectBindlessNV MANGLE(MultiDrawElementsIndirectBindlessNV)
#define glMultiDrawElementsIndirectCountARB MANGLE(MultiDrawElementsIndirectCountARB)
#define glMultiDrawElementsIndirect MANGLE(MultiDrawElementsIndirect)
@@ -1394,17 +1482,29 @@
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
#define glMultTransposeMatrixxOES MANGLE(MultTransposeMatrixxOES)
#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
#define glNamedBufferData MANGLE(NamedBufferData)
#define glNamedBufferPageCommitmentARB MANGLE(NamedBufferPageCommitmentARB)
#define glNamedBufferPageCommitmentEXT MANGLE(NamedBufferPageCommitmentEXT)
#define glNamedBufferStorageEXT MANGLE(NamedBufferStorageEXT)
#define glNamedBufferStorage MANGLE(NamedBufferStorage)
#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
#define glNamedBufferSubData MANGLE(NamedBufferSubData)
#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
#define glNamedFramebufferDrawBuffer MANGLE(NamedFramebufferDrawBuffer)
#define glNamedFramebufferDrawBuffers MANGLE(NamedFramebufferDrawBuffers)
#define glNamedFramebufferParameteriEXT MANGLE(NamedFramebufferParameteriEXT)
#define glNamedFramebufferParameteri MANGLE(NamedFramebufferParameteri)
#define glNamedFramebufferReadBuffer MANGLE(NamedFramebufferReadBuffer)
#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
#define glNamedFramebufferRenderbuffer MANGLE(NamedFramebufferRenderbuffer)
#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
#define glNamedFramebufferTexture3DEXT MANGLE(NamedFramebufferTexture3DEXT)
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedFramebufferTextureLayer MANGLE(NamedFramebufferTextureLayer)
#define glNamedFramebufferTexture MANGLE(NamedFramebufferTexture)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1418,8 +1518,10 @@
#define glNamedProgramLocalParametersI4uivEXT MANGLE(NamedProgramLocalParametersI4uivEXT)
#define glNamedProgramStringEXT MANGLE(NamedProgramStringEXT)
#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
#define glNamedRenderbufferStorage MANGLE(NamedRenderbufferStorage)
#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNamedRenderbufferStorageMultisample MANGLE(NamedRenderbufferStorageMultisample)
#define glNamedStringARB MANGLE(NamedStringARB)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
@@ -1474,8 +1576,11 @@
#define glPathCoverDepthFuncNV MANGLE(PathCoverDepthFuncNV)
#define glPathDashArrayNV MANGLE(PathDashArrayNV)
#define glPathFogGenNV MANGLE(PathFogGenNV)
#define glPathGlyphIndexArrayNV MANGLE(PathGlyphIndexArrayNV)
#define glPathGlyphIndexRangeNV MANGLE(PathGlyphIndexRangeNV)
#define glPathGlyphRangeNV MANGLE(PathGlyphRangeNV)
#define glPathGlyphsNV MANGLE(PathGlyphsNV)
#define glPathMemoryGlyphIndexArrayNV MANGLE(PathMemoryGlyphIndexArrayNV)
#define glPathParameterfNV MANGLE(PathParameterfNV)
#define glPathParameterfvNV MANGLE(PathParameterfvNV)
#define glPathParameteriNV MANGLE(PathParameteriNV)
@@ -1588,6 +1693,7 @@
#define glProgramParameteri MANGLE(ProgramParameteri)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramPathFragmentInputGenNV MANGLE(ProgramPathFragmentInputGenNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
@@ -1758,6 +1864,7 @@
#define glReadBuffer MANGLE(ReadBuffer)
#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
#define glReadnPixels MANGLE(ReadnPixels)
#define glReadPixels MANGLE(ReadPixels)
#define glRectd MANGLE(Rectd)
#define glRectdv MANGLE(Rectdv)
@@ -1912,6 +2019,10 @@
#define glStencilOpValueAMD MANGLE(StencilOpValueAMD)
#define glStencilStrokePathInstancedNV MANGLE(StencilStrokePathInstancedNV)
#define glStencilStrokePathNV MANGLE(StencilStrokePathNV)
#define glStencilThenCoverFillPathInstancedNV MANGLE(StencilThenCoverFillPathInstancedNV)
#define glStencilThenCoverFillPathNV MANGLE(StencilThenCoverFillPathNV)
#define glStencilThenCoverStrokePathInstancedNV MANGLE(StencilThenCoverStrokePathInstancedNV)
#define glStencilThenCoverStrokePathNV MANGLE(StencilThenCoverStrokePathNV)
#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
#define glSwizzleEXT MANGLE(SwizzleEXT)
@@ -2072,9 +2183,12 @@
#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
#define glTexSubImage3D MANGLE(TexSubImage3D)
#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
#define glTextureBarrier MANGLE(TextureBarrier)
#define glTextureBarrierNV MANGLE(TextureBarrierNV)
#define glTextureBufferEXT MANGLE(TextureBufferEXT)
#define glTextureBuffer MANGLE(TextureBuffer)
#define glTextureBufferRangeEXT MANGLE(TextureBufferRangeEXT)
#define glTextureBufferRange MANGLE(TextureBufferRange)
#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
#define glTextureImage1DEXT MANGLE(TextureImage1DEXT)
#define glTextureImage2DEXT MANGLE(TextureImage2DEXT)
@@ -2088,25 +2202,41 @@
#define glTextureNormalEXT MANGLE(TextureNormalEXT)
#define glTexturePageCommitmentEXT MANGLE(TexturePageCommitmentEXT)
#define glTextureParameterfEXT MANGLE(TextureParameterfEXT)
#define glTextureParameterf MANGLE(TextureParameterf)
#define glTextureParameterfvEXT MANGLE(TextureParameterfvEXT)
#define glTextureParameterfv MANGLE(TextureParameterfv)
#define glTextureParameteriEXT MANGLE(TextureParameteriEXT)
#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
#define glTextureParameterIiv MANGLE(TextureParameterIiv)
#define glTextureParameteri MANGLE(TextureParameteri)
#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
#define glTextureParameterIuiv MANGLE(TextureParameterIuiv)
#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
#define glTextureParameteriv MANGLE(TextureParameteriv)
#define glTextureRangeAPPLE MANGLE(TextureRangeAPPLE)
#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
#define glTextureStorage1DEXT MANGLE(TextureStorage1DEXT)
#define glTextureStorage1D MANGLE(TextureStorage1D)
#define glTextureStorage2DEXT MANGLE(TextureStorage2DEXT)
#define glTextureStorage2D MANGLE(TextureStorage2D)
#define glTextureStorage2DMultisampleEXT MANGLE(TextureStorage2DMultisampleEXT)
#define glTextureStorage2DMultisample MANGLE(TextureStorage2DMultisample)
#define glTextureStorage3DEXT MANGLE(TextureStorage3DEXT)
#define glTextureStorage3D MANGLE(TextureStorage3D)
#define glTextureStorage3DMultisampleEXT MANGLE(TextureStorage3DMultisampleEXT)
#define glTextureStorage3DMultisample MANGLE(TextureStorage3DMultisample)
#define glTextureStorageSparseAMD MANGLE(TextureStorageSparseAMD)
#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
#define glTextureSubImage1D MANGLE(TextureSubImage1D)
#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
#define glTextureSubImage2D MANGLE(TextureSubImage2D)
#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
#define glTextureSubImage3D MANGLE(TextureSubImage3D)
#define glTextureView MANGLE(TextureView)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
#define glTransformFeedbackBufferBase MANGLE(TransformFeedbackBufferBase)
#define glTransformFeedbackBufferRange MANGLE(TransformFeedbackBufferRange)
#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
@@ -2221,6 +2351,7 @@
#define glUnmapBufferARB MANGLE(UnmapBufferARB)
#define glUnmapBuffer MANGLE(UnmapBuffer)
#define glUnmapNamedBufferEXT MANGLE(UnmapNamedBufferEXT)
#define glUnmapNamedBuffer MANGLE(UnmapNamedBuffer)
#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
#define glUnmapTexture2DINTEL MANGLE(UnmapTexture2DINTEL)
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
@@ -2293,9 +2424,15 @@
#define glVertex4sv MANGLE(Vertex4sv)
#define glVertex4xOES MANGLE(Vertex4xOES)
#define glVertex4xvOES MANGLE(Vertex4xvOES)
#define glVertexArrayAttribBinding MANGLE(VertexArrayAttribBinding)
#define glVertexArrayAttribFormat MANGLE(VertexArrayAttribFormat)
#define glVertexArrayAttribIFormat MANGLE(VertexArrayAttribIFormat)
#define glVertexArrayAttribLFormat MANGLE(VertexArrayAttribLFormat)
#define glVertexArrayBindingDivisor MANGLE(VertexArrayBindingDivisor)
#define glVertexArrayBindVertexBufferEXT MANGLE(VertexArrayBindVertexBufferEXT)
#define glVertexArrayColorOffsetEXT MANGLE(VertexArrayColorOffsetEXT)
#define glVertexArrayEdgeFlagOffsetEXT MANGLE(VertexArrayEdgeFlagOffsetEXT)
#define glVertexArrayElementBuffer MANGLE(VertexArrayElementBuffer)
#define glVertexArrayFogCoordOffsetEXT MANGLE(VertexArrayFogCoordOffsetEXT)
#define glVertexArrayIndexOffsetEXT MANGLE(VertexArrayIndexOffsetEXT)
#define glVertexArrayMultiTexCoordOffsetEXT MANGLE(VertexArrayMultiTexCoordOffsetEXT)
@@ -2314,6 +2451,8 @@
#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
#define glVertexArrayVertexAttribOffsetEXT MANGLE(VertexArrayVertexAttribOffsetEXT)
#define glVertexArrayVertexBindingDivisorEXT MANGLE(VertexArrayVertexBindingDivisorEXT)
#define glVertexArrayVertexBuffer MANGLE(VertexArrayVertexBuffer)
#define glVertexArrayVertexBuffers MANGLE(VertexArrayVertexBuffers)
#define glVertexArrayVertexOffsetEXT MANGLE(VertexArrayVertexOffsetEXT)
#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
#define glVertexAttrib1d MANGLE(VertexAttrib1d)

3589
include/GL/glcorearb.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -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: 25853 $ on $Date: 2014-03-13 03:40:45 -0700 (Thu, 13 Mar 2014) $
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 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 20140313
#define GL_GLEXT_VERSION 20140810
/* Generated C header for:
* API: gl
@@ -1308,11 +1308,13 @@ GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
#define GL_UNIFORM_BUFFER_START 0x8A29
#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
@@ -1331,6 +1333,7 @@ GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array);
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
#define GL_INVALID_INDEX 0xFFFFFFFFu
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
@@ -2212,6 +2215,7 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
#define GL_COMPUTE_SHADER_BIT 0x00000020
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
@@ -2436,6 +2440,7 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum
#define GL_VERTEX_BINDING_STRIDE 0x82D8
#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
#define GL_VERTEX_BINDING_BUFFER 0x8F4F
#define GL_DISPLAY_LIST 0x82E7
typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
@@ -2570,10 +2575,279 @@ GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLui
#endif
#endif /* GL_VERSION_4_4 */
#ifndef GL_VERSION_4_5
#define GL_VERSION_4_5 1
#define GL_CONTEXT_LOST 0x0507
#define GL_NEGATIVE_ONE_TO_ONE 0x935E
#define GL_ZERO_TO_ONE 0x935F
#define GL_CLIP_ORIGIN 0x935C
#define GL_CLIP_DEPTH_MODE 0x935D
#define GL_QUERY_WAIT_INVERTED 0x8E17
#define GL_QUERY_NO_WAIT_INVERTED 0x8E18
#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19
#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A
#define GL_MAX_CULL_DISTANCES 0x82F9
#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA
#define GL_TEXTURE_TARGET 0x1006
#define GL_QUERY_TARGET 0x82EA
#define GL_TEXTURE_BINDING 0x82EB
#define GL_GUILTY_CONTEXT_RESET 0x8253
#define GL_INNOCENT_CONTEXT_RESET 0x8254
#define GL_UNKNOWN_CONTEXT_RESET 0x8255
#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
#define GL_LOSE_CONTEXT_ON_RESET 0x8252
#define GL_NO_RESET_NOTIFICATION 0x8261
#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC
typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizei size, const void *data, GLenum usage);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, const void *data);
typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access);
typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer);
typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params);
typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, void *data);
typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src);
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target);
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures);
typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer);
typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params);
typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param);
typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture);
typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture);
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params);
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params);
typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index);
typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer);
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers);
typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines);
typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers);
typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void);
typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values);
typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values);
typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values);
typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern);
typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth);
GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids);
GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer);
GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size);
GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers);
GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizei size, const void *data, GLenum usage);
GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, const void *data);
GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data);
GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data);
GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access);
GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access);
GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer);
GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length);
GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params);
GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params);
GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, void *data);
GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers);
GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param);
GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf);
GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs);
GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src);
GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments);
GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target);
GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params);
GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers);
GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params);
GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures);
GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer);
GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size);
GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param);
GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param);
GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param);
GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params);
GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params);
GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param);
GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture);
GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture);
GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels);
GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params);
GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params);
GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params);
GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params);
GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays);
GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index);
GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index);
GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer);
GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides);
GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex);
GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor);
GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param);
GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers);
GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines);
GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids);
GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels);
GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void);
GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels);
GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params);
GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v);
GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v);
GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v);
GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values);
GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values);
GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values);
GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern);
GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
GLAPI void APIENTRY glTextureBarrier (void);
#endif
#endif /* GL_VERSION_4_5 */
#ifndef GL_ARB_ES2_compatibility
#define GL_ARB_ES2_compatibility 1
#endif /* GL_ARB_ES2_compatibility */
#ifndef GL_ARB_ES3_1_compatibility
#define GL_ARB_ES3_1_compatibility 1
#endif /* GL_ARB_ES3_1_compatibility */
#ifndef GL_ARB_ES3_compatibility
#define GL_ARB_ES3_compatibility 1
#endif /* GL_ARB_ES3_compatibility */
@@ -2654,6 +2928,10 @@ GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, s
#define GL_ARB_clear_texture 1
#endif /* GL_ARB_clear_texture */
#ifndef GL_ARB_clip_control
#define GL_ARB_clip_control 1
#endif /* GL_ARB_clip_control */
#ifndef GL_ARB_color_buffer_float
#define GL_ARB_color_buffer_float 1
#define GL_RGBA_FLOAT_MODE_ARB 0x8820
@@ -2677,7 +2955,6 @@ GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp);
#ifndef GL_ARB_compute_shader
#define GL_ARB_compute_shader 1
#define GL_COMPUTE_SHADER_BIT 0x00000020
#endif /* GL_ARB_compute_shader */
#ifndef GL_ARB_compute_variable_group_size
@@ -2692,6 +2969,10 @@ GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint n
#endif
#endif /* GL_ARB_compute_variable_group_size */
#ifndef GL_ARB_conditional_render_inverted
#define GL_ARB_conditional_render_inverted 1
#endif /* GL_ARB_conditional_render_inverted */
#ifndef GL_ARB_conservative_depth
#define GL_ARB_conservative_depth 1
#endif /* GL_ARB_conservative_depth */
@@ -2706,6 +2987,10 @@ GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint n
#define GL_ARB_copy_image 1
#endif /* GL_ARB_copy_image */
#ifndef GL_ARB_cull_distance
#define GL_ARB_cull_distance 1
#endif /* GL_ARB_cull_distance */
#ifndef GL_ARB_debug_output
#define GL_ARB_debug_output 1
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
@@ -2760,6 +3045,14 @@ GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GL
#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
#endif /* GL_ARB_depth_texture */
#ifndef GL_ARB_derivative_control
#define GL_ARB_derivative_control 1
#endif /* GL_ARB_derivative_control */
#ifndef GL_ARB_direct_state_access
#define GL_ARB_direct_state_access 1
#endif /* GL_ARB_direct_state_access */
#ifndef GL_ARB_draw_buffers
#define GL_ARB_draw_buffers 1
#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
@@ -3018,6 +3311,10 @@ GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachmen
#define GL_ARB_get_program_binary 1
#endif /* GL_ARB_get_program_binary */
#ifndef GL_ARB_get_texture_sub_image
#define GL_ARB_get_texture_sub_image 1
#endif /* GL_ARB_get_texture_sub_image */
#ifndef GL_ARB_gpu_shader5
#define GL_ARB_gpu_shader5 1
#endif /* GL_ARB_gpu_shader5 */
@@ -3405,6 +3702,20 @@ GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *par
#define GL_ARB_occlusion_query2 1
#endif /* GL_ARB_occlusion_query2 */
#ifndef GL_ARB_pipeline_statistics_query
#define GL_ARB_pipeline_statistics_query 1
#define GL_VERTICES_SUBMITTED_ARB 0x82EE
#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF
#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0
#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1
#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2
#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3
#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4
#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5
#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6
#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7
#endif /* GL_ARB_pipeline_statistics_query */
#ifndef GL_ARB_pixel_buffer_object
#define GL_ARB_pixel_buffer_object 1
#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
@@ -3696,6 +4007,10 @@ GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GL
#define GL_ARB_shader_subroutine 1
#endif /* GL_ARB_shader_subroutine */
#ifndef GL_ARB_shader_texture_image_samples
#define GL_ARB_shader_texture_image_samples 1
#endif /* GL_ARB_shader_texture_image_samples */
#ifndef GL_ARB_shader_texture_lod
#define GL_ARB_shader_texture_lod 1
#endif /* GL_ARB_shader_texture_lod */
@@ -3746,6 +4061,20 @@ GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GL
#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
#endif /* GL_ARB_shadow_ambient */
#ifndef GL_ARB_sparse_buffer
#define GL_ARB_sparse_buffer 1
#define GL_SPARSE_STORAGE_BIT_ARB 0x0400
#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8
typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizei size, GLboolean commit);
typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit);
typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizei size, GLboolean commit);
GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit);
GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit);
#endif
#endif /* GL_ARB_sparse_buffer */
#ifndef GL_ARB_sparse_texture
#define GL_ARB_sparse_texture 1
#define GL_TEXTURE_SPARSE_ARB 0x91A6
@@ -3777,6 +4106,10 @@ GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xo
#define GL_ARB_tessellation_shader 1
#endif /* GL_ARB_tessellation_shader */
#ifndef GL_ARB_texture_barrier
#define GL_ARB_texture_barrier 1
#endif /* GL_ARB_texture_barrier */
#ifndef GL_ARB_texture_border_clamp
#define GL_ARB_texture_border_clamp 1
#define GL_CLAMP_TO_BORDER_ARB 0x812D
@@ -4023,6 +4356,12 @@ GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void
#define GL_ARB_transform_feedback_instanced 1
#endif /* GL_ARB_transform_feedback_instanced */
#ifndef GL_ARB_transform_feedback_overflow_query
#define GL_ARB_transform_feedback_overflow_query 1
#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC
#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED
#endif /* GL_ARB_transform_feedback_overflow_query */
#ifndef GL_ARB_transpose_matrix
#define GL_ARB_transpose_matrix 1
#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
@@ -4043,9 +4382,6 @@ GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m);
#ifndef GL_ARB_uniform_buffer_object
#define GL_ARB_uniform_buffer_object 1
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
#endif /* GL_ARB_uniform_buffer_object */
#ifndef GL_ARB_vertex_array_bgra
@@ -4370,10 +4706,51 @@ GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v);
#endif
#endif /* GL_ARB_window_pos */
#ifndef GL_KHR_blend_equation_advanced
#define GL_KHR_blend_equation_advanced 1
#define GL_MULTIPLY_KHR 0x9294
#define GL_SCREEN_KHR 0x9295
#define GL_OVERLAY_KHR 0x9296
#define GL_DARKEN_KHR 0x9297
#define GL_LIGHTEN_KHR 0x9298
#define GL_COLORDODGE_KHR 0x9299
#define GL_COLORBURN_KHR 0x929A
#define GL_HARDLIGHT_KHR 0x929B
#define GL_SOFTLIGHT_KHR 0x929C
#define GL_DIFFERENCE_KHR 0x929E
#define GL_EXCLUSION_KHR 0x92A0
#define GL_HSL_HUE_KHR 0x92AD
#define GL_HSL_SATURATION_KHR 0x92AE
#define GL_HSL_COLOR_KHR 0x92AF
#define GL_HSL_LUMINOSITY_KHR 0x92B0
typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlendBarrierKHR (void);
#endif
#endif /* GL_KHR_blend_equation_advanced */
#ifndef GL_KHR_blend_equation_advanced_coherent
#define GL_KHR_blend_equation_advanced_coherent 1
#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
#endif /* GL_KHR_blend_equation_advanced_coherent */
#ifndef GL_KHR_context_flush_control
#define GL_KHR_context_flush_control 1
#endif /* GL_KHR_context_flush_control */
#ifndef GL_KHR_debug
#define GL_KHR_debug 1
#endif /* GL_KHR_debug */
#ifndef GL_KHR_robust_buffer_access_behavior
#define GL_KHR_robust_buffer_access_behavior 1
#endif /* GL_KHR_robust_buffer_access_behavior */
#ifndef GL_KHR_robustness
#define GL_KHR_robustness 1
#define GL_CONTEXT_ROBUST_ACCESS 0x90F3
#endif /* GL_KHR_robustness */
#ifndef GL_KHR_texture_compression_astc_hdr
#define GL_KHR_texture_compression_astc_hdr 1
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
@@ -4428,11 +4805,11 @@ typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r);
typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords);
typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords);
typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x);
typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y);
typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords);
typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y);
typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z);
typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords);
typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z);
typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w);
typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s);
@@ -4451,11 +4828,11 @@ GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r);
GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords);
GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q);
GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords);
GLAPI void APIENTRY glVertex2bOES (GLbyte x);
GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y);
GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords);
GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y);
GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z);
GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords);
GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z);
GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w);
GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords);
#endif
#endif /* GL_OES_byte_coordinates */
@@ -4803,6 +5180,113 @@ GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRG
#endif
#endif /* GL_AMD_draw_buffers_blend */
#ifndef GL_AMD_gcn_shader
#define GL_AMD_gcn_shader 1
#endif /* GL_AMD_gcn_shader */
#ifndef GL_AMD_gpu_shader_int64
#define GL_AMD_gpu_shader_int64 1
typedef int64_t GLint64EXT;
#define GL_INT64_NV 0x140E
#define GL_UNSIGNED_INT64_NV 0x140F
#define GL_INT8_NV 0x8FE0
#define GL_INT8_VEC2_NV 0x8FE1
#define GL_INT8_VEC3_NV 0x8FE2
#define GL_INT8_VEC4_NV 0x8FE3
#define GL_INT16_NV 0x8FE4
#define GL_INT16_VEC2_NV 0x8FE5
#define GL_INT16_VEC3_NV 0x8FE6
#define GL_INT16_VEC4_NV 0x8FE7
#define GL_INT64_VEC2_NV 0x8FE9
#define GL_INT64_VEC3_NV 0x8FEA
#define GL_INT64_VEC4_NV 0x8FEB
#define GL_UNSIGNED_INT8_NV 0x8FEC
#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
#define GL_UNSIGNED_INT16_NV 0x8FF0
#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
#define GL_FLOAT16_NV 0x8FF8
#define GL_FLOAT16_VEC2_NV 0x8FF9
#define GL_FLOAT16_VEC3_NV 0x8FFA
#define GL_FLOAT16_VEC4_NV 0x8FFB
typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
#endif /* GL_AMD_gpu_shader_int64 */
#ifndef GL_AMD_interleaved_elements
#define GL_AMD_interleaved_elements 1
#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4
@@ -4965,6 +5449,11 @@ GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);
#define GL_AMD_transform_feedback3_lines_triangles 1
#endif /* GL_AMD_transform_feedback3_lines_triangles */
#ifndef GL_AMD_transform_feedback4
#define GL_AMD_transform_feedback4 1
#define GL_STREAM_RASTERIZATION_AMD 0x91A0
#endif /* GL_AMD_transform_feedback4 */
#ifndef GL_AMD_vertex_shader_layer
#define GL_AMD_vertex_shader_layer 1
#endif /* GL_AMD_vertex_shader_layer */
@@ -7274,6 +7763,10 @@ GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffse
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
#endif
#endif /* GL_EXT_texture_array */
#ifndef GL_EXT_texture_buffer_object
@@ -8289,6 +8782,16 @@ GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum t
#endif
#endif /* GL_NV_bindless_multi_draw_indirect */
#ifndef GL_NV_bindless_multi_draw_indirect_count
#define GL_NV_bindless_multi_draw_indirect_count 1
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
#endif
#endif /* GL_NV_bindless_multi_draw_indirect_count */
#ifndef GL_NV_bindless_texture
#define GL_NV_bindless_texture 1
typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
@@ -8637,12 +9140,10 @@ GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, G
#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
#endif
#endif /* GL_NV_geometry_program4 */
@@ -8721,103 +9222,6 @@ GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint
#ifndef GL_NV_gpu_shader5
#define GL_NV_gpu_shader5 1
typedef int64_t GLint64EXT;
#define GL_INT64_NV 0x140E
#define GL_UNSIGNED_INT64_NV 0x140F
#define GL_INT8_NV 0x8FE0
#define GL_INT8_VEC2_NV 0x8FE1
#define GL_INT8_VEC3_NV 0x8FE2
#define GL_INT8_VEC4_NV 0x8FE3
#define GL_INT16_NV 0x8FE4
#define GL_INT16_VEC2_NV 0x8FE5
#define GL_INT16_VEC3_NV 0x8FE6
#define GL_INT16_VEC4_NV 0x8FE7
#define GL_INT64_VEC2_NV 0x8FE9
#define GL_INT64_VEC3_NV 0x8FEA
#define GL_INT64_VEC4_NV 0x8FEB
#define GL_UNSIGNED_INT8_NV 0x8FEC
#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
#define GL_UNSIGNED_INT16_NV 0x8FF0
#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
#define GL_FLOAT16_NV 0x8FF8
#define GL_FLOAT16_VEC2_NV 0x8FF9
#define GL_FLOAT16_VEC3_NV 0x8FFA
#define GL_FLOAT16_VEC4_NV 0x8FFB
typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x);
GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y);
GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x);
GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y);
GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params);
GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x);
GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value);
GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x);
GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
#endif /* GL_NV_gpu_shader5 */
#ifndef GL_NV_half_float
@@ -9118,6 +9522,40 @@ GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindi
#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
#define GL_PRIMARY_COLOR_NV 0x852C
#define GL_SECONDARY_COLOR_NV 0x852D
#define GL_ROUNDED_RECT_NV 0xE8
#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9
#define GL_ROUNDED_RECT2_NV 0xEA
#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB
#define GL_ROUNDED_RECT4_NV 0xEC
#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED
#define GL_ROUNDED_RECT8_NV 0xEE
#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF
#define GL_RELATIVE_RECT_NV 0xF7
#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368
#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369
#define GL_FONT_UNAVAILABLE_NV 0x936A
#define GL_FONT_UNINTELLIGIBLE_NV 0x936B
#define GL_CONIC_CURVE_TO_NV 0x1A
#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B
#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000
#define GL_STANDARD_FONT_FORMAT_NV 0x936C
#define GL_2_BYTES_NV 0x1407
#define GL_3_BYTES_NV 0x1408
#define GL_4_BYTES_NV 0x1409
#define GL_EYE_LINEAR_NV 0x2400
#define GL_OBJECT_LINEAR_NV 0x2401
#define GL_CONSTANT_NV 0x8576
#define GL_PATH_PROJECTION_NV 0x1701
#define GL_PATH_MODELVIEW_NV 0x1700
#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3
#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6
#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36
#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3
#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4
#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7
#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38
#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4
#define GL_FRAGMENT_INPUT_NV 0x936D
typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range);
typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path);
@@ -9167,6 +9605,21 @@ typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint
typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m);
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range);
GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
@@ -9217,6 +9670,21 @@ GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloa
GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y);
GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments);
GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m);
GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
#endif
#endif /* GL_NV_path_rendering */
@@ -9385,6 +9853,10 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname,
#define GL_NV_shader_atomic_float 1
#endif /* GL_NV_shader_atomic_float */
#ifndef GL_NV_shader_atomic_int64
#define GL_NV_shader_atomic_int64 1
#endif /* GL_NV_shader_atomic_int64 */
#ifndef GL_NV_shader_buffer_load
#define GL_NV_shader_buffer_load 1
#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
@@ -9401,7 +9873,6 @@ typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer,
typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result);
typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value);
typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#ifdef GL_GLEXT_PROTOTYPES
@@ -9416,7 +9887,6 @@ GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pnam
GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result);
GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value);
GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value);
GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params);
GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value);
GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
#endif
@@ -9656,7 +10126,7 @@ GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenu
#define GL_SKIP_COMPONENTS1_NV -6
typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode);
typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
@@ -9669,7 +10139,7 @@ typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei coun
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
GLAPI void APIENTRY glEndTransformFeedbackNV (void);
GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode);
GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);

View File

@@ -518,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

@@ -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: 25407 $ on $Date: 2014-02-18 16:51:56 -0800 (Tue, 18 Feb 2014) $
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $
*/
#define GLX_GLXEXT_VERSION 20140218
#define GLX_GLXEXT_VERSION 20140810
/* Generated C header for:
* API: glx
@@ -158,6 +158,13 @@ __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#endif
#endif /* GLX_VERSION_1_4 */
#ifndef GLX_ARB_context_flush_control
#define GLX_ARB_context_flush_control 1
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
#endif /* GLX_ARB_context_flush_control */
#ifndef GLX_ARB_create_context
#define GLX_ARB_create_context 1
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
@@ -290,6 +297,23 @@ void glXFreeContextEXT (Display *dpy, GLXContext context);
#endif
#endif /* GLX_EXT_import_context */
#ifndef GLX_EXT_stereo_tree
#define GLX_EXT_stereo_tree 1
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
int extension;
int evtype;
GLXDrawable window;
Bool stereo_tree;
} GLXStereoNotifyEventEXT;
#define GLX_STEREO_TREE_EXT 0x20F5
#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
#define GLX_STEREO_NOTIFY_EXT 0x00000000
#endif /* GLX_EXT_stereo_tree */
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#define GLX_SWAP_INTERVAL_EXT 0x20F1
@@ -451,6 +475,16 @@ Bool glXSet3DfxModeMESA (int mode);
#endif
#endif /* GLX_MESA_set_3dfx_mode */
#ifndef GLX_NV_copy_buffer
#define GLX_NV_copy_buffer 1
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
#ifdef GLX_GLXEXT_PROTOTYPES
void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
#endif
#endif /* GLX_NV_copy_buffer */
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
@@ -527,8 +561,8 @@ void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV devic
#endif
#endif /* GLX_NV_video_capture */
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
typedef unsigned int GLXVideoDeviceNV;
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
@@ -554,7 +588,7 @@ int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#endif /* GLX_NV_video_output */
#endif /* GLX_NV_video_out */
#ifndef GLX_OML_swap_method
#define GLX_OML_swap_method 1

View File

@@ -1005,7 +1005,7 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 8
#define __DRI_IMAGE_VERSION 10
/**
* These formats correspond to the similarly named MESA_FORMAT_*
@@ -1133,6 +1133,20 @@ enum __DRIChromaSiting {
#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3
/*@}*/
/**
* \name Capabilities that might be returned by __DRIimageExtensionRec::getCapabilities
*/
/*@{*/
#define __DRI_IMAGE_CAP_GLOBAL_NAMES 1
/*@}*/
/**
* blitImage flags
*/
#define __BLIT_FLAG_FLUSH 0x0001
#define __BLIT_FLAG_FINISH 0x0002
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
@@ -1239,6 +1253,29 @@ struct __DRIimageExtensionRec {
enum __DRIChromaSiting vert_siting,
unsigned *error,
void *loaderPrivate);
/**
* Blit a part of a __DRIimage to another and flushes
*
* flush_flag:
* 0: no flush
* __BLIT_FLAG_FLUSH: flush after the blit operation
* __BLIT_FLAG_FINISH: flush and wait the blit finished
*
* \since 9
*/
void (*blitImage)(__DRIcontext *context, __DRIimage *dst, __DRIimage *src,
int dstx0, int dsty0, int dstwidth, int dstheight,
int srcx0, int srcy0, int srcwidth, int srcheight,
int flush_flag);
/**
* Query for general capabilities of the driver that concern
* buffer sharing and image importing.
*
* \since 10
*/
int (*getCapabilities)(__DRIscreen *screen);
};
@@ -1272,9 +1309,9 @@ typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
struct __DRI2configQueryExtensionRec {
__DRIextension base;
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
int (*configQueryb)(__DRIscreen *screen, const char *var, unsigned char *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, int *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, float *val);
};
/**

File diff suppressed because it is too large Load Diff

View File

@@ -33,14 +33,14 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 25922 $ on $Date: 2014-03-17 03:54:32 -0700 (Mon, 17 Mar 2014) $
** Khronos $Revision: 28335 $ on $Date: 2014-09-26 18:55:45 -0700 (Fri, 26 Sep 2014) $
*/
#ifndef GL_APIENTRYP
#define GL_APIENTRYP GL_APIENTRY*
#endif
/* Generated on date 20140317 */
/* Generated on date 20140926 */
/* Generated C header for:
* API: gles2
@@ -54,7 +54,6 @@ extern "C" {
#ifndef GL_KHR_blend_equation_advanced
#define GL_KHR_blend_equation_advanced 1
#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
#define GL_MULTIPLY_KHR 0x9294
#define GL_SCREEN_KHR 0x9295
#define GL_OVERLAY_KHR 0x9296
@@ -76,6 +75,17 @@ GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
#endif
#endif /* GL_KHR_blend_equation_advanced */
#ifndef GL_KHR_blend_equation_advanced_coherent
#define GL_KHR_blend_equation_advanced_coherent 1
#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
#endif /* GL_KHR_blend_equation_advanced_coherent */
#ifndef GL_KHR_context_flush_control
#define GL_KHR_context_flush_control 1
#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC
#endif /* GL_KHR_context_flush_control */
#ifndef GL_KHR_debug
#define GL_KHR_debug 1
typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
@@ -145,6 +155,34 @@ GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
#endif
#endif /* GL_KHR_debug */
#ifndef GL_KHR_robust_buffer_access_behavior
#define GL_KHR_robust_buffer_access_behavior 1
#endif /* GL_KHR_robust_buffer_access_behavior */
#ifndef GL_KHR_robustness
#define GL_KHR_robustness 1
#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3
#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252
#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253
#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254
#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255
#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256
#define GL_NO_RESET_NOTIFICATION_KHR 0x8261
#define GL_CONTEXT_LOST_KHR 0x0507
typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void);
typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void);
GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params);
GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params);
#endif
#endif /* GL_KHR_robustness */
#ifndef GL_KHR_texture_compression_astc_hdr
#define GL_KHR_texture_compression_astc_hdr 1
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
@@ -200,6 +238,10 @@ GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum targe
#define GL_SAMPLER_EXTERNAL_OES 0x8D66
#endif /* GL_OES_EGL_image_external */
#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
#define GL_OES_compressed_ETC1_RGB8_sub_texture 1
#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_OES_compressed_ETC1_RGB8_texture 1
#define GL_ETC1_RGB8_OES 0x8D64
@@ -512,6 +554,10 @@ GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLen
#define GL_Z400_BINARY_AMD 0x8740
#endif /* GL_AMD_program_binary_Z400 */
#ifndef GL_ANDROID_extension_pack_es31a
#define GL_ANDROID_extension_pack_es31a 1
#endif /* GL_ANDROID_extension_pack_es31a */
#ifndef GL_ANGLE_depth_texture
#define GL_ANGLE_depth_texture 1
#endif /* GL_ANGLE_depth_texture */
@@ -587,6 +633,23 @@ GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLs
#endif
#endif /* GL_ANGLE_translated_shader_source */
#ifndef GL_APPLE_clip_distance
#define GL_APPLE_clip_distance 1
#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32
#define GL_CLIP_DISTANCE0_APPLE 0x3000
#define GL_CLIP_DISTANCE1_APPLE 0x3001
#define GL_CLIP_DISTANCE2_APPLE 0x3002
#define GL_CLIP_DISTANCE3_APPLE 0x3003
#define GL_CLIP_DISTANCE4_APPLE 0x3004
#define GL_CLIP_DISTANCE5_APPLE 0x3005
#define GL_CLIP_DISTANCE6_APPLE 0x3006
#define GL_CLIP_DISTANCE7_APPLE 0x3007
#endif /* GL_APPLE_clip_distance */
#ifndef GL_APPLE_color_buffer_packed_float
#define GL_APPLE_color_buffer_packed_float 1
#endif /* GL_APPLE_color_buffer_packed_float */
#ifndef GL_APPLE_copy_texture_levels
#define GL_APPLE_copy_texture_levels 1
typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
@@ -667,6 +730,14 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
#endif /* GL_APPLE_texture_max_level */
#ifndef GL_APPLE_texture_packed_float
#define GL_APPLE_texture_packed_float 1
#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B
#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E
#define GL_R11F_G11F_B10F_APPLE 0x8C3A
#define GL_RGB9_E5_APPLE 0x8C3D
#endif /* GL_APPLE_texture_packed_float */
#ifndef GL_ARM_mali_program_binary
#define GL_ARM_mali_program_binary 1
#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61
@@ -691,6 +762,13 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
#ifndef GL_DMP_program_binary
#define GL_DMP_program_binary 1
#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251
#define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252
#define GL_DMP_PROGRAM_BINARY_DMP 0x9253
#endif /* GL_DMP_program_binary */
#ifndef GL_DMP_shader_binary
#define GL_DMP_shader_binary 1
#define GL_SHADER_BINARY_DMP 0x9250
@@ -712,6 +790,14 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
#endif /* GL_EXT_color_buffer_half_float */
#ifndef GL_EXT_copy_image
#define GL_EXT_copy_image 1
typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
#endif
#endif /* GL_EXT_copy_image */
#ifndef GL_EXT_debug_label
#define GL_EXT_debug_label 1
#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
@@ -829,6 +915,30 @@ GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
#endif
#endif /* GL_EXT_draw_buffers */
#ifndef GL_EXT_draw_buffers_indexed
#define GL_EXT_draw_buffers_indexed 1
#define GL_MIN 0x8007
#define GL_MAX 0x8008
typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index);
typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index);
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode);
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst);
typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index);
GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index);
GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode);
GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst);
GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index);
#endif
#endif /* GL_EXT_draw_buffers_indexed */
#ifndef GL_EXT_draw_instanced
#define GL_EXT_draw_instanced 1
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
@@ -839,6 +949,55 @@ GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei cou
#endif
#endif /* GL_EXT_draw_instanced */
#ifndef GL_EXT_geometry_point_size
#define GL_EXT_geometry_point_size 1
#endif /* GL_EXT_geometry_point_size */
#ifndef GL_EXT_geometry_shader
#define GL_EXT_geometry_shader 1
#define GL_GEOMETRY_SHADER_EXT 0x8DD9
#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004
#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916
#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917
#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918
#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F
#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E
#define GL_LINES_ADJACENCY_EXT 0x000A
#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C
#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32
#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123
#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF
#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5
#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD
#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7
#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
#define GL_UNDEFINED_VERTEX_EXT 0x8260
#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312
#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
#endif
#endif /* GL_EXT_geometry_shader */
#ifndef GL_EXT_gpu_shader5
#define GL_EXT_gpu_shader5 1
#endif /* GL_EXT_gpu_shader5 */
#ifndef GL_EXT_instanced_arrays
#define GL_EXT_instanced_arrays 1
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE
@@ -911,12 +1070,23 @@ GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLi
#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
#endif /* GL_EXT_occlusion_query_boolean */
#ifndef GL_EXT_primitive_bounding_box
#define GL_EXT_primitive_bounding_box 1
#define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE
typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
#endif
#endif /* GL_EXT_primitive_bounding_box */
#ifndef GL_EXT_pvrtc_sRGB
#define GL_EXT_pvrtc_sRGB 1
#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1
#endif /* GL_EXT_pvrtc_sRGB */
#ifndef GL_EXT_read_format_bgra
@@ -1064,10 +1234,18 @@ GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLin
#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
#endif /* GL_EXT_shader_framebuffer_fetch */
#ifndef GL_EXT_shader_implicit_conversions
#define GL_EXT_shader_implicit_conversions 1
#endif /* GL_EXT_shader_implicit_conversions */
#ifndef GL_EXT_shader_integer_mix
#define GL_EXT_shader_integer_mix 1
#endif /* GL_EXT_shader_integer_mix */
#ifndef GL_EXT_shader_io_blocks
#define GL_EXT_shader_io_blocks 1
#endif /* GL_EXT_shader_io_blocks */
#ifndef GL_EXT_shader_pixel_local_storage
#define GL_EXT_shader_pixel_local_storage 1
#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63
@@ -1087,6 +1265,109 @@ GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLin
#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
#endif /* GL_EXT_shadow_samplers */
#ifndef GL_EXT_tessellation_point_size
#define GL_EXT_tessellation_point_size 1
#endif /* GL_EXT_tessellation_point_size */
#ifndef GL_EXT_tessellation_shader
#define GL_EXT_tessellation_shader 1
#define GL_PATCHES_EXT 0x000E
#define GL_PATCH_VERTICES_EXT 0x8E72
#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75
#define GL_TESS_GEN_MODE_EXT 0x8E76
#define GL_TESS_GEN_SPACING_EXT 0x8E77
#define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78
#define GL_TESS_GEN_POINT_MODE_EXT 0x8E79
#define GL_ISOLINES_EXT 0x8E7A
#define GL_QUADS_EXT 0x0007
#define GL_FRACTIONAL_ODD_EXT 0x8E7B
#define GL_FRACTIONAL_EVEN_EXT 0x8E7C
#define GL_MAX_PATCH_VERTICES_EXT 0x8E7D
#define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E
#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F
#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80
#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81
#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82
#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83
#define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84
#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85
#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86
#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89
#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A
#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C
#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D
#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E
#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F
#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD
#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE
#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3
#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4
#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB
#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC
#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8
#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9
#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
#define GL_IS_PER_PATCH_EXT 0x92E7
#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307
#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308
#define GL_TESS_CONTROL_SHADER_EXT 0x8E88
#define GL_TESS_EVALUATION_SHADER_EXT 0x8E87
#define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008
#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010
typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value);
#endif
#endif /* GL_EXT_tessellation_shader */
#ifndef GL_EXT_texture_border_clamp
#define GL_EXT_texture_border_clamp 1
#define GL_TEXTURE_BORDER_COLOR_EXT 0x1004
#define GL_CLAMP_TO_BORDER_EXT 0x812D
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param);
typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param);
typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param);
GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param);
GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params);
#endif
#endif /* GL_EXT_texture_border_clamp */
#ifndef GL_EXT_texture_buffer
#define GL_EXT_texture_buffer 1
#define GL_TEXTURE_BUFFER_EXT 0x8C2A
#define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A
#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F
#define GL_SAMPLER_BUFFER_EXT 0x8DC2
#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
#define GL_IMAGE_BUFFER_EXT 0x9051
#define GL_INT_IMAGE_BUFFER_EXT 0x905C
#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
#define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D
#define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E
typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
#endif
#endif /* GL_EXT_texture_buffer */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
@@ -1099,6 +1380,19 @@ GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLin
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#endif /* GL_EXT_texture_compression_s3tc */
#ifndef GL_EXT_texture_cube_map_array
#define GL_EXT_texture_cube_map_array 1
#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009
#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A
#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D
#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E
#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F
#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
#endif /* GL_EXT_texture_cube_map_array */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
@@ -1161,6 +1455,19 @@ GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#endif /* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_view
#define GL_EXT_texture_view 1
#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB
#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC
#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD
#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE
#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
#endif
#endif /* GL_EXT_texture_view */
#ifndef GL_EXT_unpack_subimage
#define GL_EXT_unpack_subimage 1
#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2

View File

@@ -7,4 +7,4 @@
// 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
// are no longer core parts of mesa

View File

@@ -296,7 +296,7 @@ static void impl_tss_dtor_invoke()
static inline void
call_once(once_flag *flag, void (*func)(void))
{
assert(!flag && !func);
assert(flag && func);
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
{
struct impl_call_once_param param;

View File

@@ -0,0 +1,101 @@
/*
* Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* 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 AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _D3DADAPTER9_H_
#define _D3DADAPTER9_H_
#include "present.h"
#ifndef __cplusplus
/* Representation of an adapter group, although since this is implemented by
* the driver, it knows nothing about the windowing system it's on */
typedef struct ID3DAdapter9Vtbl
{
/* IUnknown */
HRESULT (WINAPI *QueryInterface)(ID3DAdapter9 *This, REFIID riid, void **ppvObject);
ULONG (WINAPI *AddRef)(ID3DAdapter9 *This);
ULONG (WINAPI *Release)(ID3DAdapter9 *This);
/* ID3DAdapter9 */
HRESULT (WINAPI *GetAdapterIdentifier)(ID3DAdapter9 *This, DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier);
HRESULT (WINAPI *CheckDeviceType)(ID3DAdapter9 *This, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
HRESULT (WINAPI *CheckDeviceFormat)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
HRESULT (WINAPI *CheckDeviceMultiSampleType)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels);
HRESULT (WINAPI *CheckDepthStencilMatch)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
HRESULT (WINAPI *CheckDeviceFormatConversion)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
HRESULT (WINAPI *GetDeviceCaps)(ID3DAdapter9 *This, D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps);
HRESULT (WINAPI *CreateDevice)(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3D9 *pD3D9, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9 **ppReturnedDeviceInterface);
HRESULT (WINAPI *CreateDeviceEx)(ID3DAdapter9 *This, UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3D9Ex *pD3D9Ex, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9Ex **ppReturnedDeviceInterface);
} ID3DAdapter9Vtbl;
struct ID3DAdapter9
{
ID3DAdapter9Vtbl *lpVtbl;
};
/* IUnknown macros */
#define ID3DAdapter9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DAdapter9_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ID3DAdapter9_Release(p) (p)->lpVtbl->Release(p)
/* ID3DAdapter9 macros */
#define ID3DAdapter9_GetAdapterIdentifier(p,a,b) (p)->lpVtbl->GetAdapterIdentifier(p,a,b)
#define ID3DAdapter9_CheckDeviceType(p,a,b,c,d) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d)
#define ID3DAdapter9_CheckDeviceFormat(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e)
#define ID3DAdapter9_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e)
#define ID3DAdapter9_CheckDepthStencilMatch(p,a,b,c,d) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d)
#define ID3DAdapter9_CheckDeviceFormatConversion(p,a,b,c) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c)
#define ID3DAdapter9_GetDeviceCaps(p,a,b) (p)->lpVtbl->GetDeviceCaps(p,a,b)
#define ID3DAdapter9_CreateDevice(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f,g,h)
#define ID3DAdapter9_CreateDeviceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g,h,i)
#else /* __cplusplus */
struct ID3DAdapter9 : public IUnknown
{
HRESULT WINAPI GetAdapterIdentifier(DWORD Flags, D3DADAPTER_IDENTIFIER9 *pIdentifier);
HRESULT WINAPI CheckDeviceType(D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
HRESULT WINAPI CheckDeviceFormat(D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
HRESULT WINAPI CheckDeviceMultiSampleType(D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQualityLevels);
HRESULT WINAPI CheckDepthStencilMatch(D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
HRESULT WINAPI CheckDeviceFormatConversion(D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
HRESULT WINAPI GetDeviceCaps(D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps);
HRESULT WINAPI CreateDevice(UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3D9 *pD3D9, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9 **ppReturnedDeviceInterface);
HRESULT WINAPI CreateDeviceEx(UINT RealAdapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode, IDirect3D9Ex *pD3D9Ex, ID3DPresentGroup *pPresentationFactory, IDirect3DDevice9Ex **ppReturnedDeviceInterface);
};
#endif /* __cplusplus */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* acquire a const struct D3DAdapter9* structure describing the interface
* queried. See */
const void * WINAPI
D3DAdapter9GetProc( const char *name );
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _D3DADAPTER9_H_ */

44
include/d3dadapter/drm.h Normal file
View File

@@ -0,0 +1,44 @@
/*
* Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* 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 AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _D3DADAPTER9_DRM_H_
#define _D3DADAPTER9_DRM_H_
#include "d3dadapter9.h"
/* query driver support name */
#define D3DADAPTER9DRM_NAME "drm"
/* current version */
#define D3DADAPTER9DRM_MAJOR 0
#define D3DADAPTER9DRM_MINOR 0
struct D3DAdapter9DRM
{
unsigned major_version; /* ABI break */
unsigned minor_version; /* backwards compatible feature additions */
/* NOTE: upon passing an fd to this function, it's now owned by this
function. If this function fails, the fd will be closed here as well */
HRESULT (WINAPI *create_adapter)(int fd, ID3DAdapter9 **ppAdapter);
};
#endif /* _D3DADAPTER9_DRM_H_ */

View File

@@ -0,0 +1,136 @@
/*
* Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* 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 AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _D3DADAPTER_PRESENT_H_
#define _D3DADAPTER_PRESENT_H_
#include <d3d9.h>
#ifndef D3DOK_WINDOW_OCCLUDED
#define D3DOK_WINDOW_OCCLUDED MAKE_D3DSTATUS(2531)
#endif /* D3DOK_WINDOW_OCCLUDED */
#ifndef __cplusplus
typedef struct ID3DPresent ID3DPresent;
typedef struct ID3DPresentGroup ID3DPresentGroup;
typedef struct ID3DAdapter9 ID3DAdapter9;
typedef struct D3DWindowBuffer D3DWindowBuffer;
/* Presentation backend for drivers to display their brilliant work */
typedef struct ID3DPresentVtbl
{
/* IUnknown */
HRESULT (WINAPI *QueryInterface)(ID3DPresent *This, REFIID riid, void **ppvObject);
ULONG (WINAPI *AddRef)(ID3DPresent *This);
ULONG (WINAPI *Release)(ID3DPresent *This);
/* ID3DPresent */
/* This function initializes the screen and window provided at creation.
* Hence why this should always be called as the one of first things a new
* swap chain does */
HRESULT (WINAPI *SetPresentParameters)(ID3DPresent *This, D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode);
/* Make a buffer visible to the window system via dma-buf fd.
* For better compatibility, it must be 32bpp and format ARGB/XRGB */
HRESULT (WINAPI *NewD3DWindowBufferFromDmaBuf)(ID3DPresent *This, int dmaBufFd, int width, int height, int stride, int depth, int bpp, D3DWindowBuffer **out);
HRESULT (WINAPI *DestroyD3DWindowBuffer)(ID3DPresent *This, D3DWindowBuffer *buffer);
/* After presenting a buffer to the window system, the buffer
* may be used as is (no copy of the content) by the window system.
* You must not use a non-released buffer, else the user may see undefined content. */
HRESULT (WINAPI *WaitBufferReleased)(ID3DPresent *This, D3DWindowBuffer *buffer);
HRESULT (WINAPI *FrontBufferCopy)(ID3DPresent *This, D3DWindowBuffer *buffer);
/* It is possible to do partial copy, but impossible to do resizing, which must
* be done by the client after checking the front buffer size */
HRESULT (WINAPI *PresentBuffer)(ID3DPresent *This, D3DWindowBuffer *buffer, HWND hWndOverride, const RECT *pSourceRect, const RECT *pDestRect, const RGNDATA *pDirtyRegion, DWORD Flags);
HRESULT (WINAPI *GetRasterStatus)(ID3DPresent *This, D3DRASTER_STATUS *pRasterStatus);
HRESULT (WINAPI *GetDisplayMode)(ID3DPresent *This, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation);
HRESULT (WINAPI *GetPresentStats)(ID3DPresent *This, D3DPRESENTSTATS *pStats);
HRESULT (WINAPI *GetCursorPos)(ID3DPresent *This, POINT *pPoint);
HRESULT (WINAPI *SetCursorPos)(ID3DPresent *This, POINT *pPoint);
/* Cursor size is always 32x32. pBitmap and pHotspot can be NULL. */
HRESULT (WINAPI *SetCursor)(ID3DPresent *This, void *pBitmap, POINT *pHotspot, BOOL bShow);
HRESULT (WINAPI *SetGammaRamp)(ID3DPresent *This, const D3DGAMMARAMP *pRamp, HWND hWndOverride);
HRESULT (WINAPI *GetWindowInfo)(ID3DPresent *This, HWND hWnd, int *width, int *height, int *depth);
} ID3DPresentVtbl;
struct ID3DPresent
{
ID3DPresentVtbl *lpVtbl;
};
/* IUnknown macros */
#define ID3DPresent_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DPresent_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ID3DPresent_Release(p) (p)->lpVtbl->Release(p)
/* ID3DPresent macros */
#define ID3DPresent_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a)
#define ID3DPresent_SetPresentParameters(p,a,b) (p)->lpVtbl->SetPresentParameters(p,a,b)
#define ID3DPresent_NewD3DWindowBufferFromDmaBuf(p,a,b,c,d,e,f,g) (p)->lpVtbl->NewD3DWindowBufferFromDmaBuf(p,a,b,c,d,e,f,g)
#define ID3DPresent_DestroyD3DWindowBuffer(p,a) (p)->lpVtbl->DestroyD3DWindowBuffer(p,a)
#define ID3DPresent_WaitBufferReleased(p,a) (p)->lpVtbl->WaitBufferReleased(p,a)
#define ID3DPresent_FrontBufferCopy(p,a) (p)->lpVtbl->FrontBufferCopy(p,a)
#define ID3DPresent_PresentBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->PresentBuffer(p,a,b,c,d,e,f)
#define ID3DPresent_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a)
#define ID3DPresent_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b)
#define ID3DPresent_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a)
#define ID3DPresent_GetCursorPos(p,a) (p)->lpVtbl->GetCursorPos(p,a)
#define ID3DPresent_SetCursorPos(p,a) (p)->lpVtbl->SetCursorPos(p,a)
#define ID3DPresent_SetCursor(p,a,b,c) (p)->lpVtbl->SetCursor(p,a,b,c)
#define ID3DPresent_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b)
#define ID3DPresent_GetWindowInfo(p,a,b,c,d) (p)->lpVtbl->GetWindowSize(p,a,b,c,d)
typedef struct ID3DPresentGroupVtbl
{
/* IUnknown */
HRESULT (WINAPI *QueryInterface)(ID3DPresentGroup *This, REFIID riid, void **ppvObject);
ULONG (WINAPI *AddRef)(ID3DPresentGroup *This);
ULONG (WINAPI *Release)(ID3DPresentGroup *This);
/* ID3DPresentGroup */
/* When creating a device, it's relevant for the driver to know how many
* implicit swap chains to create. It has to create one per monitor in a
* multi-monitor setup */
UINT (WINAPI *GetMultiheadCount)(ID3DPresentGroup *This);
/* returns only the implicit present interfaces */
HRESULT (WINAPI *GetPresent)(ID3DPresentGroup *This, UINT Index, ID3DPresent **ppPresent);
/* used to create additional presentation interfaces along the way */
HRESULT (WINAPI *CreateAdditionalPresent)(ID3DPresentGroup *This, D3DPRESENT_PARAMETERS *pPresentationParameters, ID3DPresent **ppPresent);
void (WINAPI *GetVersion) (ID3DPresentGroup *This, int *major, int *minor);
} ID3DPresentGroupVtbl;
struct ID3DPresentGroup
{
ID3DPresentGroupVtbl *lpVtbl;
};
/* IUnknown macros */
#define ID3DPresentGroup_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DPresentGroup_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ID3DPresentGroup_Release(p) (p)->lpVtbl->Release(p)
/* ID3DPresentGroup */
#define ID3DPresentGroup_GetMultiheadCount(p) (p)->lpVtbl->GetMultiheadCount(p)
#define ID3DPresentGroup_GetPresent(p,a,b) (p)->lpVtbl->GetPresent(p,a,b)
#define ID3DPresentGroup_CreateAdditionalPresent(p,a,b) (p)->lpVtbl->CreateAdditionalPresent(p,a,b)
#define ID3DPresentGroup_GetVersion(p,a,b) (p)->lpVtbl->GetVersion(p,a,b)
#endif /* __cplusplus */
#endif /* _D3DADAPTER_PRESENT_H_ */

View File

@@ -91,24 +91,24 @@ 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")
CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x1612, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x1616, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161E, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x1622, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x1626, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162A, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162B, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell")
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")

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)
@@ -132,6 +138,7 @@ 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)

View File

@@ -5,7 +5,7 @@ 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)
.libs/install-gallium-links : $(dri_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 \
@@ -13,7 +13,6 @@ all-local : .libs/install-gallium-links
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 \

View File

@@ -3,16 +3,20 @@
if BUILD_SHARED
if HAVE_COMPAT_SYMLINKS
all-local : .libs/install-mesa-links
all-local : .install-mesa-links
.libs/install-mesa-links : $(lib_LTLIBRARIES)
.install-mesa-links : $(lib_LTLIBRARIES)
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
for f in $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); do \
for f in $(join $(addsuffix .libs/,$(dir $(lib_LTLIBRARIES))),$(notdir $(lib_LTLIBRARIES:%.la=%.$(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 $@
clean-local:
$(RM) .install-mesa-links
endif
endif

78
m4/ax_check_gnu_make.m4 Normal file
View File

@@ -0,0 +1,78 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_GNU_MAKE()
#
# DESCRIPTION
#
# This macro searches for a GNU version of make. If a match is found, the
# makefile variable `ifGNUmake' is set to the empty string, otherwise it
# is set to "#". This is useful for including a special features in a
# Makefile, which cannot be handled by other versions of make. The
# variable _cv_gnu_make_command is set to the command to invoke GNU make
# if it exists, the empty string otherwise.
#
# Here is an example of its use:
#
# Makefile.in might contain:
#
# # A failsafe way of putting a dependency rule into a makefile
# $(DEPEND):
# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
#
# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
# @ifGNUmake@ include $(DEPEND)
# @ifGNUmake@ endif
#
# Then configure.in would normally contain:
#
# AX_CHECK_GNU_MAKE()
# AC_OUTPUT(Makefile)
#
# Then perhaps to cause gnu make to override any other make, we could do
# something like this (note that GNU make always looks for GNUmakefile
# first):
#
# if ! test x$_cv_gnu_make_command = x ; then
# mv Makefile GNUmakefile
# echo .DEFAULT: > Makefile ;
# echo \ $_cv_gnu_make_command \$@ >> Makefile;
# fi
#
# Then, if any (well almost any) other make is called, and GNU make also
# exists, then the other make wraps the GNU make.
#
# LICENSE
#
# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
#
# 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 7
AC_DEFUN([AX_CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
_cv_gnu_make_command='' ;
dnl Search all the common names for GNU make
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
_cv_gnu_make_command=$a ;
break;
fi
done ;
) ;
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
if test "x$_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
else
ifGNUmake='#' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
] )

223
m4/ax_gcc_func_attribute.m4 Normal file
View File

@@ -0,0 +1,223 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
#
# DESCRIPTION
#
# This macro checks if the compiler supports one of GCC's function
# attributes; many other compilers also provide function attributes with
# the same syntax. Compiler warnings are used to detect supported
# attributes as unsupported ones are ignored by default so quieting
# warnings when using this macro will yield false positives.
#
# The ATTRIBUTE parameter holds the name of the attribute to be checked.
#
# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
#
# The macro caches its result in the ax_cv_have_func_attribute_<attribute>
# variable.
#
# The macro currently supports the following function attributes:
#
# alias
# aligned
# alloc_size
# always_inline
# artificial
# cold
# const
# constructor
# deprecated
# destructor
# dllexport
# dllimport
# error
# externally_visible
# flatten
# format
# format_arg
# gnu_inline
# hot
# ifunc
# leaf
# malloc
# noclone
# noinline
# nonnull
# noreturn
# nothrow
# optimize
# packed
# pure
# unused
# used
# visibility
# warning
# warn_unused_result
# weak
# weakref
#
# Unsuppored function attributes will be tested with a prototype returning
# an int and not accepting any arguments 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_FUNC_ATTRIBUTE], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([
m4_case([$1],
[alias], [
int foo( void ) { return 0; }
int bar( void ) __attribute__(($1("foo")));
],
[aligned], [
int foo( void ) __attribute__(($1(32)));
],
[alloc_size], [
void *foo(int a) __attribute__(($1(1)));
],
[always_inline], [
inline __attribute__(($1)) int foo( void ) { return 0; }
],
[artificial], [
inline __attribute__(($1)) int foo( void ) { return 0; }
],
[cold], [
int foo( void ) __attribute__(($1));
],
[const], [
int foo( void ) __attribute__(($1));
],
[constructor], [
int foo( void ) __attribute__(($1));
],
[deprecated], [
int foo( void ) __attribute__(($1("")));
],
[destructor], [
int foo( void ) __attribute__(($1));
],
[dllexport], [
__attribute__(($1)) int foo( void ) { return 0; }
],
[dllimport], [
int foo( void ) __attribute__(($1));
],
[error], [
int foo( void ) __attribute__(($1("")));
],
[externally_visible], [
int foo( void ) __attribute__(($1));
],
[flatten], [
int foo( void ) __attribute__(($1));
],
[format], [
int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
],
[format_arg], [
char *foo(const char *p) __attribute__(($1(1)));
],
[gnu_inline], [
inline __attribute__(($1)) int foo( void ) { return 0; }
],
[hot], [
int foo( void ) __attribute__(($1));
],
[ifunc], [
int my_foo( void ) { return 0; }
static int (*resolve_foo(void))(void) { return my_foo; }
int foo( void ) __attribute__(($1("resolve_foo")));
],
[leaf], [
__attribute__(($1)) int foo( void ) { return 0; }
],
[malloc], [
void *foo( void ) __attribute__(($1));
],
[noclone], [
int foo( void ) __attribute__(($1));
],
[noinline], [
__attribute__(($1)) int foo( void ) { return 0; }
],
[nonnull], [
int foo(char *p) __attribute__(($1(1)));
],
[noreturn], [
void foo( void ) __attribute__(($1));
],
[nothrow], [
int foo( void ) __attribute__(($1));
],
[optimize], [
__attribute__(($1(3))) int foo( void ) { return 0; }
],
[packed], [
struct __attribute__(($1)) foo { int bar; };
],
[pure], [
int foo( void ) __attribute__(($1));
],
[unused], [
int foo( void ) __attribute__(($1));
],
[used], [
int foo( void ) __attribute__(($1));
],
[visibility], [
int foo_def( void ) __attribute__(($1("default")));
int foo_hid( void ) __attribute__(($1("hidden")));
int foo_int( void ) __attribute__(($1("internal")));
int foo_pro( void ) __attribute__(($1("protected")));
],
[warning], [
int foo( void ) __attribute__(($1("")));
],
[warn_unused_result], [
int foo( void ) __attribute__(($1));
],
[weak], [
int foo( void ) __attribute__(($1));
],
[weakref], [
static int foo( void ) { return 0; }
static int bar( void ) __attribute__(($1("foo")));
],
[
m4_warn([syntax], [Unsupported attribute $1, the test may fail])
int foo( void ) __attribute__(($1));
]
)], [])
],
dnl GCC doesn't exit with an error if an unknown attribute is
dnl provided but only outputs a warning, so accept the attribute
dnl only if no warning were issued.
[AS_IF([test -s conftest.err],
[AS_VAR_SET([ac_var], [no])],
[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_FUNC_ATTRIBUTE_$1), 1,
[Define to 1 if the system has the `$1' function attribute])], [])
AS_VAR_POPDEF([ac_var])
])

View File

@@ -41,26 +41,13 @@ import SCons.Builder
import SCons.Tool
import SCons.Util
# This is what we search for to find mingw:
# These are the mingw toolchain prefixes we search for:
# (We only search for the mingw-w64 toolchain, and not the mingw.org one.)
prefixes32 = SCons.Util.Split("""
mingw32-
mingw32msvc-
i386-mingw32-
i486-mingw32-
i586-mingw32-
i686-mingw32-
i386-mingw32msvc-
i486-mingw32msvc-
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
x86_64-w64-mingw32-
amd64-mingw32-
amd64-mingw32msvc-
amd64-pc-mingw32-
""")
def find(env):

View File

@@ -276,6 +276,9 @@ def parse_source_list(env, filename, names=None):
# Prefer relative source paths, as absolute files tend to
# cause duplicate actions.
f = f[len(cur_srcdir + '/'):]
# do not include any headers
if f.endswith('.h'):
continue
srcs.append(f)
src_lists[sym] = srcs

View File

@@ -301,6 +301,10 @@ def generate(env):
cppdefines += ['HAVE_ALIAS']
else:
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
if env['platform'] in ('linux', 'darwin'):
cppdefines += ['HAVE_XLOCALE_H']
if env['platform'] == 'haiku':
cppdefines += [
'HAVE_PTHREAD',
@@ -529,6 +533,10 @@ def generate(env):
else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if env['platform'] == 'windows':
linkflags += [
'-Wl,--nxcompat', # DEP
'-Wl,--dynamicbase', # ASLR
]
# Avoid depending on gcc runtime DLLs
linkflags += ['-static-libgcc']
if 'w64' in env['CC'].split('-'):
@@ -547,6 +555,8 @@ def generate(env):
linkflags += [
'/fixed:no',
'/incremental:no',
'/dynamicbase', # ASLR
'/nxcompat', # DEP
]
env.Append(LINKFLAGS = linkflags)
env.Append(SHLINKFLAGS = shlinkflags)
@@ -577,6 +587,30 @@ def generate(env):
env.Append(CCFLAGS = ['-fopenmp'])
env.Append(LIBS = ['gomp'])
if gcc_compat:
ccversion = env['CCVERSION']
cppdefines += [
'HAVE___BUILTIN_EXPECT',
'HAVE___BUILTIN_FFS',
'HAVE___BUILTIN_FFSLL',
'HAVE_FUNC_ATTRIBUTE_FLATTEN',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3'):
cppdefines += [
'HAVE_FUNC_ATTRIBUTE_FORMAT',
'HAVE_FUNC_ATTRIBUTE_PACKED',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('3.4'):
cppdefines += [
'HAVE___BUILTIN_CTZ',
'HAVE___BUILTIN_POPCOUNT',
'HAVE___BUILTIN_POPCOUNTLL',
'HAVE___BUILTIN_CLZ',
'HAVE___BUILTIN_CLZLL',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.5'):
cppdefines += ['HAVE___BUILTIN_UNREACHABLE']
# Load tools
env.Tool('lex')
env.Tool('yacc')
@@ -587,11 +621,10 @@ def generate(env):
env.Tool('custom')
createInstallMethods(env)
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1'])
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes', 'glproto >= 1.4.13'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
env.PkgCheckModules('DRM', ['libdrm >= 2.4.38'])
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.52'])
env.PkgCheckModules('UDEV', ['libudev >= 151'])
env['dri'] = env['x11'] and env['drm']

View File

@@ -37,6 +37,9 @@ import SCons.Errors
import SCons.Util
required_llvm_version = '3.3'
def generate(env):
env['llvm'] = False
@@ -84,6 +87,9 @@ def generate(env):
if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config
return
if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
return
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.AppendUnique(CPPDEFINES = [
@@ -92,70 +98,18 @@ def generate(env):
'HAVE_STDINT_H',
])
env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
if llvm_version >= distutils.version.LooseVersion('3.2'):
if True:
# 3.2
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMJIT',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMMCJIT', 'LLVMJIT',
'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject'
])
elif llvm_version >= distutils.version.LooseVersion('3.0'):
# 3.0
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMJIT',
'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport'
])
elif llvm_version >= distutils.version.LooseVersion('2.9'):
# 2.9
env.Prepend(LIBS = [
'LLVMObject', 'LLVMMCJIT', 'LLVMMCDisassembler',
'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMSelectionDAG', 'LLVMX86Utils', 'LLVMX86Info', 'LLVMAsmPrinter',
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
'LLVMCore', 'LLVMMC', 'LLVMSupport',
])
elif llvm_version >= distutils.version.LooseVersion('2.7'):
# 2.7
env.Prepend(LIBS = [
'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMSelectionDAG', 'LLVMX86Info', 'LLVMAsmPrinter',
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
'LLVMMC', 'LLVMCore', 'LLVMSupport', 'LLVMSystem',
])
else:
# 2.6
env.Prepend(LIBS = [
'LLVMX86AsmParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMX86Info', 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMDebugger', 'LLVMBitWriter', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAnalysis',
'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport',
'LLVMSystem',
])
env.Append(LIBS = [
'imagehlp',
'psapi',
@@ -180,6 +134,10 @@ def generate(env):
llvm_version = env.backtick('llvm-config --version').rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version)
if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
return
try:
# Treat --cppflags specially to prevent NDEBUG from disabling
# assertion failures in debug builds.
@@ -195,10 +153,7 @@ def generate(env):
if '-fno-rtti' in cxxflags:
env.Append(CXXFLAGS = ['-fno-rtti'])
components = ['engine', 'bitwriter', 'x86asmprinter']
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter']
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')

View File

@@ -19,12 +19,14 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = gtest loader mapi
SUBDIRS = gtest util mapi
if NEED_OPENGL_COMMON
SUBDIRS += glsl mesa
endif
SUBDIRS += loader
if HAVE_DRI_GLX
SUBDIRS += glx
endif
@@ -46,18 +48,7 @@ SUBDIRS += egl/main
endif
if HAVE_GALLIUM
SUBDIRS += \
gallium/auxiliary \
gallium/drivers \
gallium/state_trackers \
gallium/winsys \
gallium/targets
if HAVE_GALLIUM_TESTS
SUBDIRS += \
gallium/tests/trivial \
gallium/tests/unit
endif
SUBDIRS += gallium
endif
EXTRA_DIST = getopt

View File

@@ -4,6 +4,7 @@ Import('*')
if env['platform'] == 'windows':
SConscript('getopt/SConscript')
SConscript('util/SConscript')
SConscript('glsl/SConscript')
if env['hostonly']:

View File

@@ -40,8 +40,12 @@ LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/egl/main \
$(MESA_TOP)/src/loader \
$(TARGET_OUT_HEADERS)/libdrm \
$(DRM_GRALLOC_TOP)
LOCAL_STATIC_LIBRARIES := \
libmesa_loader
LOCAL_MODULE := libmesa_egl_dri2
include $(MESA_COMMON_MK)

View File

@@ -35,7 +35,7 @@
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#ifdef HAVE_DRM_PLATFORM
#ifdef HAVE_LIBDRM
#include <xf86drm.h>
#include <drm_fourcc.h>
#endif
@@ -304,8 +304,6 @@ const __DRIimageLookupExtension image_lookup_extension = {
.lookupEGLImage = dri2_lookup_egl_image
};
static const char dri_driver_path[] = DEFAULT_DRIVER_DIR;
struct dri2_extension_match {
const char *name;
int version;
@@ -360,7 +358,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
for (j = 0; matches[j].name; j++) {
field = ((char *) dri2_dpy + matches[j].offset);
if (*(const __DRIextension **) field == NULL) {
_eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
_eglLog(_EGL_WARNING, "DRI2: did not find extension %s version %d",
matches[j].name, matches[j].version);
ret = EGL_FALSE;
}
@@ -469,9 +467,7 @@ dri2_load_driver_swrast(_EGLDisplay *disp)
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
dri2_dpy->driver_name = "swrast";
extensions = dri2_open_driver(disp);
if (!extensions)
return EGL_FALSE;
@@ -522,7 +518,15 @@ dri2_setup_screen(_EGLDisplay *disp)
}
if (dri2_dpy->image) {
disp->Extensions.MESA_drm_image = EGL_TRUE;
if (dri2_dpy->image->base.version >= 10 &&
dri2_dpy->image->getCapabilities != NULL) {
int capabilities;
capabilities = dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
disp->Extensions.MESA_drm_image = (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
} else
disp->Extensions.MESA_drm_image = EGL_TRUE;
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
if (dri2_dpy->image->base.version >= 5 &&
@@ -539,6 +543,10 @@ dri2_setup_screen(_EGLDisplay *disp)
}
}
/* All platforms but DRM call this function to create the screen, query the
* dri extensions, setup the vtables and populate the driver_configs.
* DRM inherits all that information from its display - GBM.
*/
EGLBoolean
dri2_create_screen(_EGLDisplay *disp)
{
@@ -662,6 +670,7 @@ static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
unsigned i;
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
@@ -673,6 +682,7 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
if (dri2_dpy->driver)
dlclose(dri2_dpy->driver);
free(dri2_dpy->device_name);
free(dri2_dpy->driver_name);
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
@@ -701,6 +711,15 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
break;
}
/* The drm platform does not create the screen/driver_configs but reuses
* the ones from the gbm device. As such the gbm itself is responsible
* for the cleanup.
*/
if (disp->Platform != _EGL_PLATFORM_DRM) {
for (i = 0; dri2_dpy->driver_configs[i]; i++)
free((__DRIconfig *) dri2_dpy->driver_configs[i]);
free(dri2_dpy->driver_configs);
}
free(dri2_dpy);
disp->DriverData = NULL;
@@ -811,8 +830,9 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
api = __DRI_API_GLES3;
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
return NULL;
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
free(dri2_ctx);
return NULL;
}
break;
case EGL_OPENGL_API:
@@ -1388,6 +1408,15 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
}
#endif
static EGLBoolean
dri2_get_sync_values_chromium(_EGLDisplay *dpy, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->get_sync_values(dpy, surf, ust, msc, sbc);
}
/**
* Set the error code after a call to
* dri2_egl_image::dri_image::createImageFromTexture.
@@ -1663,36 +1692,13 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
/**
* The spec says:
*
* "If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT target,
* the EGL takes ownership of the file descriptor and is responsible for
* closing it, which it may do at any time while the EGLDisplay is
* initialized."
* "If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT target, the
* EGL will take a reference to the dma_buf(s) which it will release at any
* time while the EGLDisplay is initialized. It is the responsibility of the
* application to close the dma_buf file descriptors."
*
* Therefore we must never close or otherwise modify the file descriptors.
*/
static void
dri2_take_dma_buf_ownership(const int *fds, unsigned num_fds)
{
int already_closed[num_fds];
unsigned num_closed = 0;
unsigned i, j;
for (i = 0; i < num_fds; ++i) {
/**
* The same file descriptor can be referenced multiple times in case more
* than one plane is found in the same buffer, just with a different
* offset.
*/
for (j = 0; j < num_closed; ++j) {
if (already_closed[j] == fds[i])
break;
}
if (j == num_closed) {
close(fds[i]);
already_closed[num_closed++] = fds[i];
}
}
}
static _EGLImage *
dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
@@ -1755,8 +1761,6 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
return EGL_NO_IMAGE_KHR;
res = dri2_create_image_from_dri(disp, dri_image);
if (res)
dri2_take_dma_buf_ownership(fds, num_fds);
return res;
}
@@ -1991,7 +1995,7 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_display *wl_dpy)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret, flags = 0;
int flags = 0;
uint64_t cap;
(void) drv;
@@ -2002,11 +2006,13 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
wl_drm_callbacks.authenticate =
(int(*)(void *, uint32_t)) dri2_dpy->vtbl->authenticate;
ret = drmGetCap(dri2_dpy->fd, DRM_CAP_PRIME, &cap);
if (ret == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT) &&
#ifdef HAVE_LIBDRM
if (drmGetCap(dri2_dpy->fd, DRM_CAP_PRIME, &cap) == 0 &&
cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT) &&
dri2_dpy->image->base.version >= 7 &&
dri2_dpy->image->createImageFromFds != NULL)
flags |= WAYLAND_DRM_PRIME;
#endif
dri2_dpy->wl_server_drm =
wayland_drm_init(wl_dpy, dri2_dpy->device_name,
@@ -2181,6 +2187,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.UnbindWaylandDisplayWL = dri2_unbind_wayland_display_wl;
dri2_drv->base.API.QueryWaylandBufferWL = dri2_query_wayland_buffer_wl;
#endif
dri2_drv->base.API.GetSyncValuesCHROMIUM = dri2_get_sync_values_chromium;
dri2_drv->base.Name = "DRI2";
dri2_drv->base.Unload = dri2_unload;

View File

@@ -138,6 +138,10 @@ struct dri2_egl_display_vtbl {
struct wl_buffer* (*create_wayland_buffer_from_image)(
_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img);
EGLBoolean (*get_sync_values)(_EGLDisplay *display, _EGLSurface *surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc);
};
struct dri2_egl_display
@@ -180,6 +184,7 @@ struct dri2_egl_display
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
int screen;
#endif
#ifdef HAVE_WAYLAND_PLATFORM

View File

@@ -98,3 +98,11 @@ dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv,
{
return NULL;
}
static inline EGLBoolean
dri2_fallback_get_sync_values(_EGLDisplay *dpy, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
return EGL_FALSE;
}

View File

@@ -54,8 +54,6 @@ get_format_bpp(int native)
bpp = 3;
break;
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
bpp = 2;
break;
default:
@@ -371,8 +369,6 @@ dri2_create_image_android_native_buffer(_EGLDisplay *disp, _EGLContext *ctx,
format = __DRI_IMAGE_FORMAT_XBGR8888;
break;
case HAL_PIXEL_FORMAT_RGB_888:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
/* unsupported */
default:
_eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", buf->format);
@@ -638,7 +634,7 @@ droid_log(EGLint level, const char *msg)
static struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
.create_window_surface = droid_create_window_surface,
.create_pixmap_surface = dri2_fallback_pixmap_surface,
.create_pixmap_surface = dri2_fallback_create_pixmap_surface,
.create_pbuffer_surface = droid_create_pbuffer_surface,
.destroy_surface = droid_destroy_surface,
.create_image = droid_create_image_khr,
@@ -650,6 +646,7 @@ static struct dri2_egl_display_vtbl droid_display_vtbl = {
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean

View File

@@ -44,6 +44,7 @@ lock_front_buffer(struct gbm_surface *_surf)
{
struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf;
struct dri2_egl_surface *dri2_surf = surf->dri_private;
struct gbm_dri_device *device = (struct gbm_dri_device *) _surf->gbm;
struct gbm_bo *bo;
if (dri2_surf->current == NULL) {
@@ -52,8 +53,11 @@ lock_front_buffer(struct gbm_surface *_surf)
}
bo = dri2_surf->current->bo;
dri2_surf->current->locked = 1;
dri2_surf->current = NULL;
if (device->dri2) {
dri2_surf->current->locked = 1;
dri2_surf->current = NULL;
}
return bo;
}
@@ -122,13 +126,22 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
goto cleanup_surf;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
if (dri2_dpy->dri2) {
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
} else {
assert(dri2_dpy->swrast != NULL);
dri2_surf->dri_drawable =
(*dri2_dpy->swrast->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
}
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
_eglError(EGL_BAD_ALLOC, "createNewDrawable()");
goto cleanup_surf;
}
@@ -221,6 +234,28 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
return 0;
}
static int
get_swrast_front_bo(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
if (dri2_surf->current == NULL) {
assert(!dri2_surf->color_buffers[0].locked);
dri2_surf->current = &dri2_surf->color_buffers[0];
}
if (dri2_surf->current->bo == NULL)
dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
surf->base.width, surf->base.height,
surf->base.format, surf->base.flags);
if (dri2_surf->current->bo == NULL)
return -1;
return 0;
}
static void
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
@@ -317,7 +352,7 @@ dri2_drm_get_buffers(__DRIdrawable * driDrawable,
const unsigned int format = 32;
int i;
attachments_with_format = calloc(count * 2, sizeof(unsigned int));
attachments_with_format = calloc(count, 2 * sizeof(unsigned int));
if (!attachments_with_format) {
*out_count = 0;
return NULL;
@@ -374,19 +409,31 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
int i;
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
if (dri2_surf->current)
_eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
dri2_surf->current = dri2_surf->back;
dri2_surf->current->age = 1;
dri2_surf->back = NULL;
}
if (dri2_dpy->swrast) {
(*dri2_dpy->core->swapBuffers)(dri2_surf->dri_drawable);
} else {
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
if (dri2_surf->current)
_eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
/* Make sure we have a back buffer in case we're swapping without
* ever rendering. */
if (get_back_bo(dri2_surf) < 0) {
_eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
return EGL_FALSE;
}
dri2_surf->current = dri2_surf->back;
dri2_surf->current->age = 1;
dri2_surf->back = NULL;
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
}
return EGL_TRUE;
}
@@ -457,6 +504,73 @@ dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
return drmAuthMagic(dri2_dpy->fd, id);
}
static void
swrast_put_image2(__DRIdrawable *driDrawable,
int op,
int x,
int y,
int width,
int height,
int stride,
char *data,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int internal_stride, i;
struct gbm_dri_bo *bo;
if (op != __DRI_SWRAST_IMAGE_OP_DRAW &&
op != __DRI_SWRAST_IMAGE_OP_SWAP)
return;
if (get_swrast_front_bo(dri2_surf) < 0)
return;
bo = gbm_dri_bo(dri2_surf->current->bo);
if (gbm_dri_bo_map(bo) == NULL)
return;
internal_stride = bo->base.base.stride;
for (i = 0; i < height; i++) {
memcpy(bo->map + (x + i) * internal_stride + y,
data + i * stride, stride);
}
gbm_dri_bo_unmap(bo);
}
static void
swrast_get_image(__DRIdrawable *driDrawable,
int x,
int y,
int width,
int height,
char *data,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int internal_stride, stride, i;
struct gbm_dri_bo *bo;
if (get_swrast_front_bo(dri2_surf) < 0)
return;
bo = gbm_dri_bo(dri2_surf->current->bo);
if (gbm_dri_bo_map(bo) == NULL)
return;
internal_stride = bo->base.base.stride;
stride = width * 4;
for (i = 0; i < height; i++) {
memcpy(data + i * stride,
bo->map + (x + i) * internal_stride + y, stride);
}
gbm_dri_bo_unmap(bo);
}
static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.authenticate = dri2_drm_authenticate,
.create_window_surface = dri2_drm_create_window_surface,
@@ -472,6 +586,7 @@ static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_drm_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean
@@ -525,13 +640,14 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->fd = fd;
dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->base.driver_name);
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
dri2_dpy->image = dri2_dpy->gbm_dri->image;
dri2_dpy->flush = dri2_dpy->gbm_dri->flush;
dri2_dpy->swrast = dri2_dpy->gbm_dri->swrast;
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
@@ -541,6 +657,8 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->gbm_dri->flush_front_buffer = dri2_drm_flush_front_buffer;
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_drm_get_buffers_with_format;
dri2_dpy->gbm_dri->image_get_buffers = dri2_drm_image_get_buffers;
dri2_dpy->gbm_dri->swrast_put_image2 = swrast_put_image2;
dri2_dpy->gbm_dri->swrast_get_image = swrast_get_image;
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
@@ -550,15 +668,21 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
EGLint format, attr_list[3];
unsigned int mask;
unsigned int red, alpha;
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[i],
__DRI_ATTRIB_RED_MASK, &mask);
if (mask == 0x3ff00000)
__DRI_ATTRIB_RED_MASK, &red);
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[i],
__DRI_ATTRIB_ALPHA_MASK, &alpha);
if (red == 0x3ff00000 && alpha == 0x00000000)
format = GBM_FORMAT_XRGB2101010;
else if (mask == 0x00ff0000)
else if (red == 0x3ff00000 && alpha == 0xc0000000)
format = GBM_FORMAT_ARGB2101010;
else if (red == 0x00ff0000 && alpha == 0x00000000)
format = GBM_FORMAT_XRGB8888;
else if (mask == 0xf800)
else if (red == 0x00ff0000 && alpha == 0xff000000)
format = GBM_FORMAT_ARGB8888;
else if (red == 0xf800)
format = GBM_FORMAT_RGB565;
else
continue;
@@ -571,10 +695,23 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
i + 1, EGL_WINDOW_BIT, attr_list, NULL);
}
disp->Extensions.EXT_buffer_age = EGL_TRUE;
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
if (dri2_dpy->dri2)
disp->Extensions.EXT_buffer_age = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
if (dri2_dpy->image) {
if (dri2_dpy->image->base.version >= 10 &&
dri2_dpy->image->getCapabilities != NULL) {
int capabilities;
capabilities =
dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
disp->Extensions.WL_bind_wayland_display =
(capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
} else
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
}
#endif
/* we're supporting EGL 1.4 */

View File

@@ -468,7 +468,7 @@ dri2_wl_get_buffers(__DRIdrawable * driDrawable,
const unsigned int format = 32;
int i;
attachments_with_format = calloc(count * 2, sizeof(unsigned int));
attachments_with_format = calloc(count, 2 * sizeof(unsigned int));
if (!attachments_with_format) {
*out_count = 0;
return NULL;
@@ -964,6 +964,7 @@ static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_wl_query_buffer_age,
.create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean

View File

@@ -49,8 +49,7 @@ dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
static void
swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
struct dri2_egl_surface * dri2_surf,
int depth)
struct dri2_egl_surface * dri2_surf)
{
uint32_t mask;
const uint32_t function = GXcopy;
@@ -66,8 +65,7 @@ swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
valgc[0] = function;
valgc[1] = False;
xcb_create_gc(dri2_dpy->conn, dri2_surf->swapgc, dri2_surf->drawable, mask, valgc);
dri2_surf->depth = depth;
switch (depth) {
switch (dri2_surf->depth) {
case 32:
case 24:
dri2_surf->bytes_per_pixel = 4;
@@ -82,7 +80,7 @@ swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
dri2_surf->bytes_per_pixel = 0;
break;
default:
_eglLog(_EGL_WARNING, "unsupported depth %d", depth);
_eglLog(_EGL_WARNING, "unsupported depth %d", dri2_surf->depth);
}
}
@@ -178,6 +176,17 @@ swrastGetImage(__DRIdrawable * read,
}
static xcb_screen_t *
get_xcb_screen(xcb_screen_iterator_t iter, int screen)
{
for (; iter.rem; --screen, xcb_screen_next(&iter))
if (screen == 0)
return iter.data;
return NULL;
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
@@ -194,6 +203,7 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
xcb_screen_iterator_t s;
xcb_generic_error_t *error;
xcb_drawable_t drawable;
xcb_screen_t *screen;
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_surface));
drawable = (uintptr_t) native_surface;
@@ -211,10 +221,16 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->region = XCB_NONE;
if (type == EGL_PBUFFER_BIT) {
dri2_surf->drawable = xcb_generate_id(dri2_dpy->conn);
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
screen = get_xcb_screen(s, dri2_dpy->screen);
if (!screen) {
_eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
goto cleanup_surf;
}
dri2_surf->drawable = xcb_generate_id(dri2_dpy->conn);
xcb_create_pixmap(dri2_dpy->conn, conf->BufferSize,
dri2_surf->drawable, s.data->root,
dri2_surf->drawable, screen->root,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
dri2_surf->drawable = drawable;
@@ -239,12 +255,6 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_pixmap;
}
if (dri2_dpy->dri2) {
xcb_dri2_create_drawable (dri2_dpy->conn, dri2_surf->drawable);
} else {
swrastCreateDrawable(dri2_dpy, dri2_surf, _eglGetConfigKey(conf, EGL_BUFFER_SIZE));
}
if (type != EGL_PBUFFER_BIT) {
cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);
@@ -257,9 +267,19 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->base.Width = reply->width;
dri2_surf->base.Height = reply->height;
dri2_surf->depth = reply->depth;
free(reply);
}
if (dri2_dpy->dri2) {
xcb_dri2_create_drawable (dri2_dpy->conn, dri2_surf->drawable);
} else {
if (type == EGL_PBUFFER_BIT) {
dri2_surf->depth = _eglGetConfigKey(conf, EGL_BUFFER_SIZE);
}
swrastCreateDrawable(dri2_dpy, dri2_surf);
}
/* we always copy the back buffer to front */
dri2_surf->base.PostSubBufferSupportedNV = EGL_TRUE;
@@ -481,21 +501,6 @@ dri2_x11_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
#endif
}
static char *
dri2_x11_strndup(const char *s, int length)
{
char *d;
d = malloc(length + 1);
if (d == NULL)
return NULL;
memcpy(d, s, length);
d[length] = '\0';
return d;
}
static EGLBoolean
dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
{
@@ -507,6 +512,7 @@ dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
xcb_dri2_connect_cookie_t connect_cookie;
xcb_generic_error_t *error;
xcb_screen_iterator_t s;
xcb_screen_t *screen;
char *driver_name, *device_name;
const xcb_query_extension_reply_t *extension;
@@ -530,9 +536,13 @@ dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
XCB_DRI2_MINOR_VERSION);
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
connect_cookie = xcb_dri2_connect_unchecked (dri2_dpy->conn,
s.data->root,
XCB_DRI2_DRIVER_TYPE_DRI);
screen = get_xcb_screen(s, dri2_dpy->screen);
if (!screen) {
_eglError(EGL_BAD_NATIVE_WINDOW, "dri2_x11_connect");
return EGL_FALSE;
}
connect_cookie = xcb_dri2_connect_unchecked(dri2_dpy->conn, screen->root,
XCB_DRI2_DRIVER_TYPE_DRI);
xfixes_query =
xcb_xfixes_query_version_reply (dri2_dpy->conn,
@@ -565,14 +575,14 @@ dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
driver_name = xcb_dri2_connect_driver_name (connect);
dri2_dpy->driver_name =
dri2_x11_strndup(driver_name,
xcb_dri2_connect_driver_name_length(connect));
strndup(driver_name,
xcb_dri2_connect_driver_name_length(connect));
device_name = xcb_dri2_connect_device_name (connect);
dri2_dpy->device_name =
dri2_x11_strndup(device_name,
xcb_dri2_connect_device_name_length(connect));
strndup(device_name,
xcb_dri2_connect_device_name_length(connect));
if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) {
free(dri2_dpy->device_name);
@@ -592,11 +602,19 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
xcb_dri2_authenticate_reply_t *authenticate;
xcb_dri2_authenticate_cookie_t authenticate_cookie;
xcb_screen_iterator_t s;
xcb_screen_t *screen;
int ret = 0;
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
screen = get_xcb_screen(s, dri2_dpy->screen);
if (!screen) {
_eglError(EGL_BAD_NATIVE_WINDOW, "dri2_x11_authenticate");
return -1;
}
authenticate_cookie =
xcb_dri2_authenticate_unchecked(dri2_dpy->conn, s.data->root, id);
xcb_dri2_authenticate_unchecked(dri2_dpy->conn, screen->root, id);
authenticate =
xcb_dri2_authenticate_reply(dri2_dpy->conn, authenticate_cookie, NULL);
@@ -645,7 +663,7 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
};
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
d = xcb_screen_allowed_depths_iterator(s.data);
d = xcb_screen_allowed_depths_iterator(get_xcb_screen(s, dri2_dpy->screen));
id = 1;
surface_type =
@@ -1008,6 +1026,32 @@ dri2_x11_swrast_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
return NULL;
}
static EGLBoolean
dri2_x11_get_sync_values(_EGLDisplay *display, _EGLSurface *surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(display);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
xcb_dri2_get_msc_cookie_t cookie;
xcb_dri2_get_msc_reply_t *reply;
cookie = xcb_dri2_get_msc(dri2_dpy->conn, dri2_surf->drawable);
reply = xcb_dri2_get_msc_reply(dri2_dpy->conn, cookie, NULL);
if (!reply) {
_eglError(EGL_BAD_ACCESS, __func__);
return EGL_FALSE;
}
*ust = ((EGLuint64KHR) reply->ust_hi << 32) | reply->ust_lo;
*msc = ((EGLuint64KHR) reply->msc_hi << 32) | reply->msc_lo;
*sbc = ((EGLuint64KHR) reply->sbc_hi << 32) | reply->sbc_lo;
free(reply);
return EGL_TRUE;
}
static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_x11_create_window_surface,
@@ -1022,6 +1066,7 @@ static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
@@ -1039,6 +1084,7 @@ static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_x11_get_sync_values,
};
static EGLBoolean
@@ -1052,10 +1098,13 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
dri2_dpy->conn = xcb_connect(0, &dri2_dpy->screen);
dri2_dpy->own_device = true;
} else {
dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
Display *dpy = disp->PlatformDisplay;
dri2_dpy->conn = XGetXCBConnection(dpy);
dri2_dpy->screen = DefaultScreen(dpy);
}
if (xcb_connection_has_error(dri2_dpy->conn)) {
@@ -1063,6 +1112,11 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_dpy;
}
/*
* Every hardware driver_name is set using strdup. Doing the same in
* here will allow is to simply free the memory at dri2_terminate().
*/
dri2_dpy->driver_name = strdup("swrast");
if (!dri2_load_driver_swrast(disp))
goto cleanup_conn;
@@ -1101,6 +1155,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_conn:
free(dri2_dpy->driver_name);
if (disp->PlatformDisplay == NULL)
xcb_disconnect(dri2_dpy->conn);
cleanup_dpy:
@@ -1166,10 +1221,13 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
dri2_dpy->conn = xcb_connect(0, &dri2_dpy->screen);
dri2_dpy->own_device = true;
} else {
dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
Display *dpy = disp->PlatformDisplay;
dri2_dpy->conn = XGetXCBConnection(dpy);
dri2_dpy->screen = DefaultScreen(dpy);
}
if (xcb_connection_has_error(dri2_dpy->conn)) {
@@ -1243,6 +1301,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
disp->Extensions.NOK_swap_region = EGL_TRUE;
disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
disp->Extensions.NV_post_sub_buffer = EGL_TRUE;
disp->Extensions.CHROMIUM_sync_control = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;

View File

@@ -25,25 +25,10 @@
LOCAL_PATH := $(call my-dir)
# from Makefile
SOURCES = \
eglapi.c \
eglarray.c \
eglconfig.c \
eglcontext.c \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
eglmisc.c \
eglmode.c \
eglscreen.c \
eglstring.c \
eglsurface.c \
eglsync.c
include $(LOCAL_PATH)/Makefile.sources
SOURCES := \
${LIBEGL_C_FILES}
# ---------------------------------------
# Build libGLES_mesa
@@ -95,6 +80,12 @@ gallium_DRIVERS :=
# swrast
gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android
# freedreno
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno
LOCAL_SHARED_LIBRARIES += libdrm_freedreno
endif
# i915g
ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915
@@ -109,28 +100,29 @@ endif
# nouveau
ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += \
libmesa_winsys_nouveau \
libmesa_pipe_nvfx \
libmesa_pipe_nv50 \
libmesa_pipe_nvc0 \
libmesa_pipe_nouveau
gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau
LOCAL_SHARED_LIBRARIES += libdrm_nouveau
LOCAL_SHARED_LIBRARIES += libstlport
endif
# r300g/r600g/radeonsi
ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_radeon
LOCAL_SHARED_LIBRARIES += libdrm_radeon
ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_r300
endif
endif # r300g
ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),)
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_r600
endif
LOCAL_SHARED_LIBRARIES += libstlport
endif # r600g
ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_radeonsi
endif
endif
endif # radeonsi
gallium_DRIVERS += libmesa_pipe_radeon
endif # r600g || radeonsi
endif # r300g || r600g || radeonsi
# vmwgfx
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
@@ -151,14 +143,18 @@ LOCAL_STATIC_LIBRARIES := \
libmesa_st_egl \
$(gallium_DRIVERS) \
libmesa_st_mesa \
libmesa_util \
libmesa_glsl \
libmesa_glsl_utils \
libmesa_gallium \
libloader \
$(LOCAL_STATIC_LIBRARIES)
endif # MESA_BUILD_GALLIUM
LOCAL_STATIC_LIBRARIES := \
$(LOCAL_STATIC_LIBRARIES) \
libmesa_loader
LOCAL_MODULE := libGLES_mesa
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl

View File

@@ -19,6 +19,8 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
include Makefile.sources
AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gbm/main \
@@ -26,56 +28,20 @@ AM_CFLAGS = \
$(VISIBILITY_CFLAGS) \
$(EGL_CFLAGS) \
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
-D_EGL_DRIVER_SEARCH_DIR=\"$(libdir)/egl\" \
-D_EGL_OS_UNIX=1
lib_LTLIBRARIES = libEGL.la
libEGL_la_SOURCES = \
eglapi.c \
eglapi.h \
eglarray.c \
eglarray.h \
eglcompiler.h \
eglconfig.c \
eglconfig.h \
eglcontext.c \
eglcontext.h \
eglcurrent.c \
eglcurrent.h \
egldefines.h \
egldisplay.c \
egldisplay.h \
egldriver.c \
egldriver.h \
eglfallbacks.c \
eglglobals.c \
eglglobals.h \
eglimage.c \
eglimage.h \
egllog.c \
egllog.h \
eglmisc.c \
eglmisc.h \
eglmode.c \
eglmode.h \
eglmutex.h \
eglscreen.c \
eglscreen.h \
eglstring.c \
eglstring.h \
eglsurface.c \
eglsurface.h \
eglsync.c \
eglsync.h \
egltypedefs.h
${LIBEGL_C_FILES}
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
libEGL_la_LDFLAGS = \
-no-undefined \
-version-number 1:0 \
-Wl,-Bsymbolic \
$(BSYMBOLIC) \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
@@ -126,5 +92,6 @@ egldir = $(includedir)/EGL
egl_HEADERS = \
$(top_srcdir)/include/EGL/eglext.h \
$(top_srcdir)/include/EGL/egl.h \
$(top_srcdir)/include/EGL/eglextchromium.h \
$(top_srcdir)/include/EGL/eglmesaext.h \
$(top_srcdir)/include/EGL/eglplatform.h

View File

@@ -0,0 +1,38 @@
LIBEGL_C_FILES := \
eglapi.c \
eglapi.h \
eglarray.c \
eglarray.h \
eglcompiler.h \
eglconfig.c \
eglconfig.h \
eglcontext.c \
eglcontext.h \
eglcurrent.c \
eglcurrent.h \
egldefines.h \
egldisplay.c \
egldisplay.h \
egldriver.c \
egldriver.h \
eglfallbacks.c \
eglglobals.c \
eglglobals.h \
eglimage.c \
eglimage.h \
egllog.c \
egllog.h \
eglmisc.c \
eglmisc.h \
eglmode.c \
eglmode.h \
eglmutex.h \
eglscreen.c \
eglscreen.h \
eglstring.c \
eglstring.h \
eglsurface.c \
eglsurface.h \
eglsync.c \
eglsync.h \
egltypedefs.h

View File

@@ -28,25 +28,8 @@ env.Append(CPPPATH = [
'#/include',
])
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglfallbacks.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
# parse Makefile.sources
egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
egl = env.ConvenienceLibrary(
target = 'egl',

View File

@@ -524,8 +524,12 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
if (!context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
if (!draw_surf || !read_surf) {
/* surfaces may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_context)
/* From the EGL 1.4 (20130211) spec:
*
* To release the current context without assigning a new one, set ctx
* to EGL_NO_CONTEXT and set draw and read to EGL_NO_SURFACE.
*/
if (!disp->Extensions.KHR_surfaceless_context && ctx != EGL_NO_CONTEXT)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
@@ -567,6 +571,10 @@ _eglCreateWindowSurfaceCommon(_EGLDisplay *disp, EGLConfig config,
EGLSurface ret;
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv);
if (native_window == NULL)
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
surf = drv->API.CreateWindowSurface(drv, disp, conf, native_window,
attrib_list);
ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE;
@@ -1086,6 +1094,7 @@ eglGetProcAddress(const char *procname)
{ "eglGetPlatformDisplayEXT", (_EGLProc) eglGetPlatformDisplayEXT },
{ "eglCreatePlatformWindowSurfaceEXT", (_EGLProc) eglCreatePlatformWindowSurfaceEXT },
{ "eglCreatePlatformPixmapSurfaceEXT", (_EGLProc) eglCreatePlatformPixmapSurfaceEXT },
{ "eglGetSyncValuesCHROMIUM", (_EGLProc) eglGetSyncValuesCHROMIUM },
{ NULL, NULL }
};
EGLint i;
@@ -1751,3 +1760,25 @@ eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface,
RETURN_EGL_EVAL(disp, ret);
}
EGLBoolean EGLAPIENTRY
eglGetSyncValuesCHROMIUM(EGLDisplay display, EGLSurface surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
_EGLDisplay *disp = _eglLockDisplay(display);
_EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
if (!disp->Extensions.CHROMIUM_sync_control)
RETURN_EGL_EVAL(disp, EGL_FALSE);
if (!ust || !msc || !sbc)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.GetSyncValuesCHROMIUM(disp, surf, ust, msc, sbc);
RETURN_EGL_EVAL(disp, ret);
}

View File

@@ -139,6 +139,8 @@ typedef EGLint (*QueryBufferAge_t)(_EGLDriver *drv,
typedef EGLBoolean (*SwapBuffersWithDamageEXT_t) (_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, const EGLint *rects, EGLint n_rects);
#endif
typedef EGLBoolean (*GetSyncValuesCHROMIUM_t) (_EGLDisplay *dpy, _EGLSurface *surface, EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc);
/**
* The API dispatcher jumps through these functions
*/
@@ -225,6 +227,7 @@ struct _egl_api
PostSubBufferNV_t PostSubBufferNV;
QueryBufferAge_t QueryBufferAge;
GetSyncValuesCHROMIUM_t GetSyncValuesCHROMIUM;
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -322,11 +322,14 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
break;
case 3:
default:
/* Don't put additional version checks here. We don't know that
* there won't be versions > 3.0.
*/
break;
default:
err = EGL_BAD_MATCH;
break;
}
}

View File

@@ -113,6 +113,8 @@ struct _egl_extensions
EGLBoolean ANDROID_image_native_buffer;
EGLBoolean CHROMIUM_sync_control;
EGLBoolean NV_post_sub_buffer;
EGLBoolean EXT_create_context_robustness;

View File

@@ -517,19 +517,6 @@ _eglAddUserDriver(void)
}
/**
* Add egl_gallium to the module array.
*/
static void
_eglAddGalliumDriver(void)
{
#ifndef _EGL_BUILT_IN_DRIVER_GALLIUM
void *external = (void *) "egl_gallium";
_eglPreloadForEach(_eglGetSearchPath(), _eglLoaderFile, external);
#endif
}
/**
* Add built-in drivers to the module array.
*/
@@ -562,7 +549,6 @@ _eglAddDrivers(void)
* Add other drivers only when EGL_DRIVER is not set. The order here
* decides the priorities.
*/
_eglAddGalliumDriver();
_eglAddBuiltInDrivers();
}

View File

@@ -117,6 +117,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
_EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
_EGL_CHECK_EXTENSION(EXT_buffer_age);
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);

View File

@@ -135,22 +135,6 @@
<arg name="stride2" type="int"/>
</request>
<!-- Create a wayland buffer for the prime fd. Use for regular and planar
buffers. Pass 0 for offset and stride for unused planes. -->
<request name="create_prime_buffer" since="2">
<arg name="id" type="new_id" interface="wl_buffer"/>
<arg name="name" type="fd"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="format" type="uint"/>
<arg name="offset0" type="int"/>
<arg name="stride0" type="int"/>
<arg name="offset1" type="int"/>
<arg name="stride1" type="int"/>
<arg name="offset2" type="int"/>
<arg name="stride2" type="int"/>
</request>
<!-- Notification of the path of the drm device which is used by
the server. The client should use this device for creating
local buffers. Only buffers created from this device should
@@ -177,6 +161,25 @@
<event name="capabilities">
<arg name="value" type="uint"/>
</event>
<!-- Version 2 additions -->
<!-- Create a wayland buffer for the prime fd. Use for regular and planar
buffers. Pass 0 for offset and stride for unused planes. -->
<request name="create_prime_buffer" since="2">
<arg name="id" type="new_id" interface="wl_buffer"/>
<arg name="name" type="fd"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="format" type="uint"/>
<arg name="offset0" type="int"/>
<arg name="stride0" type="int"/>
<arg name="offset1" type="int"/>
<arg name="stride1" type="int"/>
<arg name="offset2" type="int"/>
<arg name="stride2" type="int"/>
</request>
</interface>
</protocol>

View File

@@ -26,14 +26,20 @@
GALLIUM_TOP := $(call my-dir)
GALLIUM_COMMON_MK := $(GALLIUM_TOP)/Android.common.mk
SUBDIRS := \
targets/egl-static \
state_trackers/egl \
auxiliary
SUBDIRS := auxiliary
#
# Gallium drivers and their respective winsys
#
# swrast
SUBDIRS += winsys/sw/android drivers/softpipe
# freedreno
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
SUBDIRS += winsys/freedreno/drm drivers/freedreno
endif
# i915g
ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),)
SUBDIRS += winsys/i915/drm drivers/i915
@@ -57,6 +63,8 @@ SUBDIRS += winsys/radeon/drm
ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
SUBDIRS += drivers/r300
endif
ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),)
SUBDIRS += drivers/radeon
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
SUBDIRS += drivers/r600
endif
@@ -64,11 +72,17 @@ ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),)
SUBDIRS += drivers/radeonsi
endif
endif
endif
# vmwgfx
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
SUBDIRS += winsys/svga/drm drivers/svga
endif
#
# Gallium state trackers and their users (targets)
#
SUBDIRS += state_trackers/egl targets/egl-static
mkfiles := $(patsubst %,$(GALLIUM_TOP)/%/Android.mk,$(SUBDIRS))
include $(mkfiles)

View File

@@ -1,5 +1,6 @@
GALLIUM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
$(DEFINES)
@@ -10,37 +11,29 @@ GALLIUM_CFLAGS = \
# preprocessor is determined by the ordering of the -I flags.
GALLIUM_DRIVER_CFLAGS = \
-I$(srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/winsys \
$(DEFINES) \
$(VISIBILITY_CFLAGS)
GALLIUM_DRIVER_CXXFLAGS = \
-I$(srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/winsys \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
GALLIUM_DRI_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/winsys \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/mapi \
$(DEFINES) \
$(PTHREAD_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
GALLIUM_VIDEO_CFLAGS = \
GALLIUM_TARGET_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/loader \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
-I$(top_srcdir)/src/gallium/drivers \
@@ -50,76 +43,12 @@ GALLIUM_VIDEO_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
GALLIUM_DRI_LINKER_FLAGS = \
-shared \
-shrext .so \
-module \
-avoid-version \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri.sym \
$(GC_SECTIONS)
GALLIUM_VDPAU_LINKER_FLAGS = \
-shared \
-module \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau.sym \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
GALLIUM_XVMC_LINKER_FLAGS = \
-shared \
-module \
-no-undefined \
-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/xvmc.sym \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
GALLIUM_OMX_LINKER_FLAGS = \
-shared \
-module \
-no-undefined \
-avoid-version \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/omx.sym \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
GALLIUM_COMMON_LIB_DEPS = \
-lm \
$(CLOCK_LIB) \
$(PTHREAD_LIBS) \
$(DLOPEN_LIBS)
GALLIUM_DRI_LIB_DEPS = \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(SELINUX_LIBS) \
$(LIBDRM_LIBS) \
$(EXPAT_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS)
GALLIUM_VDPAU_LIB_DEPS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS)
GALLIUM_XVMC_LIB_DEPS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(XVMC_LIBS) \
$(LIBDRM_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS)
GALLIUM_OMX_LIB_DEPS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/omx/libomxtracker.la \
$(OMX_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS)
GALLIUM_WINSYS_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
@@ -127,16 +56,19 @@ GALLIUM_WINSYS_CFLAGS = \
$(DEFINES) \
$(VISIBILITY_CFLAGS)
if HAVE_MESA_LLVM
GALLIUM_DRI_LINKER_FLAGS += $(LLVM_LDFLAGS)
GALLIUM_VDPAU_LINKER_FLAGS += $(LLVM_LDFLAGS)
GALLIUM_XVMC_LINKER_FLAGS += $(LLVM_LDFLAGS)
GALLIUM_OMX_LINKER_FLAGS += $(LLVM_LDFLAGS)
GALLIUM_DRI_LIB_DEPS += $(LLVM_LIBS)
GALLIUM_VDPAU_LIB_DEPS += $(LLVM_LIBS)
GALLIUM_XVMC_LIB_DEPS += $(LLVM_LIBS)
GALLIUM_OMX_LIB_DEPS += $(LLVM_LIBS)
GALLIUM_PIPE_LOADER_WINSYS_LIBS = \
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
$(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la
if HAVE_DRISW
GALLIUM_PIPE_LOADER_WINSYS_LIBS += \
$(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la
endif
if NEED_WINSYS_XLIB
GALLIUM_PIPE_LOADER_WINSYS_LIBS += \
$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
-lX11 -lXext -lXfixes \
$(LIBDRM_LIBS)
endif

197
src/gallium/Makefile.am Normal file
View File

@@ -0,0 +1,197 @@
SUBDIRS =
##
## Gallium auxiliary module
##
SUBDIRS += auxiliary
##
## Gallium pipe drivers and their respective winsys'
##
SUBDIRS += \
drivers/galahad \
drivers/identity \
drivers/noop \
drivers/trace \
drivers/rbug
## freedreno/msm/kgsl
if HAVE_GALLIUM_FREEDRENO
SUBDIRS += drivers/freedreno winsys/freedreno/drm
endif
## i915g/i915
if HAVE_GALLIUM_I915
SUBDIRS += drivers/i915 winsys/i915/drm
endif
## ilo/i965
if HAVE_GALLIUM_ILO
SUBDIRS += drivers/ilo winsys/intel/drm
endif
## nouveau
if HAVE_GALLIUM_NOUVEAU
SUBDIRS += drivers/nouveau winsys/nouveau/drm
endif
## vmwgfx/svga
if HAVE_GALLIUM_SVGA
SUBDIRS += drivers/svga winsys/svga/drm
endif
## r300
if HAVE_GALLIUM_R300
SUBDIRS += drivers/r300
endif
## radeon - linked into r600 and radeonsi
if HAVE_GALLIUM_RADEON_COMMON
SUBDIRS += drivers/radeon
endif
## r600
if HAVE_GALLIUM_R600
SUBDIRS += drivers/r600
endif
## radeonsi
if HAVE_GALLIUM_RADEONSI
SUBDIRS += drivers/radeonsi
endif
## the radeon winsys - linked in by r300, r600 and radeonsi
if NEED_RADEON_DRM_WINSYS
SUBDIRS += winsys/radeon/drm
endif
## swrast/softpipe
if HAVE_GALLIUM_SOFTPIPE
SUBDIRS += drivers/softpipe
## swrast/llvmpipe
if HAVE_GALLIUM_LLVMPIPE
SUBDIRS += drivers/llvmpipe
endif
endif
## vc4/rpi
if HAVE_GALLIUM_VC4
SUBDIRS += drivers/vc4 winsys/vc4/drm
endif
## the sw winsys'
SUBDIRS += winsys/sw/null
if NEED_WINSYS_XLIB
SUBDIRS += winsys/sw/xlib
endif
if HAVE_DRISW
SUBDIRS += winsys/sw/dri
endif
if HAVE_DRI2
SUBDIRS += winsys/sw/kms-dri
endif
if HAVE_EGL_PLATFORM_FBDEV
SUBDIRS += winsys/sw/fbdev
endif
if HAVE_EGL_PLATFORM_WAYLAND
SUBDIRS += winsys/sw/wayland
endif
SUBDIRS += winsys/sw/wrapper
##
## Don't forget to bundle the remaining (non autotools) winsys'
##
EXTRA_DIST = \
winsys/sw/android \
winsys/sw/gdi \
winsys/sw/hgl
##
## Gallium state trackers and their users (targets)
##
if HAVE_LOADER_GALLIUM
SUBDIRS += targets/pipe-loader
endif
if HAVE_CLOVER
SUBDIRS += state_trackers/clover targets/opencl
endif
if HAVE_DRICOMMON
SUBDIRS += state_trackers/dri targets/dri
endif
## the egl target depends on vega
if HAVE_OPENVG
SUBDIRS += state_trackers/vega
endif
if HAVE_X11_DRIVER
SUBDIRS += state_trackers/glx/xlib targets/libgl-xlib
endif
if HAVE_ST_OMX
SUBDIRS += state_trackers/omx targets/omx
endif
if HAVE_GALLIUM_OSMESA
SUBDIRS += state_trackers/osmesa targets/osmesa
endif
if HAVE_ST_VA
SUBDIRS += state_trackers/va targets/va
endif
if HAVE_ST_VDPAU
SUBDIRS += state_trackers/vdpau targets/vdpau
endif
if HAVE_ST_XA
SUBDIRS += state_trackers/xa targets/xa
endif
if HAVE_ST_XVMC
SUBDIRS += state_trackers/xvmc targets/xvmc
endif
if HAVE_ST_NINE
SUBDIRS += state_trackers/nine targets/d3dadapter9
endif
##
## Don't forget to bundle the remaining (non autotools) state-trackers/targets
##
EXTRA_DIST += \
state_trackers/README \
state_trackers/wgl targets/libgl-gdi \
targets/graw-gdi targets/graw-null targets/graw-xlib \
state_trackers/hgl targets/haiku-softpipe \
tools
##
## Gallium tests
##
if HAVE_GALLIUM_TESTS
SUBDIRS += \
tests/trivial \
tests/unit
endif
EXTRA_DIST += \
tests/graw \
tests/python

View File

@@ -21,41 +21,15 @@ SConscript([
'drivers/trace/SConscript',
])
if not env['msvc']:
# These drivers do not build on MSVC compilers
SConscript([
'drivers/i915/SConscript',
])
#
# State trackers
#
# Needed by some state trackers
SConscript('winsys/sw/null/SConscript')
if not env['embedded']:
SConscript('state_trackers/vega/SConscript')
if env['platform'] not in ('cygwin', 'darwin', 'haiku', 'sunos'):
SConscript('state_trackers/egl/SConscript')
if env['x11']:
SConscript('state_trackers/glx/xlib/SConscript')
if env['dri']:
SConscript('state_trackers/dri/SConscript')
if env['platform'] == 'windows':
SConscript('state_trackers/wgl/SConscript')
#
# Winsys
#
#
SConscript([
'winsys/sw/null/SConscript',
'winsys/sw/wrapper/SConscript',
])
if env['x11']:
SConscript([
'winsys/sw/xlib/SConscript',
@@ -66,11 +40,6 @@ if env['platform'] == 'windows':
'winsys/sw/gdi/SConscript',
])
if not env['msvc']:
SConscript([
'winsys/i915/sw/SConscript',
])
if env['platform'] == 'haiku':
SConscript([
'winsys/sw/hgl/SConscript',
@@ -79,19 +48,13 @@ if env['platform'] == 'haiku':
if env['dri']:
SConscript([
'winsys/sw/dri/SConscript',
])
SConscript([
'winsys/sw/kms-dri/SConscript',
'winsys/svga/drm/SConscript',
])
if env['drm_intel']:
SConscript([
'winsys/i915/drm/SConscript',
])
#
# Targets
# State trackers and targets
#
SConscript([
@@ -99,37 +62,38 @@ SConscript([
])
if not env['embedded']:
SConscript('state_trackers/vega/SConscript')
if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'sunos'):
SConscript([
'targets/egl-static/SConscript'
'state_trackers/egl/SConscript',
'targets/egl-static/SConscript',
])
if env['x11']:
SConscript([
'state_trackers/glx/xlib/SConscript',
'targets/graw-xlib/SConscript',
'targets/libgl-xlib/SConscript',
])
if env['platform'] == 'windows':
SConscript([
'state_trackers/wgl/SConscript',
'targets/graw-gdi/SConscript',
'targets/libgl-gdi/SConscript',
])
if env['platform'] == 'haiku':
SConscript([
'state_trackers/hgl/SConscript',
'targets/haiku-softpipe/SConscript',
])
if env['dri']:
SConscript([
'targets/dri-swrast/SConscript',
'targets/dri-vmwgfx/SConscript',
'state_trackers/dri/SConscript',
'targets/dri/SConscript',
])
if env['drm_intel']:
SConscript([
'targets/dri-i915/SConscript',
])
#

View File

@@ -30,7 +30,9 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(C_SOURCES)
LOCAL_C_INCLUDES := $(GALLIUM_TOP)/auxiliary/util
LOCAL_C_INCLUDES := \
$(GALLIUM_TOP)/auxiliary/util \
$(MESA_TOP)/src
LOCAL_MODULE := libmesa_gallium

View File

@@ -1,5 +1,9 @@
AUTOMAKE_OPTIONS = subdir-objects
if HAVE_LOADER_GALLIUM
SUBDIRS := pipe-loader
endif
include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
@@ -39,10 +43,6 @@ indices/u_unfilled_gen.c: $(srcdir)/indices/u_unfilled_gen.py
$(AM_V_at)$(MKDIR_P) indices
$(AM_V_GEN) $(PYTHON2) $< > $@
util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py
$(AM_V_at)$(MKDIR_P) util
$(AM_V_GEN) $(PYTHON2) $< > $@
util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv
$(AM_V_at)$(MKDIR_P) util
$(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@

View File

@@ -1,5 +1,3 @@
SUBDIRS := pipe-loader
C_SOURCES := \
cso_cache/cso_cache.c \
cso_cache/cso_context.c \
@@ -77,6 +75,7 @@ C_SOURCES := \
tgsi/tgsi_exec.c \
tgsi/tgsi_info.c \
tgsi/tgsi_iterate.c \
tgsi/tgsi_lowering.c \
tgsi/tgsi_parse.c \
tgsi/tgsi_sanity.c \
tgsi/tgsi_scan.c \
@@ -113,6 +112,7 @@ C_SOURCES := \
util/u_format_s3tc.c \
util/u_format_rgtc.c \
util/u_format_etc.c \
util/u_format_bptc.c \
util/u_format_tests.c \
util/u_format_yuv.c \
util/u_format_zs.c \
@@ -162,7 +162,6 @@ C_SOURCES := \
GENERATED_SOURCES := \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
util/u_format_srgb.c \
util/u_format_table.c
GALLIVM_SOURCES := \

View File

@@ -3,6 +3,7 @@ Import('*')
from sys import executable as python_cmd
env.Append(CPPPATH = [
'#src',
'indices',
'util',
])
@@ -21,13 +22,6 @@ env.CodeGenerate(
command = python_cmd + ' $SCRIPT > $TARGET'
)
env.CodeGenerate(
target = 'util/u_format_srgb.c',
script = 'util/u_format_srgb.py',
source = [],
command = python_cmd + ' $SCRIPT > $TARGET'
)
env.CodeGenerate(
target = 'util/u_format_table.c',
script = '#src/gallium/auxiliary/util/u_format_table.py',

View File

@@ -239,18 +239,8 @@ static void cso_init_vbuf(struct cso_context *cso)
{
struct u_vbuf_caps caps;
u_vbuf_get_caps(cso->pipe->screen, &caps);
/* Install u_vbuf if there is anything unsupported. */
if (!caps.buffer_offset_unaligned ||
!caps.buffer_stride_unaligned ||
!caps.velem_src_offset_unaligned ||
!caps.format_fixed32 ||
!caps.format_float16 ||
!caps.format_float64 ||
!caps.format_norm32 ||
!caps.format_scaled32 ||
!caps.user_vertex_buffers) {
if (u_vbuf_get_caps(cso->pipe->screen, &caps)) {
cso->vbuf = u_vbuf_create(cso->pipe, &caps,
cso->aux_vertex_buffer_index);
}
@@ -332,7 +322,7 @@ void cso_release_all( struct cso_context *ctx )
ctx->pipe->bind_vs_state( ctx->pipe, NULL );
ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
if (ctx->pipe->set_stream_output_targets)
if (ctx->has_streamout)
ctx->pipe->set_stream_output_targets(ctx->pipe, 0, NULL, NULL);
}

Some files were not shown because too many files have changed in this diff Show More