mesa.git
10 years agogallium/tests: use pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:40:13 +0000 (15:40 -0600)]
gallium/tests: use pipe_context::bind_sampler_states()

10 years agogallium/tools: update dump_state.py to use bind_sampler_states()
Brian Paul [Fri, 13 Sep 2013 00:11:45 +0000 (18:11 -0600)]
gallium/tools: update dump_state.py to use bind_sampler_states()

10 years agonouveau: implement pipe_context::bind_sampler_states()
Brian Paul [Fri, 13 Sep 2013 00:09:33 +0000 (18:09 -0600)]
nouveau: implement pipe_context::bind_sampler_states()

10 years agosoftpipe: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:09:10 +0000 (15:09 -0600)]
softpipe: implement pipe_context::bind_sampler_states()

10 years agoradeon: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:09:01 +0000 (15:09 -0600)]
radeon: implement pipe_context::bind_sampler_states()

10 years agosvga: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:08:42 +0000 (15:08 -0600)]
svga: implement pipe_context::bind_sampler_states()

10 years agotrace: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:08:10 +0000 (15:08 -0600)]
trace: implement pipe_context::bind_sampler_states()

10 years agorbug: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:08:04 +0000 (15:08 -0600)]
rbug: implement pipe_context::bind_sampler_states()

10 years agonoop: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:57 +0000 (15:07 -0600)]
noop: implement pipe_context::bind_sampler_states()

10 years agollvmpipe: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:48 +0000 (15:07 -0600)]
llvmpipe: implement pipe_context::bind_sampler_states()

10 years agoilo: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:39 +0000 (15:07 -0600)]
ilo: implement pipe_context::bind_sampler_states()

10 years agoidentity: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:33 +0000 (15:07 -0600)]
identity: implement pipe_context::bind_sampler_states()

10 years agoi915g: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:21 +0000 (15:07 -0600)]
i915g: implement pipe_context::bind_sampler_states()

10 years agogalahad: implement pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 21:07:10 +0000 (15:07 -0600)]
galahad: implement pipe_context::bind_sampler_states()

10 years agoclover: use pipe_context::bind_sampler_states() if non-null
Brian Paul [Thu, 12 Sep 2013 21:06:56 +0000 (15:06 -0600)]
clover: use pipe_context::bind_sampler_states() if non-null

10 years agovl: use pipe_context::bind_sampler_states() if non-null
Brian Paul [Thu, 12 Sep 2013 21:06:44 +0000 (15:06 -0600)]
vl: use pipe_context::bind_sampler_states() if non-null

10 years agoutil: use pipe_context::bind_sampler_states() if non-null
Brian Paul [Thu, 12 Sep 2013 21:06:33 +0000 (15:06 -0600)]
util: use pipe_context::bind_sampler_states() if non-null

10 years agodraw: use pipe_context::bind_sampler_states() if non-null
Brian Paul [Thu, 12 Sep 2013 21:06:23 +0000 (15:06 -0600)]
draw: use pipe_context::bind_sampler_states() if non-null

10 years agocso: use pipe_context::bind_sampler_states() if non-null
Brian Paul [Thu, 12 Sep 2013 20:59:14 +0000 (14:59 -0600)]
cso: use pipe_context::bind_sampler_states() if non-null

10 years agogallium: add pipe_context::bind_sampler_states()
Brian Paul [Thu, 12 Sep 2013 20:55:06 +0000 (14:55 -0600)]
gallium: add pipe_context::bind_sampler_states()

The bind_vertex/geometry/fragment/compute_sampler_states() functions
will be replaced by a single functions.

10 years agor300g: rename r300_bind_sampler_states to r300_bind_fragment_sampler_states
Brian Paul [Thu, 12 Sep 2013 19:57:42 +0000 (13:57 -0600)]
r300g: rename r300_bind_sampler_states to r300_bind_fragment_sampler_states

10 years agodraw: rename bind_sampler_states variables
Brian Paul [Thu, 12 Sep 2013 19:43:14 +0000 (13:43 -0600)]
draw: rename bind_sampler_states variables

