OSDN Git Service

android-x86/external-mesa.git
9 years agoi965/fs: Add unit tests for saturate propagation pass.
Matt Turner [Tue, 10 Feb 2015 21:38:07 +0000 (13:38 -0800)]
i965/fs: Add unit tests for saturate propagation pass.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit bf3389ec49a158e0b66db8e038d801eacabd20f1)

9 years agost/mesa: fix sampler view reference counting bug in glDraw/CopyPixels
Brian Paul [Wed, 18 Feb 2015 18:16:55 +0000 (11:16 -0700)]
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 62a8883f32f8a4c8c7d85390d4b17986e4018edf)

9 years agoswrast: fix multiple color buffer writing
Brian Paul [Mon, 16 Feb 2015 18:23:06 +0000 (11:23 -0700)]
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 89c96afe3c0acf8f2fccaf02da02945afe8ba5f3)

9 years agoinstall-lib-links: don't depend on .libs directory
Lucas Stach [Thu, 19 Feb 2015 13:52:49 +0000 (14:52 +0100)]
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 5c1aac17adffeef9bb6171d83cc7ddd94c61c5f2)

9 years agoauxiliary/vl: honour the DRI2PROTO_CFLAGS
Emil Velikov [Mon, 16 Feb 2015 19:11:33 +0000 (19:11 +0000)]
auxiliary/vl: honour the DRI2PROTO_CFLAGS

Otherwise for non-default installations the build will fail to find the
headers and error out.

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

9 years agoauxiliary/vl: Build vl_winsys_dri.c only when needed.
Emil Velikov [Mon, 16 Feb 2015 18:22:16 +0000 (18:22 +0000)]
auxiliary/vl: Build vl_winsys_dri.c only when needed.

With commit c39dbfdd0f7(auxiliary/vl: bring back the VL code for the dri
targets) we did not fully consider users of dri-swrast alone. Thus we
ended up trying to compile the dri2 specific code on platform which lack
it - Cygwin for example.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reported-by: 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>
(cherry picked from commit dd7b6670a29ff3ed48ba44a9fecd1890363d914f)

9 years agoautomake: Use AM_DISTCHECK_CONFIGURE_FLAGS
Emil Velikov [Thu, 12 Feb 2015 15:27:28 +0000 (15:27 +0000)]
automake: Use AM_DISTCHECK_CONFIGURE_FLAGS

Currently we use DISTCHECK_CONFIGURE_FLAGS, which is reserved for
the user. As with other variables, one should use the AM_ variable
within the makefile.

Cc: "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 3018c4a56aab2ac1d8d5b228e6cbf13eea68b790)

9 years agoRevert "radeon/llvm: enable unsafe math for graphics shaders"
Michel Dänzer [Tue, 17 Feb 2015 08:03:35 +0000 (17:03 +0900)]
Revert "radeon/llvm: enable unsafe math for graphics shaders"

This reverts commit 0e9cdedd2e3943bdb7f3543a3508b883b167e427.

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 4db985a5fa9ea985616a726b1770727309502d81)

9 years agoi965: Prefer Meta over the BLT for BlitFramebuffer.
Kenneth Graunke [Thu, 15 Jan 2015 09:41:14 +0000 (01:41 -0800)]
i965: Prefer Meta over the BLT for BlitFramebuffer.

There's some debate about whether we should use Meta or BLORP,
but either should run circles around the BLT engine.

In particular, this means that Gen8+ will use the 3D engine for blits,
like we do on Gen6-7.

Improves performance in "copypixrate -blit -back" (from Mesa demos)
by 232.037% +/- 3.15795% (n=10) on Broadwell GT3e.

v2: Rebase on Laura's changes.

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

9 years agoMake _mesa_swizzle_and_convert argument types in .c match those in .h
Alan Coopersmith [Mon, 16 Feb 2015 00:20:25 +0000 (16:20 -0800)]
Make _mesa_swizzle_and_convert argument types in .c match those in .h

Caused Solaris Studio compilers to fail to build with errors about
incompatible function redefinitions.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b7ce7c00e35ceb3518d932359ed52cacd6679acb)

9 years agoUse __typeof instead of typeof with Solaris Studio compilers
Alan Coopersmith [Mon, 16 Feb 2015 00:19:06 +0000 (16:19 -0800)]
Use __typeof instead of typeof with Solaris Studio compilers

While the C compiler accepts typeof, C++ requires __typeof.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86944
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4671dca0eecf7dbf3e0d0a13111813756722d57d)

9 years agoAvoid fighting with Solaris headers over isnormal()
Alan Coopersmith [Mon, 16 Feb 2015 00:16:15 +0000 (16:16 -0800)]
Avoid fighting with Solaris headers over isnormal()

