Commit Graph

68505 Commits

Author SHA1 Message Date
Brian Paul 667dac9d40 glsl: silence uninitialized var warning on MinGW
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-27 15:22:25 -07:00
Brian Paul bf8d049488 mesa: silence unused var warning in get_tex_rgba_uncompressed()
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-27 15:22:25 -07:00
Brian Paul 48f229d759 mesa: move declaration before code
To fix MinGW warning.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-27 15:22:24 -07:00
Brian Paul 5b089e5f15 meta: silence declaration after code warning on MinGW
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-27 15:22:24 -07:00
Brian Paul 544f56b75a meta: silence uninitialized variable warnings for MinGW
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-27 15:22:24 -07:00
Brian Paul 098e5bf3b3 c99_alloca.h: fix #include for MinGW
As with MSVC, include malloc.h but don't redefine alloca.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89364
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-02-27 15:22:24 -07:00
Brian Paul 943784bbcd gallium/util: add debug_print_usage_enum() debug helper
Signed-off-by: Brian Paul <brianp@vmware.com>
2015-02-27 15:22:04 -07:00
Brian Paul b14cec0b8e gallium/util: fix 'statement with no effect' warning
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-02-27 15:20:15 -07:00
Kenneth Graunke 53295bebc8 i965: Fix I/L/LA SNORM formats.
_mesa_choose_tex_format (texformat.c) tries I8_SNORM, L8_SNORM, and
either L8A8_SNORM or A8L8_SNORM, none of which are supported by our
driver.  Failing that, it falls back to RGBX for luminance, and RGBA
intensity and luminance alpha.  So, we need to use swizzle overrrides
to obtain the correct values.

Fixes Piglit's EXT_texture_snorm/fbo-blending-formats and
fbo-clear-formats.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2015-02-27 11:36:27 -08:00
Kenneth Graunke ea696be5ac i965/fs: Patch the instruction generating discards; don't use CMP.Z.
CMP.Z doesn't work on Gen4-5 because the boolean isn't guaranteed to be
0 or 0xFFFFFFFF - only the low bit is defined.

We can call emit_bool_to_cond_code to generate the condition in f0.0;
the last instruction will generate the flag value.  We can patch it to
use f0.1, and negate the condition.

Fixes discard tests on Gen4-5.

Haswell shader-db stats:
total instructions in shared programs: 5770279 -> 5769112 (-0.02%)
instructions in affected programs:     64342 -> 63175 (-1.81%)
helped:                                1069

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-02-27 11:36:24 -08:00
Kenneth Graunke 4ebacf8aa6 i965/fs: Introduce brw_negate_cmod().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-02-27 11:36:08 -08:00
Laura Ekstrand 0fad07af9a main: Fix whitespace in teximage.c.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-02-27 11:11:45 -08:00
Tom Stellard da85ab4b65 radeonsi/compute: Enable PIPE_SHADER_CAP_DOUBLES v2
v2:
  - Simplify ifdef

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-02-27 14:57:52 +00:00
Tom Stellard 75514555aa clover: Don't unconditionally define cl_khr_fp64
This should be done by the frontend for devices that support this
extension.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-02-27 14:57:44 +00:00
Tom Stellard ed07255149 pipe-loader: Fix build with dri drivers enabled, and vl state trackers disabled
Configure arguments:

./configure --disable-dri3 --disable-xvmc --enable-opencl
            --with-gallium-drivers=r300,r600,radeonsi
            --with-egl-platforms=drm

Build error:

make[3]: *** No rule to make target
`../../../../src/gallium/auxiliary/libgalliumvlwinsys.la', needed by
`pipe_r300.la'.  Stop.

Cc: "10.5" <mesa-stable@lists.freedestkop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-27 14:51:33 +00:00
Jose Fonseca 79daa510c7 configure: Leverage gcc warn options to enable safe use of C99 features where possible.
The main objective of this change is to enable Linux developers to use
more of C99 throughout Mesa, with confidence that the portions that need
to be built with MSVC -- and only those portions --, stay portable.

This is achieved by using the appropriate -Werror= options only on the
places they need to be used.

Unfortunately we still need MSVC 2008 on a few portions of the code
(namely llvmpipe and its dependencies).  I hope to eventually eliminate
this so that we can use C99 everywhere, but there are technical/logistic
challenges (specifically, newer Windows SDKs no longer bundle MSVC,
instead require a full installation of Visual Studio, and that has
hindered adoption of newer MSVC versions on our build processes.)
Thankfully we have more directy control over our OpenGL driver, which is
why we're now able to migrate to MSVC 2013 for most of the tree.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-02-27 14:30:36 +00:00
Jose Fonseca f320ecf218 nir: Use alloca instead of variable length arrays.
This is to enable the code to build with -Werror=vla in the short term,
and enable the code to build with MSVC2013 soon after.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-02-27 14:30:36 +00:00
Brian Paul 84a1e3d61e mesa: restore #include stdarg.h in imports.h
https://bugs.freedesktop.org/show_bug.cgi?id=89345
Signed-off-by: Brian Paul <brianp@vmware.com>
2015-02-27 07:04:49 -07:00
Brian Paul 06ed81044f c99_math.h: add defines for M_PI, M_E, M_LOG2E
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89342
Signed-off-by: Brian Paul <brianp@vmware.com>
2015-02-27 07:04:49 -07:00
Vinson Lee 8170eba7e7 r300g/tests: Include stdio.h.
Fix build error.

  CC       compiler/tests/r300_compiler_tests-radeon_compiler_regalloc_tests.o
compiler/tests/radeon_compiler_regalloc_tests.c: In function ‘test_runner_rc_regalloc’:
compiler/tests/radeon_compiler_regalloc_tests.c:57:3: error: implicit declaration of function ‘fprintf’ [-Werror=implicit-function-declaration]
   fprintf(stderr, "Failed to load program\n");
   ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2015-02-26 21:01:32 -08:00