Put 'fragment' in the names.  In preparation for upcoming function
renaming.

10 years agor600g: fix ínitialization of non_disp_tiling flag
Marek Olšák [Thu, 3 Oct 2013 16:16:08 +0000 (18:16 +0200)]
r600g: fix ínitialization of non_disp_tiling flag

This fixes a regression caused by e64633e8c3a5498998a45ab721bf80edca101cf5

10 years agor600g,radeonsi: create aux_context last
Marek Olšák [Thu, 3 Oct 2013 14:39:50 +0000 (16:39 +0200)]
r600g,radeonsi: create aux_context last

This fixes a regression caused by 68f6dec32ed5eede361f76c8dbdf897652659baf.

10 years agor300g/swtcl: don't call draw_prepare_shader_outputs
Marek Olšák [Fri, 20 Sep 2013 13:13:45 +0000 (15:13 +0200)]
r300g/swtcl: don't call draw_prepare_shader_outputs

10 years agost/mesa: silence warning about unhandled enum in switch statement
Brian Paul [Thu, 3 Oct 2013 15:13:39 +0000 (09:13 -0600)]
st/mesa: silence warning about unhandled enum in switch statement

10 years agomesa: fix make check for ARB_texture_gather
Chris Forbes [Thu, 3 Oct 2013 01:10:08 +0000 (14:10 +1300)]
mesa: fix make check for ARB_texture_gather

Clean up inconsistency in enum decoration:
- Use the undecorated enums where possible.
- MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB remains decorated, since it
  has no undecorated equivalent in GL4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70054
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agodocs: Mark off ARB_texture_gather
Chris Forbes [Wed, 2 Oct 2013 18:58:12 +0000 (07:58 +1300)]
docs: Mark off ARB_texture_gather

10 years agoi965/hsw: Apply gather4 RG32F w/a using SCS instead of shader.
Chris Forbes [Mon, 30 Sep 2013 09:53:14 +0000 (22:53 +1300)]
i965/hsw: Apply gather4 RG32F w/a using SCS instead of shader.

The new surface channel select bits allow us to avoid having to
recompile the shader for this workaround.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Enable ARB_texture_gather on Gen7
Chris Forbes [Sun, 24 Mar 2013 07:18:55 +0000 (20:18 +1300)]
i965: Enable ARB_texture_gather on Gen7

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: use gather slots in the binding table for gather4.
Chris Forbes [Sun, 15 Sep 2013 06:23:14 +0000 (18:23 +1200)]
i965: use gather slots in the binding table for gather4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Emit a second set of SURFACE_STATE for gather4 from textures.
Chris Forbes [Sun, 15 Sep 2013 05:58:12 +0000 (17:58 +1200)]
i965: Emit a second set of SURFACE_STATE for gather4 from textures.

This allows us to use a different surface format for gather4, which is
required for R32G32_FLOAT to work on Gen7.

V4: - Only emit alternate surface state for shaders which will actually
      use it.
    - Pass a simple 'for_gather' flag rather than a function pointer.
      The callee can decide what w/a to apply.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: make room in the binding table for a full alternate set of surface_states
Chris Forbes [Sun, 15 Sep 2013 06:11:37 +0000 (18:11 +1200)]
i965: make room in the binding table for a full alternate set of surface_states

Worst-case is that *every* texunit uses a format that needs overriding.

V4: Place the gather slots last, so shaders which don't use gather don't
    get penalized by having a huge binding table.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Add BRW_SURFACEFORMAT_R32G32_FLOAT_LD, required for IVB gather4 w/a
Chris Forbes [Sat, 10 Aug 2013 23:46:18 +0000 (11:46 +1200)]
i965: Add BRW_SURFACEFORMAT_R32G32_FLOAT_LD, required for IVB gather4 w/a

gather4 GREEN channel against a surface with format R32G32_FLOAT doesn't work
correctly on IVB. w/a from bspec:

   - use R32G32_FLOAT_LD = 0x97 instead, for gather4 only.
   - select BLUE channel to read GREEN

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: w/a for gather4 green RG32F
Chris Forbes [Sat, 10 Aug 2013 21:55:30 +0000 (09:55 +1200)]
i965: w/a for gather4 green RG32F