When compiling in C99 or C++11 modes, Solaris defines isnormal() as
a macro via <math.h>, which causes the function definition to become
too mangled to compile.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d602fbd861e2c3c5570b55f0839361a6f8bd32c7)

9 years agoRemove extraneous ; after DECL_TYPE usage
Alan Coopersmith [Sun, 15 Feb 2015 22:46:29 +0000 (14:46 -0800)]
Remove extraneous ; after DECL_TYPE usage

The macro is defined to provide a trailing ; so this caused the expansion
to end in ";;" which made the Solaris Studio compilers issue warnings for
every line of:
  "builtin_type_macros.h", line 113: Warning: extra ";" ignored.
for every file that included the header, filling build logs with thousands
of useless warnings.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 815b3bd096a3eab9f00f9270d45a6885d73180e9)

9 years agoBracket arguments to tr so they work with Solaris tr
Alan Coopersmith [Thu, 1 Jan 2015 20:55:27 +0000 (12:55 -0800)]
Bracket arguments to tr so they work with Solaris tr

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html#index-g_t_0040command_007btr_007d-1842

Without this fix, egl fails to build on Solaris, with the error:

<command-line>:0:22: error: '_EGL_PLATFORM_x11' undeclared (first use in this function)
egldisplay.c:207:31: note: in expansion of macro '_EGL_NATIVE_PLATFORM'
             native_platform = _EGL_NATIVE_PLATFORM;
                               ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 60ad5103b9c85cbb0921082fba9401f117424f25)

9 years agoglsl: Reduce memory consumption of copy propagation passes.
Kenneth Graunke [Wed, 17 Dec 2014 02:33:39 +0000 (18:33 -0800)]
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 76960a55e6656bb0022e9c31ae7542010da130e3)

9 years agomain: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.
Laura Ekstrand [Mon, 16 Feb 2015 22:29:57 +0000 (14:29 -0800)]
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 92163482bda87216764edc0beca3ca090678038d)

9 years agoradeonsi: fix a crash if a stencil ref state is set before a DSA state
Marek Olšák [Sun, 15 Feb 2015 17:12:06 +0000 (18:12 +0100)]
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 2ead74888a70481aa40b5b6ede42279e1917e66c)

9 years agomesa: fix AtomicBuffer typo in _mesa_DeleteBuffers
Marek Olšák [Tue, 10 Feb 2015 00:35:23 +0000 (01:35 +0100)]
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 e8625a29fe0942af2876f0684b06c6ed01939227)

9 years agoradeonsi: small fix in SPI state
Marek Olšák [Fri, 6 Feb 2015 17:00:50 +0000 (18:00 +0100)]
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 a27b74819ad375e8c0bc88e13f42c951d2b5cd6a)

9 years agometa: Fix saving the results of the current occlusion query
Neil Roberts [Tue, 25 Nov 2014 17:52:27 +0000 (17:52 +0000)]
meta: Fix saving the results of the current occlusion query

When restoring the current state in _mesa_meta_end it was previously trying to
copy the on-going sample count of the current occlusion query into the new
query after restarting it so that the driver will continue adding to the
previous value. This wouldn't work for two reasons. Firstly, the query might
not be ready yet so the Result member will usually be zero. Secondly the saved
query is stored as a pointer to the query object, not a copy of the struct, so
it is actually restarting the exact same object. Copying the result value is
just copying between identical addresses with no effect. The call to
_mesa_BeginQuery will have always reset it back to zero.

This patch fixes it by making it actually wait for the query object to be
ready before grabbing the previous result. The downside of doing this is that
it could introduce a stall but I think this situation is unlikely so it might
not matter too much. A better solution might be to introduce a real
suspend/resume mechanism to the driver interface. This could be implemented in
the i965 driver by saving the depth count multiple times like it does in the
i945 driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88248
Reviewed-by: Carl Worth <cworth@cworth.org>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bb77745681e179b53ea64da7bc1987b57643b7b0)

9 years agomesa: Fix element count for byte-swaps in texstore, readpix and texgetimage
Iago Toral Quiroga [Fri, 13 Feb 2015 11:56:26 +0000 (12:56 +0100)]
mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

Some old format conversion code in pack.c implemented byte-swapping like this:

GLint comps = _mesa_components_in_format(dstFormat);
GLint swapSize = _mesa_sizeof_packed_type(dstType);
if (swapSize == 2)
   _mesa_swap2((GLushort *) dstAddr, n * comps);
else if (swapSize == 4)
   _mesa_swap4((GLuint *) dstAddr, n * comps);

where n is the pixel count. But this is incorrect for packed formats,
where _mesa_sizeof_packed_type is already returning the size of a pixel
instead of the size of a single component, so multiplying this by the
number of components in the format results in a larger element count
for _mesa_swap than we want.

