Anuj Phogat [Wed, 4 Feb 2015 00:56:04 +0000 (16:56 -0800)]
meta: Fix buffer object assignment to account for both pack and unpack bo's
create_texture_for_pbo() is shared by _mesa_meta_pbo_GetTexSubImage()
and _mesa_meta_pbo_TexSubImage() functions. So, we need to account
for both pack and unpack buffer objects.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Anuj Phogat [Wed, 4 Feb 2015 00:50:57 +0000 (16:50 -0800)]
meta: Use GL_STREAM_READ for pbo created with GL_PIXEL_PACK_BUFFER
create_texture_for_pbo() is used by both _mesa_meta_pbo_GetTexSubImage()
and _mesa_meta_pbo_TexSubImage() functions with different PBO targets.
Use GL_STREAM_READ with GL_PIXEL_PACK_BUFFER and GL_STREAM_DRAW with
GL_PIXEL_UNPACK_BUFFER.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Anuj Phogat [Wed, 4 Feb 2015 01:04:45 +0000 (17:04 -0800)]
meta: Add assertion check for ctx->Meta->SaveStackDepth
before using it for derefrencing.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Anuj Phogat [Mon, 1 Jan 2001 00:05:42 +0000 (16:05 -0800)]
meta: Do power of two samples check only for samples > 0
otherwise samples=0 passes the check, which is invalid.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Matt Turner [Tue, 24 Feb 2015 18:41:52 +0000 (10:41 -0800)]
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>
Rob Clark [Wed, 25 Feb 2015 13:35:32 +0000 (08:35 -0500)]
freedreno: drop ARRAY_SIZE macro
Since now ARRAY_SIZE has been added to util/macros.h. Fixes a bunch of:
freedreno_util.h:79:0: warning: "ARRAY_SIZE" redefined
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
^
In file included from ../../../../src/gallium/include/pipe/p_compiler.h:36:0,
from ../../../../src/gallium/include/pipe/p_context.h:31,
from freedreno_context.h:32,
from freedreno_context.c:29:
../../../../src/util/macros.h:29:0: note: this is the location of the previous definition
# define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
^
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Neil Roberts [Thu, 19 Feb 2015 16:09:41 +0000 (16:09 +0000)]
i965: Don't force x-tiling for 16-bpp formats on Gen>7
Sandybridge doesn't support y-tiling for surface formats with 16 or
more bpp. There was previously an override to explicitly allow this
for Gen7. However, this restriction is also removed in Gen8+ so we
should use y-tiling there too.
This is important to do for Skylake which doesn't support x-tiling for
3D surfaces.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Andreas Boll [Tue, 24 Feb 2015 19:01:30 +0000 (20:01 +0100)]
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>
Andreas Boll [Mon, 9 Feb 2015 10:18:04 +0000 (11:18 +0100)]
dri/common: Update comment about driQueryRendererIntegerCommon
Since
87d3ae0b45b6b6bb50b583dafa55eb109449a005
driQueryRendererIntegerCommon handles __DRI2_RENDERER_PREFFERED_PROFILE
too.
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Ilia Mirkin [Fri, 20 Feb 2015 09:08:38 +0000 (04:08 -0500)]
glsl: add double support for packing varyings
Doubles are always packed, but a single double will never cross a slot
boundary -- single slots can still be wasted in some situations.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Laura Ekstrand [Thu, 19 Feb 2015 01:17:38 +0000 (17:17 -0800)]
common: Fix PBOs for 1D_ARRAY.
Corrects the way that _mesa_meta_pbo_TexSubImage and
_mesa_meta_pbo_GetTexSubImage handle 1D_ARRAY textures. Fixes a failure in
the Piglit arb_direct_state_access/gettextureimage-targets test.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Laura Ekstrand [Tue, 24 Feb 2015 22:51:29 +0000 (14:51 -0800)]
common: Correct PBO 2D_ARRAY handling.
Changes PBO uploads and downloads to use a tall (height * depth) 2D texture
for blitting. This fixes the bug where 2D_ARRAY, 3D, and CUBE_MAP_ARRAY
textures are not properly uploaded and downloaded.
Removes the option to use a 2D ARRAY texture for the PBO during upload and
download. This option didn't work because the miptree couldn't be set up
reliably.
v2: Review from Jason Ekstrand and Neil Roberts:
-Delete the depth parameter from create_texture_for_pbo
-Abandon the option to create a 2D ARRAY texture in create_texture_for_pbo
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Laura Ekstrand [Tue, 24 Feb 2015 21:29:11 +0000 (13:29 -0800)]
common: Correct texture init for meta pbo uploads and downloads.
This moves the line setting immutability for the texture to after
_mesa_initialize_texture_object so that the initializer function will not
cancel it out. Moreover, because of the ARB_texture_view extension, immutable
textures must have NumLayers > 0, or depth will equal (0-1)=0xFFFFFFFF during
SURFACE_STATE setup, which triggers assertions.
v2: Review from Kenneth Graunke:
- Include more explanation in the commit message.
- Make texture setup bug fixes into a separate patch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Brian Paul [Tue, 24 Feb 2015 22:26:34 +0000 (15:26 -0700)]
mesa: remove DEG2RAD macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 22:23:22 +0000 (15:23 -0700)]
mesa: remove MAX_GLUSHORT, move MAX_GLUINT
The later is only used in one place in swrast.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 22:11:45 +0000 (15:11 -0700)]
mesa: move signbit() macro to c99_math.h
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 22:05:47 +0000 (15:05 -0700)]
mesa: remove unused isblank() function
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 22:05:05 +0000 (15:05 -0700)]
glcpp: remove unneeded #include of core.h
isblank() is not used in the code.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 22:03:44 +0000 (15:03 -0700)]
mesa: remove sqrtf macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Sun, 6 Jul 2014 05:10:41 +0000 (22:10 -0700)]
i965: Remove redundant discard jumps.
With the previous optimization in place, some shaders wind up with
multiple discard jumps in a row, or jumps directly to the next
instruction. We can remove those.
Without NIR on Haswell:
total instructions in shared programs:
5777258 ->
5775872 (-0.02%)
instructions in affected programs: 20312 -> 18926 (-6.82%)
helped: 716
With NIR on Haswell:
total instructions in shared programs:
5773163 ->
5771785 (-0.02%)
instructions in affected programs: 21040 -> 19662 (-6.55%)
helped: 717
v2: Use the CFG rather than the old instructions list. Presumably
the placeholder halt will be in the last basic block.
v3: Make sure placeholder_halt->prev isn't the head sentinel (caught
twice by Eric Anholt).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 23 Oct 2014 03:48:21 +0000 (20:48 -0700)]
glsl: Optimize "if (cond) discard;" to a conditional discard.
st_glsl_to_tgsi and ir_to_mesa have handled conditional discards for a
long time; the previous patch added that capability to i965.
i965 (Haswell) shader-db stats:
Without NIR:
total instructions in shared programs:
5792133 ->
5776360 (-0.27%)
instructions in affected programs: 737585 -> 721812 (-2.14%)
helped: 6300
HURT: 68
GAINED: 2
With NIR:
total instructions in shared programs:
5787538 ->
5769569 (-0.31%)
instructions in affected programs: 767843 -> 749874 (-2.34%)
helped: 6522
HURT: 35
GAINED: 6
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 19 Aug 2014 22:22:43 +0000 (15:22 -0700)]
i965/fs: Handle conditional discards.
The discard condition tells us which channels we want killed. We want
to invert that condition to get the channels that should survive (remain
live) in f0.1. Emit a CMP to negate it.
Nothing generates these today, but that will change shortly.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 24 Feb 2015 07:47:00 +0000 (23:47 -0800)]
nir: Introduce nir_intrinsic_discard_if.
This is a conditional discard, which takes a boolean source.
Note that we don't generate ir_discard::condition today, so this
shouldn't break drivers (since none implement this intrinsic yet).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 24 Feb 2015 09:00:22 +0000 (01:00 -0800)]
glsl: Delete dead discard conditions in constant folding.
opt_constant_folding() already detects conditional assignments where the
condition is constant, and either deletes the assignment or the
condition.
Make it handle discards in the same fashion.
Spotted happening in the wild in Tropico 5 shaders.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 24 Feb 2015 07:12:39 +0000 (23:12 -0800)]
glsl: Handle conditional discards in lower_discard_flow().
This pass wasn't prepared to handle conditional discards.
Instead of initializing the "discarded" temporary to "true", set it to
the condition. Then, refer to the variable for the condition, to avoid
duplicating the expression tree.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 24 Feb 2015 06:00:34 +0000 (22:00 -0800)]
glsl: Make ir_rvalue_visitor visit ir_discard::condition.
This was forgotten.
I omitted the NULL check since we don't check ir_assignment::condition
either.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 24 Feb 2015 06:56:47 +0000 (22:56 -0800)]
glsl: Make ir_validate check the type of ir_discard::condition.
Copy and pasted from the ir_if::condition handling, plus a NULL check.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Matt Turner [Tue, 24 Feb 2015 20:11:21 +0000 (12:11 -0800)]
Revert "i965/fs: Remove force_writemask_all assertion for execsize < 8."
This reverts commit
0d8f27eab7b7e8b7a16e76aabd3f6a0ab4880497.
"This doesn't seem to be necessary." <- I was wrong!
Tested-by: Markus Wick <markus@selfnet.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Matt Turner [Tue, 24 Feb 2015 20:03:37 +0000 (12:03 -0800)]
i965/fs: Emit MOV(1) instructions with force_writemask_all.
Fixes rendering with Dolphin.
Tested-by: Markus Wick <markus@selfnet.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Matt Turner [Mon, 22 Dec 2014 03:50:03 +0000 (19:50 -0800)]
i965/fs: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.
total instructions in shared programs:
5695356 ->
5689775 (-0.10%)
instructions in affected programs: 486231 -> 480650 (-1.15%)
helped: 2604
LOST: 1
Matt Turner [Sun, 15 Feb 2015 22:03:09 +0000 (14:03 -0800)]
i965/fs/nir: Optimize integer multiply by a 16-bit constant.
Gen8+ support was just broken, since MUL now consumes 32-bits from both
sources. Fixes 986 piglit tests on my BDW.
total instructions in shared programs:
7753873 ->
7753522 (-0.00%)
instructions in affected programs: 28164 -> 27813 (-1.25%)
helped: 77
GAINED: 47
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Matt Turner [Sun, 15 Feb 2015 21:45:04 +0000 (13:45 -0800)]
i965/fs/nir: Optimize (gl_FrontFacing ? x : y) where x and y are ±1.0.
total instructions in shared programs:
7756214 ->
7753873 (-0.03%)
instructions in affected programs: 455452 -> 453111 (-0.51%)
helped: 2333
Reviewed-by: Eric Anholt <eric@anholt.net>
Jason Ekstrand [Fri, 30 Jan 2015 05:45:53 +0000 (21:45 -0800)]
nir/register: Add a parent_instr field
This adds a parent_instr field similar to the one for ssa_def. The
difference here is that the parent_instr field on a nir_register can be
NULL if the register does not have a unique definition or if that
definition does not dominate all its uses. We set this field in the
out-of-SSA pass so that backends can get SSA-like information even after
they have gone out of SSA.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sat, 21 Feb 2015 22:20:05 +0000 (23:20 +0100)]
st/mesa: remove unused/broken function st_print_shaders
Reviewed-by: Dave Airlie <airlied@redhat.com>
Brian Paul [Tue, 24 Feb 2015 16:59:30 +0000 (09:59 -0700)]
st/mesa: remove struct qualifier from st_src_reg parameter
It's a class. Silences MSVC warning.
Brian Paul [Tue, 24 Feb 2015 16:39:51 +0000 (09:39 -0700)]
mesa: remove INV_SQRTF() macro
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:33:41 +0000 (09:33 -0700)]
mesa: remove ceilf, floorf macros
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:32:27 +0000 (09:32 -0700)]
mesa: remove expf macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:31:34 +0000 (09:31 -0700)]
mesa: remove logf macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:26:41 +0000 (09:26 -0700)]
mesa: remove powf macro
Use the wrapper in c99_math.h if needed.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:24:27 +0000 (09:24 -0700)]
mesa: remove unused exp2f, log2f, truncf wrappers
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:20:12 +0000 (09:20 -0700)]
mesa: remove unused acosf, asinf, atan2f, etc. macros
Not used anywhere. If any of these are needed, they should be added
to c99_math.h
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:08:50 +0000 (09:08 -0700)]
mesa: replace FABSF with fabsf
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:04:54 +0000 (09:04 -0700)]
mesa: replace FLOORF with floorf
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:03:25 +0000 (09:03 -0700)]
mesa: remove unused CEILF macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 16:01:51 +0000 (09:01 -0700)]
mesa: replace LOGF, EXPF with logf, expf
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 15:57:17 +0000 (08:57 -0700)]
mesa: replace FREXPF, LDEXPF with frexpf, ldexpf
Start getting rid of some imports.h macros. Use the c99 functions instead.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Tue, 24 Feb 2015 15:47:57 +0000 (08:47 -0700)]
targets/libgl-xlib: add src/ include dir to fix build
Brian Paul [Tue, 24 Feb 2015 00:48:00 +0000 (17:48 -0700)]
swrast: fix a few release build warnings
Marek Olšák [Mon, 23 Feb 2015 17:03:02 +0000 (18:03 +0100)]
r600g,radeonsi: fix streamout after pipeline stats have been used
EVENT_TYPE_PIPELINESTAT_STOP disables streamout queries too.
Luckily, pipeline stats are enabled by default, so we don't even have to
emit EVENT_TYPE_PIPELINESTAT_START.
Tested on Hawaii, Bonaire, Redwood, RV730.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 16:42:20 +0000 (17:42 +0100)]
radeonsi: small cleanup around current_rast_prim
- remove the last parameter of si_emit_rasterizer_prim_state
- remove the last unused parameter of si_emit_draw_registers
- use current_rast_prim in si_emit_draw_registers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 18:14:42 +0000 (19:14 +0100)]
radeonsi: set current_rast_prim in the right place
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 14:36:20 +0000 (15:36 +0100)]
radeonsi: simplify obtaining a shader property in si_emit_clip_regs
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 14:11:49 +0000 (15:11 +0100)]
radeonsi: only preload VertexID for the GS copy shader
The copy shader doesn't use any other preloaded VGPRs.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 13:58:30 +0000 (14:58 +0100)]
radeonsi: dump the shader key when dumping shaders
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Fri, 20 Feb 2015 11:22:00 +0000 (12:22 +0100)]
r600g,radeonsi: cleanup of hex literals
0x3F800000 -> fui(1.0)
0x00000000 -> 0
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Fri, 20 Feb 2015 11:14:37 +0000 (12:14 +0100)]
radeonsi: set PA_SU_HARDWARE_SCREEN_OFFSET to 0
It was probably 0 already, but it doesn't hurt to set it.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 22 Feb 2015 12:22:07 +0000 (13:22 +0100)]
st/mesa: cleanup st_translate_geometry_program
Mostly dead code or code that didn't do anything.
Computing gs_num_outputs at the end was also useless. It's already set
correctly.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Marek Olšák [Sat, 21 Feb 2015 21:41:39 +0000 (22:41 +0100)]
st/mesa: inline st_free_tokens
Reviewed-by: Dave Airlie <airlied@redhat.com>
Marek Olšák [Sat, 21 Feb 2015 21:37:47 +0000 (22:37 +0100)]
st/mesa: cleanup st_geometry_program structure
It's full of unused variables and variables only used
in st_translate_geometry_program.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Marek Olšák [Sat, 21 Feb 2015 23:33:03 +0000 (00:33 +0100)]
mesa: add a missing GS support check in GetActiveUniformBlockiv
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Glenn Kennard [Tue, 24 Feb 2015 14:59:16 +0000 (15:59 +0100)]
r600g: Implement GL_ARB_draw_indirect for EG/CM
Requires Evergreen/Cayman and radeon kernel module
2.41.0 or newer.
Expected piglit fails due to hardware limitations:
* arb_draw_indirect-draw-arrays-prim-restart
Restarts not applied for DrawArrays commands
* arb_draw_indirect-vertexid
Base vertex offset is not included in vertex id
Marek: bump vgt_state num_dw by 3 (= space needed for one register write)
Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Rob Clark [Tue, 24 Feb 2015 16:55:28 +0000 (11:55 -0500)]
freedreno/a4xx: aniso filtering
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 24 Feb 2015 16:48:01 +0000 (11:48 -0500)]
freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sun, 21 Dec 2014 16:52:44 +0000 (11:52 -0500)]
freedreno/a4xx: add ARB_instanced_arrays support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 24 Feb 2015 17:29:06 +0000 (12:29 -0500)]
freedreno/a4xx: handle index_bias (i.e. base_vertex)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sun, 21 Dec 2014 16:38:34 +0000 (11:38 -0500)]
freedreno/a4xx: add support for vertexid and instanceid sysvals
ir3 bits of it already in place from a3xx patch..
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sun, 21 Dec 2014 16:14:24 +0000 (11:14 -0500)]
freedreno/a4xx: pass number of instances to draw
a4xx has it's own draw packet, so needs equivalent update to what a3xx
already got.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Emil Velikov [Tue, 24 Feb 2015 16:09:12 +0000 (16:09 +0000)]
docs: add news item and link release notes for mesa 10.4.5
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Sat, 21 Feb 2015 12:31:51 +0000 (12:31 +0000)]
docs: Add sha256 sums for the 10.4.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit
41bdeda10210b8f1d358c04b25af2fbfe3335531)
Emil Velikov [Sat, 21 Feb 2015 12:22:08 +0000 (12:22 +0000)]
Add release notes for the 10.4.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit
a5c608e951c7d41be99a1f84450a1d5aaf6ccadd)
Leo Liu [Mon, 23 Feb 2015 18:50:06 +0000 (13:50 -0500)]
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>
Emil Velikov [Tue, 24 Feb 2015 14:05:15 +0000 (14:05 +0000)]
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>
Francisco Jerez [Sun, 22 Feb 2015 13:05:19 +0000 (15:05 +0200)]
clover: Set appropriate flag defaults on memory object creation.
According to the spec when no device access mode is specified
clCreateBuffer and clCreateImage* should default to read/write, and
clCreateSubBuffer should default to the parent's device access flags.
clCreateSubBuffer is also required to inherit the host access and
host pointer flags from the parent.
Reviewed-and-tested-by: EdB <edb+mesa@sigluy.net>
EdB [Sun, 22 Feb 2015 13:00:06 +0000 (15:00 +0200)]
clover: Add CL_MEM_HOST_* flag checks.
Those flags have been introduced in OpenCL 1.2.
[ Francisco Jerez: Rebase. Throw CL_INVALID_VALUE from
clCreateSubBuffer if the subbuffer drops access flags from its
parent. Use single function taking the set of allowed host access
flags to validate memory transfer operands. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Francisco Jerez [Sat, 21 Feb 2015 23:02:41 +0000 (01:02 +0200)]
clover: Factor out memory object flags validation to a helper function.
And define constants for commonly used subsets of flags to save some
typing.
Reviewed-and-tested-by: EdB <edb+mesa@sigluy.net>
Eric Anholt [Mon, 23 Feb 2015 06:48:34 +0000 (06:48 +0000)]
vc4: Update to current kernel sources.
New BO create and mmap ioctls are added. The submit ABI gains a flags
argument, and the pointers are fixed at 64-bit. Shaders are now fixed at
the start of their BOs.
Eric Anholt [Tue, 24 Feb 2015 13:47:58 +0000 (13:47 +0000)]
r600: Fix build after
984f3069370cd4a347cb38269d430b428385affd
Same as for the CLAMP macro, undef it before including a header file that
tries to make fields with that name.
Tobias Klausmann [Thu, 12 Feb 2015 17:31:41 +0000 (18:31 +0100)]
st/nine: Mark end of non-void function unreachable
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tobias Klausmann [Thu, 12 Feb 2015 17:31:40 +0000 (18:31 +0100)]
gallium: include util/macros.h
The most common macros are defined there, no use to duplicate these
Clean up the already redefinded macros
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Alex Henrie [Mon, 23 Feb 2015 21:56:45 +0000 (14:56 -0700)]
driconf: Update Catalan translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Alex Henrie [Mon, 23 Feb 2015 21:56:44 +0000 (14:56 -0700)]
driconf: Update Spanish translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Eduardo Lima Mitev [Sat, 14 Feb 2015 12:25:20 +0000 (13:25 +0100)]
mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv
Fixes 3 dEQP tests:
* dEQP-GLES3.functional.negative_api.state.get_program_info_log
* dEQP-GLES3.functional.negative_api.state.get_shader_info_log
* dEQP-GLES3.functional.negative_api.state.get_programiv
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Iago Toral Quiroga [Tue, 10 Feb 2015 15:40:46 +0000 (16:40 +0100)]
i965: Fix non-AA wide line rendering with fractional line widths
"(...)Let w be the width rounded to the nearest integer (...). If the
line segment has endpoints given by (x0,y0) and (x1,y1) in window
coordinates, the segment with endpoints (x0,y0-(w-1)/2) and
(x1,y1-(w-1/2)) is rasterized, (...)"
The hardware it not rounding the line width, so we should do it.
Also, we should be careful not to go beyond the hardware limits
for the line width after it gets rounded. Gen6-7 define a maximum line
width slightly below 8.0, so we should advertise a maximum line
width lower than 7.5 to make sure that 7.0 is the maximum integer
line width that we can select. Since the line width granularity in these
platforms is 0.125, we choose 7.375. Other platforms advertise rounded
maximum line widths, so those are fine.
Fixes the following 3 dEQP tests:
dEQP-GLES3.functional.rasterization.primitives.lines_wide
dEQP-GLES3.functional.rasterization.fbo.texture_2d.primitives.lines_wide
dEQP-GLES3.functional.rasterization.fbo.rbo_singlesample.primitives.lines_wide
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Iago Toral Quiroga [Wed, 11 Feb 2015 10:35:35 +0000 (11:35 +0100)]
mesa: Fix ctx->Texture.CubeMapSeamless
The intel driver code, and apparently all other Mesa drivers, call
_mesa_initialize_context early in the CreateContext hook. That
function will end up calling _mesa_init_texture which will do:
ctx->Texture.CubeMapSeamless = _mesa_is_gles3(ctx);
But this won't work at this point, since _mesa_is_gles3 requires
ctx->Version to be set and that will not happen until late
in the CreateContext hook, when _mesa_compute_version is called.
We can't just move the call to _mesa_compute_version before
_mesa_initialize_context since it needs that available extensions
have been computed, which again requires other things to be
initialized, etc. Instead, we enable seamless cube maps since
GLES2, which should work for most implementations, and expect
drivers that don't support this to disable it manually as part
of their context initialization setup.
Fixes the following 192 dEQP tests:
dEQP-GLES3.functional.texture.filtering.cube.formats.*
dEQP-GLES3.functional.texture.filtering.cube.sizes.*
dEQP-GLES3.functional.texture.filtering.cube.combinations.*
dEQP-GLES3.functional.texture.mipmap.cube.*
dEQP-GLES3.functional.texture.vertex.cube.filtering.*
dEQP-GLES3.functional.texture.vertex.cube.wrap.*
dEQP-GLES3.functional.shaders.texture_functions.texturelod.samplercube_fixed_*
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eduardo Lima Mitev [Mon, 9 Feb 2015 10:32:43 +0000 (11:32 +0100)]
mesa: Return error if BeginQuery is called with an existing object of different type
Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4
spec states:
"BeginQuery generates an INVALID_OPERATION error if any of the
following conditions hold: [...] id is the name of an
existing query object whose type does not match target; [...]
Similar wording exists in the OpenGL 4.5 spec, section 4.2. QUERY
OBJECTS AND ASYNCHRONOUS QUERIES, page 43.
Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.fragment.begin_query
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eduardo Lima Mitev [Mon, 9 Feb 2015 10:07:42 +0000 (11:07 +0100)]
mesa: Return INVALID_OPERATION when querying a never bound Query obj
Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 states:
"The command void GenQueries( sizei n, uint *ids ); returns n previously unused
query object names in ids. These names are marked as used, for the purposes of
GenQueries only, but no object is associated with them until the first time they
are used by BeginQuery."
This means that any attempt to use or query a Query object id before it has ever
been bound by calling glBeginQuery, should be assume to be an invalid object.
Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.state.get_query_objectuiv
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Iago Toral Quiroga [Tue, 10 Feb 2015 15:40:43 +0000 (16:40 +0100)]
mesa: Add _mesa_is_array_texture helper
Reviewed-by: Brian Paul <brianp@vmware.com>
Eduardo Lima Mitev [Mon, 2 Feb 2015 17:14:47 +0000 (18:14 +0100)]
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>
Samuel Iglesias Gonsalvez [Thu, 22 Jan 2015 15:01:57 +0000 (16:01 +0100)]
i965/blorp: round to nearest when converting float into integer
Fixes:
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_nearest
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_linear
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_y_nearest
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_y_linear
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_dst_y_nearest
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_dst_y_linear
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_dst_x_nearest
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_dst_x_linear
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_dst_y_nearest
dEQP-GLES3.functional.fbo.blit.rect.out_of_bounds_reverse_src_dst_y_linear
No piglit regressions.
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Carl Worth [Wed, 11 Feb 2015 21:53:31 +0000 (13:53 -0800)]
i965: Perform program state upload outside of atom handling
Across the board of the various generations, the intial few atoms in
all of the atom lists are basically the same, (performing uploads for
the various programs). The only difference is that prior to gen6
there's an ff_gs upload in place of the later gs upload.
In this commit, instead of using the atom lists for this program state
upload, we add a new function brw_upload_programs that calls into the
per-stage upload functions which in turn check dirty bits and return
immediately if nothing needs to be done.
This commit is intended to have no functional change. The motivation
is that future code, (such as the shader cache), wants to have a
single function within which to perform various operations before and
after program upload, (with some local variables holding state across
the upload).
It may be worth looking at whether some of the other functionality
currently handled via atoms might also be more cleanly handled in a
similar fashion.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Vivek Kasireddy [Wed, 11 Feb 2015 03:15:31 +0000 (19:15 -0800)]
egl, wayland: RGB565 format support on Back-buffer
In current code, color format is always hardcoded to
__DRI_IMAGE_FORMAT_ARGB8888 when buffer or DRI image is
allocated in function calls, get_back_bo and dri2_get_buffers,
regardless of current target's color format. This problem
may leads to incorrect render pitch calculation, which
eventually ends up with wrong offset of pixels in
the frame buffer when the image is in different color format
from dri surf's, especially with different bpp. (e.g. RGB565-16bpp)
Attached code patch simply adds RGB565 and XRGB8888 cases to two
functions noted above to resolve the issue.
v2: added a case of XRGB8888, format and bpp selection is done
via switch-case (not "if-else" anymore)
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Brian Paul [Mon, 23 Feb 2015 20:33:50 +0000 (13:33 -0700)]
mesa: move math-related function into new c99_math.h file
The alternative would be to include math.h in c99_compat.h but that
seems heavy-handed.
This patch also replaces INLINE with inline in the c99 math function
wrappers.
Fixes MSVC build.
Acked-by: Matt Turner <mattst88@gmail.com>
Jason Ekstrand [Sun, 22 Feb 2015 06:29:01 +0000 (22:29 -0800)]
nir/gcm: Add some missing break statements
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Jason Ekstrand [Fri, 20 Feb 2015 01:19:22 +0000 (17:19 -0800)]
nir: Copy-propagate vecN operations that are actually moves
We were already do this for ALU operations but we haven't for non-ALU
operations. This changes that.
total NIR instructions in shared programs:
2039883 ->
2022338 (-0.86%)
NIR instructions in affected programs:
1768850 ->
1751305 (-0.99%)
helped: 14244
HURT: 124
total FS instructions in shared programs:
4083960 ->
4084036 (0.00%)
FS instructions in affected programs: 7302 -> 7378 (1.04%)
helped: 12
HURT: 51
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Francisco Jerez [Mon, 16 Feb 2015 11:38:39 +0000 (13:38 +0200)]
ra: Disable round-robin strategy for optimistically colorable nodes.
The round-robin allocation strategy is expected to decrease the amount
of false dependencies created by the register allocator and give the
post-RA scheduling pass more freedom to move instructions around. On
the other hand it has the disadvantage of increasing fragmentation and
decreasing the number of equally-colored nearby nodes, what increases
the likelihood of failure in presence of optimistically colorable
nodes.
This patch disables the round-robin strategy for optimistically
colorable nodes. These typically arise in situations of high register
pressure or for registers with large live intervals, in both cases the
task of the instruction scheduler shouldn't be constrained excessively
by the dense packing of those nodes, and a spill (or on Intel hardware
a fall-back to SIMD8 mode) is invariably worse than a slightly less
optimal scheduling.
Shader-db results on the i965 driver:
total instructions in shared programs:
5488539 ->
5488489 (-0.00%)
instructions in affected programs: 1121 -> 1071 (-4.46%)
helped: 1
HURT: 0
GAINED: 49
LOST: 5
v2: Re-enable round-robin already for the lowest one of the nodes
pushed optimistically onto the sack (Connor).
v3: Use UINT_MAX instead of ~0, open-code MIN2 (Jason, Connor).
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Francisco Jerez [Thu, 5 Feb 2015 10:20:03 +0000 (12:20 +0200)]
i965/fs: Fix lower_load_payload() not to use an incorrect half for immediates and uniforms.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Francisco Jerez [Fri, 6 Feb 2015 13:06:05 +0000 (15:06 +0200)]
i965/fs: Fix lower_load_payload() to take into account non-zero reg_offset.
Fixes metadata guess when instructions in the program specify a
destination register with non-zero reg_offset and when the payload of
a LOAD_PAYLOAD spans several registers.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Francisco Jerez [Wed, 4 Feb 2015 17:49:32 +0000 (19:49 +0200)]
i965/fs: Remove logic to keep track of MRF metadata in lower_load_payload().
MRFs cannot be read from anyway so they cannot possibly be a valid
source of LOAD_PAYLOAD.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Francisco Jerez [Sat, 17 Jan 2015 12:12:34 +0000 (14:12 +0200)]
i965/fs: Less broken handling of force_writemask_all in lower_load_payload().
It's perfectly fine to read the second half of a register written with
force_writemask_all from a first half MOV instruction or vice versa, and
lower_load_payload shouldn't mark the whole MOV as belonging to the second
half in that case. Replicate the same metadata to both halves of the
destination when writemasking is disabled.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>