V4: Only flag quirks if there are any uses of gather in the shader,
    to avoid spurious recompiles just because someone happened to use
    RG32F.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: flag shaders which use gather4 at all
Chris Forbes [Wed, 25 Sep 2013 04:56:36 +0000 (16:56 +1200)]
glsl: flag shaders which use gather4 at all

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/vs: Add support for ir_tg4
Chris Forbes [Sun, 31 Mar 2013 08:39:37 +0000 (21:39 +1300)]
i965/vs: Add support for ir_tg4

Pretty much the same as the FS case. Channel select goes in the header,

V2: Less mangling.
V3: Avoid sampling at all, for degenerate swizzles.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Add support for ir_tg4
Chris Forbes [Sun, 31 Mar 2013 08:33:51 +0000 (21:33 +1300)]
i965/fs: Add support for ir_tg4

Lowers ir_tg4 (from textureGather and textureGatherOffset builtins) to
SHADER_OPCODE_TG4.

The usual post-sampling swizzle workaround can't work for ir_tg4,
so avoid doing that:

* For R/G/B/A swizzles use the hardware channel select (lives in the
   same dword in the header as the texel offset), and then don't do
   anything afterward in the shader.
* For 0/1 swizzles blast the appropriate constant over all the output
   channels instead of sampling.

V2: Avoid duplicating header enabling block
V3: Avoid sampling at all, for degenerate swizzles.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: add SHADER_OPCODE_TG4
Chris Forbes [Sun, 31 Mar 2013 08:31:12 +0000 (21:31 +1300)]
i965: add SHADER_OPCODE_TG4

Adds the Gen7 message IDs, a new SHADER_OPCODE_TG4 pseudo-op, and
low-level support for emitting it via generate_tex().

V3: Updated for changes in master.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: add texture gather changes
Maxence Le Dore [Sun, 23 Dec 2012 23:57:37 +0000 (00:57 +0100)]
glsl: add texture gather changes

V2 [Chris Forbes]:
   - Add new pattern, fixup parameter reading.

V3: Rebase onto new builtins machinery

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: add texture gather changes
Maxence Le Dore [Sun, 23 Dec 2012 23:57:02 +0000 (00:57 +0100)]
mesa: add texture gather changes

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: fix bogus swizzle in brw_cubemap_normalize
Chris Forbes [Mon, 30 Sep 2013 09:10:17 +0000 (22:10 +1300)]
i965: fix bogus swizzle in brw_cubemap_normalize

When used with a cube array in VS, failed assertion in ir_validate:

   Assignment count of LHS write mask channels enabled not
   matching RHS vector size (3 LHS, 4 RHS).

To fix this, swizzle the RHS correctly for the writemask.

This showed up in the ARB_texture_gather tests, which exercise cube
arrays in the VS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agor600/llvm: Adds support for MSAA
Vincent Lejeune [Wed, 25 Sep 2013 14:06:11 +0000 (16:06 +0200)]
r600/llvm: Adds support for MSAA

10 years agor600g/llvm: Undef z and w component of 2D TXP inst
Vincent Lejeune [Thu, 5 Sep 2013 22:26:16 +0000 (00:26 +0200)]
r600g/llvm: Undef z and w component of 2D TXP inst

10 years agor600g/llvm: fix txq for texture buffer
Vincent Lejeune [Tue, 21 May 2013 14:34:52 +0000 (16:34 +0200)]
r600g/llvm: fix txq for texture buffer

10 years agoi965: compute DDX in a subspan based only on top row
Chia-I Wu [Thu, 12 Sep 2013 05:00:52 +0000 (13:00 +0800)]
i965: compute DDX in a subspan based only on top row

Consider only the top-left and top-right pixels to approximate DDX in a 2x2
subspan, unless the application requests a more accurate approximation via
GL_FRAGMENT_SHADER_DERIVATIVE_HINT or this optimization is disabled from the
new driconf option disable_derivative_optimization.