Unfortunately, we followed the same implementation for byte-swapping
in the rewrite of the format conversion code for texstore, readpixels
and texgetimage.

This patch computes the correct element counts for _mesa_swap calls
by computing the bytes per pixel in the image and dividing that by the
swap size to obtain the number of swaps required per pixel. Then multiplies
that by the number of pixels in the image to obtain the swap count that
we need to use.

Also, when handling byte-swapping in texstore_rgba, we were ignoring
the image's depth. This patch fixes this too.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ba426522dddf0860f59dedfe9953dbd509160c7d)

9 years agomesa: Handle transferOps in texstore_rgba
Iago Toral Quiroga [Fri, 13 Feb 2015 09:23:26 +0000 (10:23 +0100)]
mesa: Handle transferOps in texstore_rgba

In the recent rewrite of the format conversion code we did not handle this.
This patch adds the missing support.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4b249d2eed686384d6d7c36f3232360891d5eeda)

9 years agoi965/vec4/vp: Use vec4_visitor::CMP.
Matt Turner [Thu, 12 Feb 2015 02:01:49 +0000 (02:01 +0000)]
i965/vec4/vp: Use vec4_visitor::CMP.

... instead of emit(BRW_OPCODE_CMP, ...). In commit 6b3a301f I changed
vec4_visitor::CMP to set the destination's type to that of src0. In the
following commit (2335153f) I removed an apparently now unnecessary work
around for Gen8 that did the same thing.

But there was a single place that emitted a CMP instruction without
using the vec4_visitor::CMP function. Use it there.

And change dst_null_d to dst_null_f for good measure, since ARB vp
doesn't have integers.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89032
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 72b9f8db2a035b52dbd59af0d2a6441cbde11a4c)

9 years agonvc0: allow holes in xfb target lists
Ilia Mirkin [Sat, 14 Feb 2015 06:43:31 +0000 (01:43 -0500)]
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 854eb06bee7d266fc739f984c1b4ebb54dac3b87)

9 years agost/mesa: treat resource-less xfb buffers as if they weren't there
Ilia Mirkin [Sat, 14 Feb 2015 06:27:19 +0000 (01:27 -0500)]
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 80d373ed5b1d90a5e71747ee5b8951baac62f750)

9 years agonvc0: bail out of 2d blits with non-A8_UNORM alpha formats
Ilia Mirkin [Sat, 14 Feb 2015 04:21:36 +0000 (23:21 -0500)]
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 68e4f3f572b1e629f32a73ae618dc0b016f631b1)

9 years agomesa: fix OES_texture_float texture render target behavior
Tapani Pälli [Thu, 12 Feb 2015 12:33:53 +0000 (14:33 +0200)]
mesa: fix OES_texture_float texture render target behavior

Current implementation allowed usage of unsized type texture GL_FLOAT
and GL_HALF_FLOAT as a render target as this was 'expected behavior' by
WEBGL_oes_texture_float and is also allowed by the oes-texture-float
WebGL test. However this broke some ES3 conformance tests that do not
accept such behavior. Patch sets such an fbo incomplete as expected by
the ES3 conformance tests. Textures with sized types like RGBA32F will
still continue to work as render targets.

v2: code style cleanups (Ian Romanick, Matt Turner)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88905
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e333035c47a6a4cc88f0f9ca2bced500538bebae)

9 years agoRevert use of Mesa IR optimizer for ARB_fragment_programs
Carl Worth [Thu, 12 Feb 2015 18:14:24 +0000 (10:14 -0800)]
Revert use of Mesa IR optimizer for ARB_fragment_programs

Commit f82f2fb3dc770902f1657ab1c22e6004faa3afab 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 55a57834bf912916a5e07486b32f1778b35657f6)

9 years agocherry-ignore: ignore commits picked without -x
Emil Velikov [Tue, 24 Feb 2015 12:14:20 +0000 (12:14 +0000)]
cherry-ignore: ignore commits picked without -x

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoi965: Fix integer border color on Haswell.
Kenneth Graunke [Fri, 6 Feb 2015 11:39:20 +0000 (03:39 -0800)]
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 08a06b6b891df456902f5e170f1d82236d0c73d2)

9 years agoi965: Use a gl_color_union for sampler border color.
Kenneth Graunke [Wed, 7 May 2014 05:56:17 +0000 (22:56 -0700)]
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 e1e73443c572b5432ef66a923fe64b73467f411b)

9 years agoi965: Override swizzles for integer luminance formats.
Kenneth Graunke [Fri, 6 Feb 2015 10:06:27 +0000 (02:06 -0800)]
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 8cb18760cccf2c89d94c50ff14b330ec2d5c4a3c)