Brian Paul 40cfa0c347 radeon/compiler: include stdio.h
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89343
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-02-26 17:53:05 -07:00
Laura Ekstrand 549078cb5a main: Fix target checking for CompressedTexSubImage*D.
This fixes a dEQP test failure.  In the test,
glCompressedTexSubImage2D was called with target = 0 and failed to throw
INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx,
target) being called before the target checking.  To remedy this, target
checking was made into its own function and called prior to
_mesa_get_current_tex_object.

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

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-26 14:24:11 -08:00
Laura Ekstrand ca65764d60 main: Fix target checking for CopyTexSubImage*D.
This fixes a dEQP test failure.  In the test,
glCopyTexSubImage2D was called with target = 0 and failed to throw
INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx,
target) being called before the target checking.  To remedy this, target
checking was separated from the main error-checking function and
called prior to _mesa_get_current_tex_object.

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

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-02-26 13:31:59 -08:00
Brian Paul 688d7656c5 c99: in c99_math.h check that _USE_MATH_DEFINES is defined with MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 12:21:30 -07:00
Brian Paul fb2ddef157 mesa: remove unused INLINE macro from compiler.h
We now use 'inline' everywhere in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:14 -07:00
Brian Paul 164b3cd757 st/mesa: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:14 -07:00
Brian Paul 0dc6b72455 swrast: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:14 -07:00
Brian Paul f51f2af76d radeon: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:14 -07:00
Brian Paul bbedb85898 r200: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:13 -07:00
Brian Paul 8e9fe53ce9 i915: replace INLINE with inline
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-02-26 11:02:13 -07:00
Jose Fonseca 46110c5d56 include,auxiliary: Remove support for MSVC older then 2008.
MSVC 2008 (shipped with Windows SDK 7.0.7600) is the oldest we
need to support.  At least on llvmpipe, gallium/auxiliary, and util
modules.  For the remaining modules (particular all OpenGL specific
code) can be built with MSVC 2013.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-26 16:53:16 +00:00
Brian Paul fd090fdadd mesa: don't include stdint.h in compiler.h
Not needed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:39 -07:00
Brian Paul 95855dd32f mesa: don't include math.h in compiler.h
Not needed by anything in that header.  Include math.h or c99_math.h
where needed instead.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:39 -07:00
Brian Paul 4f25a18011 mesa: trim down #includes in compiler.h
Don't include stuff we don't need.  Fix a few #includes elsewhere to
keep thing building.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:39 -07:00
Brian Paul 538e13d4a1 r300g: remove dependency on compiler.h
It only needs typical stdio.h and stdlib.h functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 609cb60d4b mesa: don't include limits.h in compiler.h
Not needed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 13730bcaf3 mesa: don't include float.h in compiler.h
Not needed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul ddf4b2e363 mesa: only include ctype.h where it's used
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 135b8c6530 mesa: include stdarg.h only where it's used
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 6b06697b0d mesa: remove M_PI, M_E, M_LOG2E macro definitions
Should be defined in math.h.  If not, we can add them to c99_math.h

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 6cb431c19c glsl: #include c99_math.h instead of core.h
We only need the M_LOG2E definition.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 36ea81d067 gallium: whitespace, comment formatting fixes in p_defines.h
Just to keep things consistent.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul e09fe38935 util: add debug_print_bind_flags() debug helper
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Brian Paul 2069f2c7fa gallium: renumber PIPE_BIND_ flags
Note that PIPE_BIND_COMMAND_ARGS_BUFFER and PIPE_BIND_LINEAR were both
bit 21 before.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-02-26 08:38:38 -07:00
Neil Roberts a44606eb81 meta: In pbo_{Get,}TexSubImage don't repeatedly rebind the source tex
A layered PBO image is now interpreted as a single tall 2D image so
the z argument in _mesa_meta_bind_fbo_image is ignored. Therefore this
was just redundantly rebinding the same image repeatedly.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-02-26 12:04:21 +00:00
Marius Predut 1a93e7690d mesa: use fi_type in vertex attribute code
For 32-bit builds, floating point operations use x86 FPU registers,
not SSE registers.  If we're actually storing an integer in a float
variable, the value might get modified when written to memory.  This
patch changes the VBO code to use the fi_type (float/int union) to
store/copy vertex attributes.

Also, this can improve performance on x86 because moving floats with
integer registers instead of FP registers is faster.

Neil Roberts review:
- include changes on all places that are storing attribute values.
- check with and without -O3 compiler flag.
Brian Paul review:
- use fi_type type instead gl_constant_value type
- fix a bunch of nit-picks.
- fix compiler warnings

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82668
Signed-off-by: Marius Predut <marius.predut@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-02-25 16:35:49 -07:00
Anuj Phogat 4705346463 i965/gen8: Use HALIGN_16 if MCS is enabled for non-MSRT
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-02-25 14:11:59 -08:00
Anuj Phogat 84199fa647 i965: Pass pointer to miptree as function parameter in intel_horizontal_texture_alignment_unit
This will be used by next patch in the series.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-02-25 14:11:53 -08:00
Anuj Phogat 94d88cb468 i965: Allocate texture buffer in intelTexImage
before calling _mesa_meta_pbo_TexSubImage(). This will be used in
later patches and will be required in Skylake to get the tile
resource mode of miptree before calling _mesa_meta_pbo_TexSubImage().

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-02-25 14:11:46 -08:00
Anuj Phogat 82f6d17300 i965: Make a function to check the conditions to use the blitter
No functional changes in the patch. Just makes the code look cleaner.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-02-25 14:11:41 -08:00