This results in a less accurate approximation.  However, it improves the
performance of Xonotic with Ultra settings by 24.3879% +/- 0.832202% (at 95.0%
confidence) on Haswell.  No noticeable image quality difference observed.

The improvement comes from faster sample_d.  It seems, on Haswell, some
optimizations are introduced to allow faster sample_d when all pixels in a
subspan have the same derivative.  I considered SAMPLE_STATE too, which allows
one to control the quality of sample_d on Haswell.  But it gave much worse
image quality without giving better performance comparing to this change.

No piglit quick.tests regression on Haswell (tested with v1).

v2: better guess for precompile program key

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965/blorp: Use passed in framebuffer rather than ctx->DrawBuffer
Chris Forbes [Mon, 30 Sep 2013 07:43:21 +0000 (20:43 +1300)]
i965/blorp: Use passed in framebuffer rather than ctx->DrawBuffer

We have the destination framebuffer object passed in; there's no need to
go digging around in the context.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agoralloc: Remove the rzalloc-based new/delete operator definition macro.
Francisco Jerez [Wed, 2 Oct 2013 00:00:32 +0000 (17:00 -0700)]
ralloc: Remove the rzalloc-based new/delete operator definition macro.

Using it encourages the (IMHO worrying) practice of leaving member
variables uninitialized in constructor definitions.  This macro
shouldn't be necessary anymore after the last patch series fixing all
its users to initialize all member variables from the class
constructor.  Remove it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agost/mesa: Switch glsl_to_tgsi_instruction to the non-zeroing allocator.
Francisco Jerez [Mon, 30 Sep 2013 17:54:48 +0000 (10:54 -0700)]
st/mesa: Switch glsl_to_tgsi_instruction to the non-zeroing allocator.

All member variables of glsl_to_tgsi_instruction are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa/program: Switch ir_to_mesa_instruction to the non-zeroing allocator.
Francisco Jerez [Mon, 30 Sep 2013 17:53:16 +0000 (10:53 -0700)]
mesa/program: Switch ir_to_mesa_instruction to the non-zeroing allocator.

All member variables of ir_to_mesa_instruction are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Switch vec4_live_variables to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 23:37:55 +0000 (16:37 -0700)]
i965: Switch vec4_live_variables to the non-zeroing allocator.

All member variables of vec4_live_variables are already being
initialized from its constructor, it's not necessary to use rzalloc to
allocate its memory, and doing so makes it more likely that we will
start relying on the allocator to zero out all memory if the class is
ever extended with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Switch fs_live_variables to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 23:36:37 +0000 (16:36 -0700)]
i965: Switch fs_live_variables to the non-zeroing allocator.

All member variables of fs_live_variables are already being
initialized from its constructor, it's not necessary to use rzalloc to
allocate its memory, and doing so makes it more likely that we will
start relying on the allocator to zero out all memory if the class is
ever extended with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Switch fs_inst to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 23:33:55 +0000 (16:33 -0700)]
i965: Switch fs_inst to the non-zeroing allocator.

All member variables of fs_inst are already being initialized from its
constructor, it's not necessary to use rzalloc to allocate its memory,
and doing so makes it more likely that we will start relying on the
allocator to zero out all memory if the class is ever extended with
new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Switch ip_record to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 23:31:16 +0000 (16:31 -0700)]
i965: Switch ip_record to the non-zeroing allocator.

All member variables of ip_record are already being initialized from
its constructor, it's not necessary to use rzalloc to allocate its
memory, and doing so makes it more likely that we will start relying
on the allocator to zero out all memory if the class is ever extended
with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Initialize all member variables of cfg_t on construction.
Francisco Jerez [Fri, 20 Sep 2013 23:29:48 +0000 (16:29 -0700)]
i965: Initialize all member variables of cfg_t on construction.