9 years agoIncrement version to 10.5.0-rc1
Emil Velikov [Thu, 12 Feb 2015 14:00:41 +0000 (14:00 +0000)]
Increment version to 10.5.0-rc1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoauxiliary/vl: bring back the VL code for the dri targets
Emil Velikov [Tue, 10 Feb 2015 15:11:09 +0000 (15:11 +0000)]
auxiliary/vl: bring back the VL code for the dri targets

With commit c642e87d9f4(auxiliary/vl: rework the build of the VL code)
we split out the VL code into a separate static library that was meant
to be used by the VL targets alone - va, vdpau, xvmc.

The commit failed to consider the way we handle vdpau-gl interop and
broke it. Bring back the functionality by keeping the vl <> vl_stub
separation as requrested by Christian.

v2: Update the omx target as well. Update mesa-stable email address.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86837
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
9 years agoconfigure: rework wayland_scanner handling(fix make distcheck)
Emil Velikov [Tue, 10 Feb 2015 14:14:16 +0000 (14:14 +0000)]
configure: rework wayland_scanner handling(fix make distcheck)

Currently having the wayland-scanner is optional, which causes problems
when autotools parses through the makefiles, and tries to generate all
the BUILT_SOURCES.

As the config option --with-egl-platform=wayland is not the default, we
won't end up setting the WAYLAND_SCANNER variable, which in turn will
cause some files to not get generated.

There has been a wayland-scanner package as of wayland 1.2 which
provides a variable for the scanner binary, so let's use that one and
fall back to manually searching via AC_PATH_PROG when needed.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agonir: add missing header to the sources list
Emil Velikov [Tue, 10 Feb 2015 13:10:18 +0000 (13:10 +0000)]
nir: add missing header to the sources list

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agonir: resolve nir.h dependency list (fix make distcheck)
Emil Velikov [Sat, 7 Feb 2015 19:20:16 +0000 (19:20 +0000)]
nir: resolve nir.h dependency list (fix make distcheck)

Use nir/nir_opcodes.h as is (w/o the absolute path), as it is the target
name used to generate the actual file. Otherwise the target is missing,
the file won't get generated and the build will fail.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRM
Axel Davy [Wed, 14 Jan 2015 19:36:04 +0000 (20:36 +0100)]
egl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRM

To fix build when libdrm is not found,
commit a594cec7e3ef275c386054127a357110a19dd823 did put several
parts of egl code under #ifdef HAVE_DRM_PLATFORM.

HAVE_DRM_PLATFORM means the egl drm platform is being built.
What should have been used instead is HAVE_LIBDRM.

At a few locations, the HAVE_DRM_PLATFORM introduced
have already been replaced by HAVE_LIBDRM, this patch
replaces the remaining occurences.

This patch makes for example EGL_EXT_image_dma_buf_import
be advertised by egl under x11 when the drm egl platform
is not built, whereas previously it required the drm egl
platform to be built.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodarwin: build fix
Jeremy Huddleston Sequoia [Wed, 11 Feb 2015 06:21:47 +0000 (22:21 -0800)]
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 291be28476ea60c6fb1eb2a882e2e25def5d3735

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit e68b67b53fce39a8c93188262d9e795ca50750ac)

9 years agodarwin: build fix
Jeremy Huddleston Sequoia [Wed, 11 Feb 2015 04:32:02 +0000 (20:32 -0800)]
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 1c67a5687a35e984323b6034adb914a66d64bb2f)

9 years agogallium/hud: also try R8_UNORM format for font texture
Brian Paul [Wed, 4 Feb 2015 20:44:48 +0000 (13:44 -0700)]
gallium/hud: also try R8_UNORM format for font texture

Convert the code to try formats from an array rather than a bunch
of if/else cases.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agogallium/hud: flush stdout in print_help(), for Windows
Brian Paul [Wed, 4 Feb 2015 20:34:44 +0000 (13:34 -0700)]
gallium/hud: flush stdout in print_help(), for Windows

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoi965: Add more stringent blitter assertions
Ben Widawsky [Tue, 23 Dec 2014 21:59:16 +0000 (13:59 -0800)]
i965: Add more stringent blitter assertions

Blits to or from a y-tiled surface must always be a multiple of the tile size.
From page 16 of the HSW PRM
(https://01.org/linuxgraphics/sites/default/files/documentation/intel-gfx-prm-osrc-hsw-memory-views.pdf#16)
"The pitch of a tiled enclosing region must be an integral number of tile
widths"

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Consolidate some of the intel_blit logic
Ben Widawsky [Tue, 23 Dec 2014 20:28:29 +0000 (12:28 -0800)]
i965: Consolidate some of the intel_blit logic

An upcoming patch is going to introduce some code here, and having this code
organized as the patch does makes it a bit easier to read later.

There should be no functional change here.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agost/dri: Make depth buffer optional for postprocessing
Park, Jeongmin [Sat, 7 Feb 2015 08:53:48 +0000 (17:53 +0900)]
st/dri: Make depth buffer optional for postprocessing

Since only pp_jimenezmlaa uses depth buffer, we can make it optional.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agopostprocess: Check for depth buffer in pp_jimenezmlaa
Park, Jeongmin [Sat, 7 Feb 2015 08:53:47 +0000 (17:53 +0900)]
postprocess: Check for depth buffer in pp_jimenezmlaa

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88962
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoi965/vec4: Correct MUL destination hazard
Ben Widawsky [Wed, 3 Dec 2014 01:30:49 +0000 (17:30 -0800)]
i965/vec4: Correct MUL destination hazard

As it turns out, we were over-thinking the cause of the hang on
Cherryview. It's simply errata for Cherryview.

commit 88fea85f09e2252035bec66ab26c375b45b000f5
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Nov 21 10:47:41 2014 -0800

    i965/vec4/gen8: Handle the MUL dest hazard exception

This is an explanation to why we never saw the hang on BDW.

NOTE: The problem the original patch was trying to fix does still exist. It will
have to be fixed at some point.

v2: Modify commit message, s/CHV/BDW

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84212
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agodocs: add news item and link release notes for mesa 10.4.4
Emil Velikov [Sat, 7 Feb 2015 00:51:08 +0000 (00:51 +0000)]
docs: add news item and link release notes for mesa 10.4.4

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 sums for the 10.4.4 release
Emil Velikov [Sat, 7 Feb 2015 00:47:18 +0000 (00:47 +0000)]
docs: Add sha256 sums for the 10.4.4 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 54da987baec25fbaf6975c93f197ddbfe65a303c)

9 years agoAdd release notes for the 10.4.4 release
Emil Velikov [Sat, 7 Feb 2015 00:17:09 +0000 (00:17 +0000)]
Add release notes for the 10.4.4 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 62eb27ac8bbd979796f50e253f6c786d7d791242)

9 years agonir: Fix broken fsat recognizer.
Eric Anholt [Fri, 30 Jan 2015 22:03:14 +0000 (14:03 -0800)]
nir: Fix broken fsat recognizer.

We've probably never seen this ridiculous pattern in the wild, so it
didn't matter.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agonir: Slightly simplify algebraic code generation by reusing a struct.
Eric Anholt [Wed, 28 Jan 2015 00:42:38 +0000 (16:42 -0800)]
nir: Slightly simplify algebraic code generation by reusing a struct.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agotgsi/ureg: Add missing some missing opcodes opcode_tmp.h
Eric Anholt [Mon, 10 Nov 2014 22:26:14 +0000 (14:26 -0800)]
tgsi/ureg: Add missing some missing opcodes opcode_tmp.h

I wanted all of these for NIR-to-TGSI.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agotgsi/ureg: Move ureg_dst_register() to the header.
Eric Anholt [Fri, 7 Nov 2014 20:35:58 +0000 (12:35 -0800)]
tgsi/ureg: Move ureg_dst_register() to the header.

I wanted to use it for nir-to-tgsi.  The equivalent ureg_src_register() is
also located here.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agogallium/u_tests: test a NULL buffer sampler view
Marek Olšák [Sun, 1 Feb 2015 15:28:26 +0000 (16:28 +0100)]
gallium/u_tests: test a NULL buffer sampler view

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agogallium/u_tests: test a NULL constant buffer
Marek Olšák [Sun, 1 Feb 2015 12:11:49 +0000 (13:11 +0100)]
gallium/u_tests: test a NULL constant buffer

This expects (0,0,0,0), though it can be changed to something else or allow
more than one set of values to be considered correct.

This is currently the radeonsi behavior.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agogallium/u_tests: test a NULL texture sampler view
Marek Olšák [Sun, 1 Feb 2015 12:08:53 +0000 (13:08 +0100)]
gallium/u_tests: test a NULL texture sampler view

v2: allow one of the two values