The cfg_t object relies on the memory allocator zeroing out its
contents before it's initialized, which is quite an unusual practice
in the C++ world because it ties objects to some specific allocation
scheme, and gives unpredictable results when an object is created with
a different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.  Initialize all fields from the
constructor and stop using the zeroing allocator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Initialize all member variables of bblock_t on construction.
Francisco Jerez [Fri, 20 Sep 2013 23:27:42 +0000 (16:27 -0700)]
i965: Initialize all member variables of bblock_t on construction.

The bblock_t object relies on the memory allocator zeroing out its
contents before it's initialized, which is quite an unusual practice
in the C++ world because it ties objects to some specific allocation
scheme, and gives unpredictable results when an object is created with
a different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.  Initialize all fields from the
constructor and stop using the zeroing allocator.

v2: Use zero initialization for numeric types instead of default construction.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Switch ast_type_qualifier to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 23:23:30 +0000 (16:23 -0700)]
glsl: Switch ast_type_qualifier to the non-zeroing allocator.

All member variables of ast_type_qualifier are already being
initialized from its implicitly defined constructor, it's not
necessary to use rzalloc to allocate its memory.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Switch ast_node to the non-zeroing allocator.
Francisco Jerez [Fri, 20 Sep 2013 22:36:38 +0000 (15:36 -0700)]
glsl: Switch ast_node to the non-zeroing allocator.

All member variables of ast_node are already being initialized from
its constructor, but some of its derived classes were leaving members
uninitialized -- Fix them.

Using rzalloc makes it more likely that we will start relying on the
allocator to zero out all memory if the class is ever extended with
new member variables.  That's bad because it ties objects to some
specific allocation scheme, and gives unpredictable results when an
object is created with a different allocator -- Stack allocation,
array allocation, or aggregation inside a different object are some of
the useful possibilities that come to my mind.

v2: Use NULL initialization instead of default construction for pointers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Initialize all member variables of vec4_instruction on construction.
Francisco Jerez [Wed, 11 Sep 2013 23:20:18 +0000 (16:20 -0700)]
i965: Initialize all member variables of vec4_instruction on construction.

The vec4_instruction object relies on the memory allocator zeroing out
its contents before it's initialized, which is quite an unusual
practice in the C++ world because it ties objects to some specific
allocation scheme, and gives unpredictable results when an object is
created with a different allocator -- Stack allocation, array
allocation, or aggregation inside a different object are some of the
useful possibilities that come to my mind.  Initialize all fields from
the constructor and stop using the zeroing allocator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Initialize all member variables of _mesa_glsl_parse_state on construction.
Francisco Jerez [Thu, 12 Sep 2013 03:07:53 +0000 (20:07 -0700)]
glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.

The _mesa_glsl_parse_state object relies on the memory allocator
zeroing out its contents before it's initialized, which is quite an
unusual practice in the C++ world because it ties objects to some
specific allocation scheme, and gives unpredictable results when an
object is created with a different allocator -- Stack allocation,
array allocation, or aggregation inside a different object are some of
the useful possibilities that come to my mind.  Initialize all fields
from the constructor and stop using the zeroing allocator.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Fix misplaced includes of "main/uniforms.h".
Francisco Jerez [Wed, 11 Sep 2013 17:59:13 +0000 (10:59 -0700)]
mesa: Fix misplaced includes of "main/uniforms.h".

Several C++ source files include "main/uniforms.h" from an extern "C"
block, which is both unnecessary, because "uniforms.h" already checks
for a C++ compiler and sets the right linkage, and incorrect, because
the header file includes other C++ headers ("glsl_types.h" and
"ir_uniform.h") that are supposed to get C++ linkage.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agost/egl: flush resources before presentation
Grigori Goronzy [Tue, 1 Oct 2013 18:02:10 +0000 (20:02 +0200)]
st/egl: flush resources before presentation

Fixes regression on r600g due to fast clear introduced by commit
edbbfac6.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agoi965/gs: Fix incorrect numbering of DWORDs in 3DSTATE_GS
Paul Berry [Sat, 28 Sep 2013 04:29:01 +0000 (21:29 -0700)]
i965/gs: Fix incorrect numbering of DWORDs in 3DSTATE_GS