9 years agogallium/u_tests: restructure the only test, refactor out reusable code
Marek Olšák [Sun, 1 Feb 2015 12:05:14 +0000 (13:05 +0100)]
gallium/u_tests: restructure the only test, refactor out reusable code

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agogallium: run gallium tests if GALLIUM_TESTS=1 is set
Marek Olšák [Sun, 1 Feb 2015 11:59:27 +0000 (12:59 +0100)]
gallium: run gallium tests if GALLIUM_TESTS=1 is set

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agogallium/postprocessing: fix crash at context destruction
Marek Olšák [Thu, 5 Feb 2015 17:13:20 +0000 (18:13 +0100)]
gallium/postprocessing: fix crash at context destruction

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agor600g/sb: fix a bug in constants folding optimisation pass
Xavier Bouchoux [Wed, 28 Jan 2015 01:31:58 +0000 (02:31 +0100)]
r600g/sb: fix a bug in constants folding optimisation pass

    ADD     R6.y.1,    R5.w.1, ~1|3f800000
    ADD     R6.y.2,    |R6.y.1|, -0.0001|b8d1b717

was wrongly being converted to

    ADD     R6.y.1,    R5.w.1, ~1|3f800000
    ADD     R6.y.2,    R5.w.1, -1.0001|bf800347

because abs() modifier was ignored.

Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agor600g: fix abs() support on ALU 3 source operands instructions
Xavier Bouchoux [Wed, 28 Jan 2015 01:20:51 +0000 (02:20 +0100)]
r600g: fix abs() support on ALU 3 source operands instructions

Since alu does not support abs() modifier on source operands, spill
and apply the modifiers to a temp register when needed.

Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
9 years agor300g: small code cleanup (v2)
David Heidelberg [Sun, 28 Dec 2014 00:11:14 +0000 (01:11 +0100)]
r300g: small code cleanup (v2)

v2: incorporated changes from Marek Olšák

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
9 years agoglsl: GLSL ES identifiers cannot exceed 1024 characters
Iago Toral Quiroga [Tue, 20 Jan 2015 16:07:13 +0000 (17:07 +0100)]
glsl: GLSL ES identifiers cannot exceed 1024 characters

v2 (Ian Romanick)
- Move the check to the lexer before rallocing a copy of the large string.

Fixes the following 2 dEQP tests:
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_vertex
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965: Fix INTEL_DEBUG=shader_time for SIMD8 VS (and GS).
Kenneth Graunke [Thu, 15 Jan 2015 10:05:18 +0000 (02:05 -0800)]
i965: Fix INTEL_DEBUG=shader_time for SIMD8 VS (and GS).

We were incorrectly attributing VS time to FS8 on Gen8+, which now use
fs_visitor for vertex shaders.

We don't hit this for geometry shaders yet, but we may as well add
support now - the fix is obvious, and we'll just forget later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/fs: Use inst->eot rather than opcodes in register allocation.
Kenneth Graunke [Thu, 5 Feb 2015 05:11:56 +0000 (21:11 -0800)]
i965/fs: Use inst->eot rather than opcodes in register allocation.

Previously, we special cased FB writes and URB writes in the register
allocation code.  What we really wanted was to handle any message with
EOT set.

This saves us from extending the list with new opcodes in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agoi965/fs: Delete is_last_send(); just check inst->eot.
Kenneth Graunke [Thu, 5 Feb 2015 05:17:55 +0000 (21:17 -0800)]
i965/fs: Delete is_last_send(); just check inst->eot.

This helper function basically just checks inst->eot, but also asserts
that only opcodes we expect to terminate threads have EOT set.  As far
as I'm aware, we've never had such a bug.

Removing it means that we don't have to extend the list for new opcodes.
Cherryview and Skylake introduce an optimization where sampler messages
can have EOT set; scalar GS/HS/DS will likely introduce new opcodes as
well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agost/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB
Michel Dänzer [Thu, 5 Feb 2015 03:46:04 +0000 (12:46 +0900)]
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>
9 years agost/nine: Implement dummy vbo behaviour when vs is missing inputs
Tiziano Bacocco [Fri, 30 Jan 2015 12:51:44 +0000 (13:51 +0100)]
st/nine: Implement dummy vbo behaviour when vs is missing inputs

Use a dummy vertex buffer object when vs inputs have no corresponding
entries in the vertex declaration. This dummy buffer will give to the
shader float4(0,0,0,0).

This fixes several artifacts on some games.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
9 years agogallium/targets/d3dadapter9: Free card device
Axel Davy [Sat, 24 Jan 2015 16:58:28 +0000 (17:58 +0100)]
gallium/targets/d3dadapter9: Free card device

The drm fd wasn't released, causing a crash
for wine tests on nouveau, which seems to have
a bug when a lot of device descriptors are open.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agogallium/targets/d3dadapter9: Release the pipe_screen at destruction.
Axel Davy [Sun, 11 Jan 2015 16:51:59 +0000 (17:51 +0100)]
gallium/targets/d3dadapter9: Release the pipe_screen at destruction.

We weren't releasing hal and ref, causing some issues (threads not released, etc)

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agogallium/targets/d3dadapter9: Fix device detection for render-nodes
Axel Davy [Sat, 10 Jan 2015 17:49:16 +0000 (18:49 +0100)]
gallium/targets/d3dadapter9: Fix device detection for render-nodes

When on a render node the unique ioctl doesn't work.

This patch drops the code to detect the device, which relied
on an ioctl, and replaces it by the mesa loader function.
The mesa loader function is more complete and won't fail for render-nodes.

Alternatively we could also have used the pipe cap to
determine the vendor and device id from the driver.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Dummy sampler should have a=1
Axel Davy [Sat, 24 Jan 2015 11:02:04 +0000 (12:02 +0100)]
st/nine: Dummy sampler should have a=1

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Fix update_framebuffer binding cbufs the pixel shader wouldn't render to
Axel Davy [Fri, 23 Jan 2015 22:20:17 +0000 (23:20 +0100)]
st/nine: Fix update_framebuffer binding cbufs the pixel shader wouldn't render to

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Clear: better behave if rt_mask is different to the one of the framebuffer...
Axel Davy [Fri, 23 Jan 2015 22:51:32 +0000 (23:51 +0100)]
st/nine: Clear: better behave if rt_mask is different to the one of the framebuffer bound

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Fix multisampling support detection
Axel Davy [Wed, 21 Jan 2015 07:59:05 +0000 (08:59 +0100)]
st/nine: Fix multisampling support detection

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Fix enabled lights in stateblocks
Tiziano Bacocco [Tue, 20 Jan 2015 23:41:11 +0000 (00:41 +0100)]
st/nine: Fix enabled lights in stateblocks

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
9 years agost/nine: Fix depth stencil formats bindings flags.
Axel Davy [Mon, 19 Jan 2015 16:13:57 +0000 (17:13 +0100)]
st/nine: Fix depth stencil formats bindings flags.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Fix gpu memory leak in swapchain
Axel Davy [Mon, 19 Jan 2015 15:20:35 +0000 (16:20 +0100)]
st/nine: Fix gpu memory leak in swapchain

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: SetResourceResize should track nr_samples too
Axel Davy [Mon, 19 Jan 2015 15:09:07 +0000 (16:09 +0100)]
st/nine: SetResourceResize should track nr_samples too

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: D3DRS_FILLMODE set to 0 is D3DFILL_SOLID
Tiziano Bacocco [Mon, 19 Jan 2015 14:40:22 +0000 (15:40 +0100)]
st/nine: D3DRS_FILLMODE set to 0 is D3DFILL_SOLID

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
9 years agost/nine: Setting D3DRS_ALPHAFUNC to 0 means D3DCMP_NEVER
Tiziano Bacocco [Mon, 19 Jan 2015 14:27:38 +0000 (15:27 +0100)]
st/nine: Setting D3DRS_ALPHAFUNC to 0 means D3DCMP_NEVER

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
9 years agost/nine: Implement fallback behaviour when rts and ds don't match
Axel Davy [Sun, 18 Jan 2015 10:05:34 +0000 (11:05 +0100)]
st/nine: Implement fallback behaviour when rts and ds don't match

This seems to be the behaviour on Win. Previous behaviour led
to different issues depending on the driver.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Fix present_buffers allocation
Axel Davy [Sat, 17 Jan 2015 12:43:38 +0000 (13:43 +0100)]
st/nine: Fix present_buffers allocation

If has_present_buffers was false at first,
but after a device reset, it turns true (for
example if we begin to render to a multisampled
back buffer), there was a crash due to present_buffers
being uninitialised.
This patch fixes it.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Check for aligned offset in each vertex element
Patrick Rudolph [Fri, 16 Jan 2015 07:17:07 +0000 (08:17 +0100)]
st/nine: Check for aligned offset in each vertex element

Fixes wine test test_vertex_declaration_alignment()

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Fix bufferoverflow in {Get|Set}PixelShaderConstantF
Patrick Rudolph [Fri, 16 Jan 2015 06:34:36 +0000 (07:34 +0100)]
st/nine: Fix bufferoverflow in {Get|Set}PixelShaderConstantF

Previous code wasn't checking against the correct limit: 224
for sm3 hardware, but 256.

Fixes wine test test_pixel_shader_constant()

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Set [out] argument to NULL for some functions
Patrick Rudolph [Mon, 12 Jan 2015 16:58:14 +0000 (17:58 +0100)]
st/nine: Set [out] argument to NULL for some functions

Wine tests, and probably some apps, check for errors by checking for NULL
instead of error codes.
Fixes wine test test_surface_blocks()

Reviewed-by: Axel davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Remove duplicated debug message
Patrick Rudolph [Thu, 15 Jan 2015 16:20:17 +0000 (17:20 +0100)]
st/nine: Remove duplicated debug message