In commit 247f90c77e8f3894e963d796628246ba0bde27b5 (i965/gs: Set
control data header size/format appropriately for EndPrimitive()), I
incorrectly numbered the DWORDs in the 3DSTATE_GS command starting
from 1 instead of starting from 0.  This caused the control data
format to be programmed into the wrong DWORD, resulting in corruption
in some geometry shaders that used an output type of points.

This patch numbers the DWORDs starting from 0, as we do for all other
commands, which causes the control data format to be programmed into
the correct DWORD.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agomesa: check for bufSize > 0 in _mesa_GetSynciv()
Brian Paul [Sat, 14 Sep 2013 16:09:24 +0000 (10:09 -0600)]
mesa: check for bufSize > 0 in _mesa_GetSynciv()

The spec doesn't say GL_INVALID_VALUE should be raised for bufSize <= 0.
In any case, memcpy(len < 0) will lead to a crash, so don't allow it.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: minor fix-ups for _mesa_validate_sync()
Brian Paul [Sat, 14 Sep 2013 16:04:51 +0000 (10:04 -0600)]
mesa: minor fix-ups for _mesa_validate_sync()

Return bool instead of int.  Const-qualify the syncObj.  Add some comments.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: add missing error checks in _mesa_GetObject[Ptr]Label()
Brian Paul [Sat, 14 Sep 2013 15:59:18 +0000 (09:59 -0600)]
mesa: add missing error checks in _mesa_GetObject[Ptr]Label()

Error checking bufSize isn't mentioned in the spec, but it is in the
man pages.  However, I believe the man page is incorrect.  Typically,
GL functions that take GLsizei parameters check that they're positive
or non-negative.  Negative values don't make sense here.

A spec bug has been filed with Khronos/ARB.

v2: check for negative values, not <= 0.

10 years agomesa: use caller string in error message in get_label_pointer()
Brian Paul [Sat, 14 Sep 2013 15:56:08 +0000 (09:56 -0600)]
mesa: use caller string in error message in get_label_pointer()

Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
10 years agomesa: asst. clean-ups in copy_label()
Brian Paul [Sat, 14 Sep 2013 15:52:58 +0000 (09:52 -0600)]
mesa: asst. clean-ups in copy_label()

This incorporates Vinson's change to check for a null src pointer as
detected by coverity.

Also, rename the function params to be src/dst, const-qualify src,
and use GL types to match the calling functions.  And add some more
comments.

Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
10 years agost/xorg: Include u_surface.h for u_copy_rect
Alex Deucher [Tue, 1 Oct 2013 15:15:26 +0000 (11:15 -0400)]
st/xorg: Include u_surface.h for u_copy_rect

Fixes build errors.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agowinsys/freedreno/drm: drop obsolete .gitignore
Emil Velikov [Sun, 22 Sep 2013 15:30:31 +0000 (16:30 +0100)]
winsys/freedreno/drm: drop obsolete .gitignore

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agowinsys/freedreno/drm: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 15:29:48 +0000 (16:29 +0100)]
winsys/freedreno/drm: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agowinsys/nouveau/drm: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 15:33:52 +0000 (16:33 +0100)]
winsys/nouveau/drm: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agowinsys/i915/sw: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 15:25:28 +0000 (16:25 +0100)]
winsys/i915/sw: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/xvmc: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:52:11 +0000 (20:52 +0100)]
st/xvmc: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agost/xorg: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 23:16:38 +0000 (00:16 +0100)]
st/xorg: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/xa: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:49:43 +0000 (20:49 +0100)]
st/xa: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/wgl: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:45:09 +0000 (20:45 +0100)]
st/wgl: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/vega: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 23:24:06 +0000 (00:24 +0100)]
st/vega: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/vdpau: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:36:42 +0000 (20:36 +0100)]
st/vdpau: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agost/osmesa: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:35:21 +0000 (20:35 +0100)]
st/osmesa: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/glx: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 15:14:06 +0000 (16:14 +0100)]
st/glx: consolidate C sources list into Makefile.sources