Likely a rebase error

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Return E_FAIL for unused vertexdeclaration type
Patrick Rudolph [Thu, 15 Jan 2015 08:43:33 +0000 (09:43 +0100)]
st/nine: Return E_FAIL for unused vertexdeclaration type

Add returncode E_FAIL.
Return E_FAIL for any vertexdeclaration element with type unused.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Missing sanity check for CALLOC return E_OUTOFMEMORY if allocation of usage_...
Patrick Rudolph [Thu, 15 Jan 2015 08:18:25 +0000 (09:18 +0100)]
st/nine: Missing sanity check for CALLOC return E_OUTOFMEMORY if allocation of usage_map fails

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
9 years agost/nine: Implement ATOC hack
Axel Davy [Wed, 14 Jan 2015 11:41:16 +0000 (12:41 +0100)]
st/nine: Implement ATOC hack

ATOC is an hack for Alpha to coverage
that is supported by NV and Intel.

You need to check the support for it
with CheckDeviceFormat.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Implement AMD alpha to coverage
Axel Davy [Wed, 14 Jan 2015 11:33:21 +0000 (12:33 +0100)]
st/nine: Implement AMD alpha to coverage

This D3D hack is supposed to be supported
by all AMD SM2+ cards. Apps use it without
checking if they are on AMD.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Add D3DFMT_DF16 support
Axel Davy [Wed, 14 Jan 2015 11:10:48 +0000 (12:10 +0100)]
st/nine: Add D3DFMT_DF16 support

This depth buffer format, like D3DFMT_INTZ, can be used to read
the depth buffer values when bound to a shader.

Some apps may use this format to get better performance when
they don't need the precision of INTZ (24 bits for depth, 8 for
stencil, whereas DF16 is just 16 bits for depth)

We don't add support for DF24 yet, because it implies support
for FETCH4, which we don't support for now.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Change the value of some advertised caps
Axel Davy [Wed, 31 Dec 2014 16:26:05 +0000 (17:26 +0100)]
st/nine: Change the value of some advertised caps

These values are taken from wine.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: NineDevice9_SetClipPlane: pPlane must be non-NULL
Axel Davy [Thu, 8 Jan 2015 14:11:19 +0000 (15:11 +0100)]
st/nine: NineDevice9_SetClipPlane: pPlane must be non-NULL

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Implement fallback for D3DFMT_D24S8, D3DFMT_D24X8 and D3DFMT_INTZ
Axel Davy [Sat, 10 Jan 2015 14:11:30 +0000 (15:11 +0100)]
st/nine: Implement fallback for D3DFMT_D24S8, D3DFMT_D24X8 and D3DFMT_INTZ

Some drivers support PIPE_FORMAT_S8_UINT_Z24_UNORM,
some others PIPE_FORMAT_Z24_UNORM_S8_UINT, some both.

It doesn't matter which one we use, since the d3d formats
they map to aren't lockable (app can read it directly).

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Refactor format d3d9 to pipe conversion
Axel Davy [Sat, 10 Jan 2015 13:58:03 +0000 (14:58 +0100)]
st/nine: Refactor format d3d9 to pipe conversion

Move the checks of whether the format is supported
into a common place.
The advantage is that allows to handle when a d3d9
format can be mapped to several formats, and that
cards don't support all of them.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Refactor nine_d3d9_to_pipe_format_map
Axel Davy [Sat, 10 Jan 2015 11:38:02 +0000 (12:38 +0100)]
st/nine: Refactor nine_d3d9_to_pipe_format_map

The order of the format is changed to have
an increasing ordering of the d3d9 format values.

Some missing formats are added and matched to PIPE_FORMAT_NONE

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Improve CheckDeviceFormat debug output
Axel Davy [Sat, 10 Jan 2015 11:19:10 +0000 (12:19 +0100)]
st/nine: Improve CheckDeviceFormat debug output

Because the debug output of this function was cut in two parts,
sometimes the second part wasn't print when we would return earlier,
whereas we would like to get it.

The reason of the separation was that it's only at the end of the function
we can print what we map to the d3d9 arguments, but we can always retrieve
that info by hand.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
9 years agost/nine: Implement RESZ hack
Axel Davy [Wed, 7 Jan 2015 17:43:20 +0000 (18:43 +0100)]
st/nine: Implement RESZ hack

This D3D hack allows to resolve a multisampled
depth buffer into a single sampled one.

Note that the implementation is slightly incorrect.
When querying the content of D3DRS_POINTSIZE,
it should return the resz code if it has been set.
This behaviour will be implemented when state changes
will be reworked. For now the current behaviour is ok,
since apps use the D3DCREATE_PUREDEVICE flag when creating
the device, which means they won't read states and in exchange
get better performance.

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