Move glx/{,xlib/}Makefile.am to preserve file list

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/gbm: consolidate C sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:33:45 +0000 (20:33 +0100)]
st/gbm: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/egl: consolidate C sources lists into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 16:22:15 +0000 (17:22 +0100)]
st/egl: consolidate C sources lists into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/dri/sw: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 23:02:35 +0000 (00:02 +0100)]
st/dri/sw: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/dri: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 22:57:23 +0000 (23:57 +0100)]
st/dri: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/clover: consolidate CPP sources list into Makefile.sources
Emil Velikov [Sun, 22 Sep 2013 19:30:25 +0000 (20:30 +0100)]
st/clover: consolidate CPP sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agogalahad: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 22:42:16 +0000 (23:42 +0100)]
galahad: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agonoop: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 22:33:38 +0000 (23:33 +0100)]
noop: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoidentity: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 5 Jun 2013 22:28:11 +0000 (23:28 +0100)]
identity: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agofreedreno: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 8 May 2013 22:46:38 +0000 (23:46 +0100)]
freedreno: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agotrace: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 8 May 2013 22:44:15 +0000 (23:44 +0100)]
trace: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agollvmpipe: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 8 May 2013 22:42:23 +0000 (23:42 +0100)]
llvmpipe: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agorbug: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 8 May 2013 22:34:36 +0000 (23:34 +0100)]
rbug: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agosoftpipe: consolidate C sources list into Makefile.sources
Emil Velikov [Wed, 8 May 2013 22:28:04 +0000 (23:28 +0100)]
softpipe: consolidate C sources list into Makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600: use NEED_RADEON_LLVM over R600_NEED_RADEON_GALLIUM
Emil Velikov [Tue, 17 Sep 2013 17:29:19 +0000 (18:29 +0100)]
r600: use NEED_RADEON_LLVM over R600_NEED_RADEON_GALLIUM

libllvmradeon.la is available whenever NEED_RADEON_LLVM is set, using
R600_NEED_RADEON_GALLIUM is rather ambiguous and unnecessary. Drop it
in favour of NEED_RADEON_LLVM.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agogallium/radeon: drop unused variable LIBGALLIUM_LIBS
Emil Velikov [Tue, 17 Sep 2013 17:46:24 +0000 (18:46 +0100)]
gallium/radeon: drop unused variable LIBGALLIUM_LIBS

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agomesa/drivers: drop HAVE_*_DRI from individual makefiles
Emil Velikov [Tue, 17 Sep 2013 14:58:29 +0000 (15:58 +0100)]
mesa/drivers: drop HAVE_*_DRI from individual makefiles

The mesa/drivers/dri/Makefile.am already guards the individual
targets/subdirs with HAVE_*_DRI before including them. Thus making
the additional check within each Makefile.am unnecessary.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agogallium/targets: Make use of prebuilt libdricommon.la.
Johannes Obermayr [Tue, 17 Sep 2013 17:09:02 +0000 (18:09 +0100)]
gallium/targets: Make use of prebuilt libdricommon.la.

libdricommon.la is available whenever a non swrast driver is built.
All the classic dri drivers make use of the prebuild library but all
of the gallium ones rebuild it explicitly.

While we're here gallium/{llvm,soft}pipe does not require HAVE_COMMON_DRI
thus do not set in during configure.

v2: [Emil] Add commit message and drop HAVE_COMMON_DRI from configure.ac
v3: [Emil] Rebase and resolve targets/r*/dri conflicts

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoi915: Fix memory leak in do_blit_readpixels.
Vinson Lee [Sat, 28 Sep 2013 05:11:17 +0000 (22:11 -0700)]
i915: Fix memory leak in do_blit_readpixels.

Fixes "Resource leak" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agollvmpipe: Remove unnecessary null check of shader.
Vinson Lee [Sat, 28 Sep 2013 04:27:19 +0000 (21:27 -0700)]
llvmpipe: Remove unnecessary null check of shader.

shader has already been dereferenced earlier so cannot be null here.

Fixes "Dereference before null check" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>