mesa.git
10 years agomesa: rename format_(un)pack.c functions to match format names (pt. 2)
Brian Paul [Sat, 22 Mar 2014 18:13:20 +0000 (12:13 -0600)]
mesa: rename format_(un)pack.c functions to match format names (pt. 2)

sed commands:
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/XRGB2101010_UNORM\b/B10G10R10X2_UNORM/g
s/XBGR16161616_UNORM\b/RGBX_UNORM16/g
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/I8\b/I_UNORM8/g
s/I16\b/I_UNORM16/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agomesa: rename format_(un)pack.c functions to match format names (pt. 1)
Brian Paul [Sat, 22 Mar 2014 18:13:20 +0000 (12:13 -0600)]
mesa: rename format_(un)pack.c functions to match format names (pt. 1)

sed commands:
s/RGBA8888\b/A8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8A8_UNORM/g
s/ARGB8888\b/B8G8R8A8_UNORM/g
s/ARGB8888_REV\b/A8R8G8B8_UNORM/g
s/RGBA8888\b/X8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8X8_UNORM/g
s/XRGB8888\b/B8G8R8X8_UNORM/g
s/XRGB8888_REV\b/X8R8G8B8_UNORM/g
s/RGB888\b/BGR_UNORM8/g
s/BGR888\b/RGB_UNORM8/g
s/RGB565\b/B5G6R5_UNORM/g
s/RGB565_REV\b/R5G6B5_UNORM/g
s/ARGB4444\b/B4G4R4A4_UNORM/g
s/ARGB4444_REV\b/A4R4G4B4_UNORM/g
s/RGBA5551\b/A1B5G5R5_UNORM/g
s/ARGB1555\b/B5G5R5A1_UNORM/g
s/ARGB1555_REV\b/A1R5G5B5_UNORM/g
s/AL44\b/L4A4_UNORM/g
s/AL88\b/L8A8_UNORM/g
s/AL88_REV\b/A8L8_UNORM/g
s/AL1616\b/L16A16_UNORM/g
s/AL1616_REV\b/A16L16_UNORM/g
s/RGB332\b/B2G3R3_UNORM/g
s/A8\b/A_UNORM8/g
s/A16\b/A_UNORM16/g
s/L8\b/L_UNORM8/g
s/L16\b/L_UNORM16/g
s/L8\b/I_UNORM8/g
s/L16\b/I_UNORM16/g
s/R8\b/R_UNORM8/g
s/GR88\b/R8G8_UNORM/g
s/RG88\b/G8R8_UNORM/g
s/R16\b/R_UNORM16/g
s/GR1616\b/R16G16_UNORM/g
s/RG1616\b/G16R16_UNORM/g
s/ARGB2101010\b/B10G10R10A2_UNORM/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agollvmpipe: Fix llvmpipe_create_gs_state.
Zack Rusin [Wed, 26 Mar 2014 16:08:25 +0000 (16:08 +0000)]
llvmpipe: Fix llvmpipe_create_gs_state.

Revert unintended behaviour change from commit
b995a010e688bc4d4557e973e5e28091c378e881.

Tested-by: José Fonseca <jfonseca@vmware.com>
10 years agost/omx/dec: fix possible segfault at eos
Christian König [Fri, 14 Mar 2014 12:59:19 +0000 (13:59 +0100)]
st/omx/dec: fix possible segfault at eos

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agomapi/glapi: Use ElementTree instead of libxml2.
José Fonseca [Mon, 24 Mar 2014 15:41:08 +0000 (15:41 +0000)]
mapi/glapi: Use ElementTree instead of libxml2.

It is quite hard to meet the dependency of the libxml2 python bindings
outside Linux, and in particularly on MacOSX; whereas ElementTree is
part of Python's standard library.  ElementTree is more limited than
libxml2: no DTD verification, defaults from DTD, or XInclude support,
but none of these limitations is serious enough to justify using
libxml2.

In fact, it was easier to refactor the code to use ElementTree than to
try to get libxml2 python bindings.

In the process, gl_item_factory class was refactored so that there is
one method for each kind of object to be created, as it simplifies
things substantially.

I confirmed that precisely the same output is generated for GL/GLX/GLES.

v2: Remove m4/ax_python_module.m4 as suggested by Matt Turner.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomapi/glapi: Remove glX_doc.py.
José Fonseca [Wed, 26 Mar 2014 12:20:01 +0000 (12:20 +0000)]
mapi/glapi: Remove glX_doc.py.

As suggested by Ian Romanick, given it's no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agost/mesa: fix sampler view handling with shared textures v4
Christian König [Sun, 23 Mar 2014 16:01:38 +0000 (17:01 +0100)]
st/mesa: fix sampler view handling with shared textures v4

Release the references to the sampler views before
destroying the pipe context.

v2: remove TODO and unrelated change
v3: move to st_texture.[ch], rename callback, add comment
v4: fix rebase mess up and add further cleanups

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agogallivm: fix no-op n:n lp_build_resize()
Roland Scheidegger [Tue, 25 Mar 2014 00:52:03 +0000 (01:52 +0100)]
gallivm: fix no-op n:n lp_build_resize()

This can get called in some circumstances if both src type and dst type
have same width (seen with float32->unorm32). While this particular case
was bogus anyway let's just fix that as it can work trivially (due to the
way it was called it actually worked anyway apart from the assert).

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agoi965: For fast color clears, only check the color of live channels.
Kevin Rogovin [Tue, 25 Mar 2014 06:37:16 +0000 (08:37 +0200)]
i965: For fast color clears, only check the color of live channels.

When deciding if a clear color is suitable for fast clear,
take into account if a color channel is active in the
buffer format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Set Broadwell MOCS values everywhere it's possible.
Kenneth Graunke [Wed, 5 Mar 2014 00:30:28 +0000 (16:30 -0800)]
i965: Set Broadwell MOCS values everywhere it's possible.

This patch introduces two pre-canned MOCS values: BDW_MOCS_WB
(write-back, all caches) and BDW_MOCS_WT (write-through, all caches).

We use write-through caching for render targets, and write-back for
all other data.  (At least on Haswell, I believe write-back LLC/eLLC
didn't work for scan-out buffers, while write-through did.)

No performance analysis has been done on the impact of this patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: In core profile, refuse to draw unless a VAO is bound.
Kenneth Graunke [Thu, 20 Mar 2014 18:53:16 +0000 (11:53 -0700)]
mesa: In core profile, refuse to draw unless a VAO is bound.

Core profile requires a non-default VAO to be bound.  Currently, calls
to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
and we never actually get any vertex data set.  Trying to draw without
any vertex data can only cause problems.  In i965, it causes a crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
10 years agoRevert "build: llvm libs may not be in system search path, add rpath"
Ilia Mirkin [Mon, 17 Mar 2014 13:41:15 +0000 (09:41 -0400)]
Revert "build: llvm libs may not be in system search path, add rpath"

This reverts commit d9b983519c63b9072677364a6e399d213a1855e5.

Unfortunately it seems like rpath is evaluated before LD_LIBRARY_PATH,
so this breaks e.g. steam, as well as any other user of that env var,
if the llvm path happens to be where other libs also reside.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76082
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoRevert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."
Chris Forbes [Tue, 25 Mar 2014 21:03:38 +0000 (10:03 +1300)]
Revert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."

This reverts commit 40d7b5195351d3e4199e7a840615a595a6dbaefc.

10 years agomesa: move GLbitfield any_valid_stages declaration before code
Brian Paul [Tue, 25 Mar 2014 19:32:59 +0000 (13:32 -0600)]
mesa: move GLbitfield any_valid_stages declaration before code

To fix MSVC build.

10 years agoglsl: Clean up "unused parameter" warnings
Ian Romanick [Wed, 12 Mar 2014 22:32:48 +0000 (15:32 -0700)]
glsl: Clean up "unused parameter" warnings

../../src/glsl/ir_constant_expression.cpp:486:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1633:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1752:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1761:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1769:1: warning: unused parameter 'variable_context' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Minor clean ups in constant_referenced
Ian Romanick [Wed, 12 Mar 2014 22:30:59 +0000 (15:30 -0700)]
glsl: Minor clean ups in constant_referenced

These could probably be squashed into one of the previous commits.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Remove ir_dereference::constant_referenced
Ian Romanick [Wed, 12 Mar 2014 22:14:12 +0000 (15:14 -0700)]
glsl: Remove ir_dereference::constant_referenced

All of the functionality is implemented in a private function in the one
file where it is used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Fold implementation of ir_dereference_array::constant_referenced into wrapper
Ian Romanick [Wed, 12 Mar 2014 22:10:59 +0000 (15:10 -0700)]
glsl: Fold implementation of ir_dereference_array::constant_referenced into wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Fold implementation of ir_dereference_record::constant_referenced into wrapper
Ian Romanick [Wed, 12 Mar 2014 22:01:12 +0000 (15:01 -0700)]
glsl: Fold implementation of ir_dereference_record::constant_referenced into wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Fold implementation of ir_dereference_variable::constant_referenced into wrapper
Ian Romanick [Wed, 12 Mar 2014 21:55:31 +0000 (14:55 -0700)]
glsl: Fold implementation of ir_dereference_variable::constant_referenced into wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Add wrapper function that calls ir_dereference::constant_referenced
Ian Romanick [Wed, 12 Mar 2014 21:38:42 +0000 (14:38 -0700)]
glsl: Add wrapper function that calls ir_dereference::constant_referenced

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Group all of the constant_referenced functions together
Ian Romanick [Wed, 12 Mar 2014 21:24:03 +0000 (14:24 -0700)]
glsl: Group all of the constant_referenced functions together

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoi965: fix dma_buf import with non-zero offset.
Gwenole Beauchesne [Mon, 10 Mar 2014 15:55:21 +0000 (16:55 +0100)]
i965: fix dma_buf import with non-zero offset.

Fix eglCreateImage() from a packed dma_buf surface with a non-zero offset
to pixels data. In particular, this fixes support for planar YUV surfaces
when they are individually mapped on a per-plane basis, i.e. when the
OES_EGL_image_external is not used and user application wants to use its
own shader code for composition, or processing on individual plane (OCL).

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Implement ValidateProgramPipeline
Gregory Hainaut [Sat, 29 Jun 2013 02:30:44 +0000 (19:30 -0700)]
mesa/sso: Implement ValidateProgramPipeline

Implementation note:
I don't use context for ralloc (don't know how).

The check on PROGRAM_SEPARABLE flags is also done when the pipeline
isn't bound.  It doesn't make any sense in a DSA style API.

Maybe we could replace _mesa_validate_program by
_mesa_validate_program_pipeline.  For example we could recreate a dummy
pipeline object.  However the new function checks also the
TEXTURE_IMAGE_UNIT number not sure of the impact.

V2:
Fix memory leak with ralloc_strdup
Formatting improvement

V3 (idr):
* Actually fix the leak of the InfoLog. :)
* Directly generate logs in to gl_pipeline_object::InfoLog via
  ralloc_asprintf isntead of using a temporary buffer.
* Split out from previous uber patch.
* Change spec references to include section numbers, etc.
* Fix a bug in checking that a different program isn't active in a stage
  between two stages that have the same program.  Specifically,

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentGeometryProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

should have been

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentFragmentProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

v4 (idr): Rework to use CurrentProgram array in loops.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Add _mesa_sampler_uniforms_pipeline_are_valid
Gregory Hainaut [Sat, 29 Jun 2013 02:26:27 +0000 (19:26 -0700)]
mesa/sso: Add _mesa_sampler_uniforms_pipeline_are_valid

This is much like _mesa_sampler_uniforms_are_valid, but it operates
across an entire pipeline object.

This function differs from _mesa_sampler_uniforms_are_valid in that it
directly creates the gl_pipeline_object::InfoLog instead of writing to
some temporary buffer.

This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Fix the loop bounds.  shProg isn't an array, so
ARRAY_SIZE(shProg) was 1, so only the vertex program was validated.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Add gl_pipeline_object::InfoLog support
Gregory Hainaut [Sat, 29 Jun 2013 02:22:15 +0000 (19:22 -0700)]
mesa/sso: Add gl_pipeline_object::InfoLog support

V2 (idr):
* Keep the behavior of other info logs in Mesa: and empty info log
  reports a GL_INFO_LOG_LENGTH of zero.
* Use a NULL pointer to denote an empty info log.
* Split out from previous uber patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGet
Gregory Hainaut [Fri, 3 May 2013 17:44:14 +0000 (19:44 +0200)]
mesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGet

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Implement _mesa_BindProgramPipeline
Gregory Hainaut [Fri, 3 May 2013 17:44:13 +0000 (19:44 +0200)]
mesa/sso: Implement _mesa_BindProgramPipeline

Test become green in piglit:

The updated ext_transform_feedback-api-errors:useprogstage_noactive useprogstage_active bind_pipeline
arb_separate_shader_object-GetProgramPipelineiv
arb_separate_shader_object-IsProgramPipeline

For the moment I reuse Driver.UseProgram but I guess it will be better
to create a UseProgramStages functions. Opinion is welcome

V2: formatting & rename

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in the
  extension spec.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Implement _mesa_UseProgramStages
Gregory Hainaut [Sat, 29 Jun 2013 00:59:55 +0000 (17:59 -0700)]
mesa/sso: Implement _mesa_UseProgramStages

Now arb_separate_shader_object-GetProgramPipelineiv should pass.

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in
  the extension spec.
* Split out from previous uber patch.

v4 (idr): Use _mesa_has_geometry_shaders in _mesa_UseProgramStages to
detect availability of geometry shaders.

v5 (idr): Whitespace cleanup, use _mesa_lookup_shader_program_err
instead of open-coding it again, and update some comments at the end of
_mesa_UseProgramStages.  All suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_program
Gregory Hainaut [Sat, 29 Jun 2013 00:18:35 +0000 (17:18 -0700)]
mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_program

Extend use_shader_program to support a different target. Allow to reuse the
function to update the pipeline state. Note I bypass the flush when target
isn't current. Maybe it would be better to create a new UseProgramStages
driver function

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa/sso: Update meta to save and restore SSO state.
Gregory Hainaut [Fri, 3 May 2013 17:44:11 +0000 (19:44 +0200)]
meta/sso: Update meta to save and restore SSO state.

save and restore _Shader/Pipeline binding point. Rational we don't want any
conflict when the program will be unattached.

V2: formatting improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: rename Shader to the pointer _Shader
Gregory Hainaut [Fri, 3 May 2013 17:44:10 +0000 (19:44 +0200)]
mesa/sso: rename Shader to the pointer _Shader

Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement

V3 (idr):
* Rebase fixes after a block of code was moved from ir_to_mesa.cpp to
  shaderapi.c.
* Trivial reformatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa/sso: replace Shader binding point with _Shader
Gregory Hainaut [Fri, 28 Jun 2013 21:33:54 +0000 (14:33 -0700)]
mesa/sso: replace Shader binding point with _Shader

To avoid NULL pointer check a default pipeline object is installed in
_Shader when no program is current

The spec say that UseProgram/UseShaderProgramEXT/ActiveProgramEXT got an
higher priority over the pipeline object. When default program is
uninstall, the pipeline is used if any was bound.

Note: A careful rename need to be done now...

V2: formating improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.
* Trivial reformatting.
* Updated comment of gl_context::_Shader

v4 (idr): Reformat spec quotations to look like spec quotations.  Update
comments describing what gl_context::_Shader can point to.  Bot
suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agollvmpipe: Simplify vertex and geometry shaders.
José Fonseca [Fri, 14 Mar 2014 17:01:05 +0000 (17:01 +0000)]
llvmpipe: Simplify vertex and geometry shaders.

Eliminate lp_vertex_shader, as it added nothing over draw_vertex_shader.

Simplify lp_geometry_shader, as most of the incoming state is unneeded.
(We could also just use draw_geometry_shader if we were willing to peek
inside the structure.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
10 years agodraw: Duplicate TGSI tokens in draw_pipe_pstipple module.
José Fonseca [Fri, 14 Mar 2014 16:57:34 +0000 (16:57 +0000)]
draw: Duplicate TGSI tokens in draw_pipe_pstipple module.

As done in draw_pipe_aaline and draw_pipe_aapoint modules.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agohaiku: Fix build through scons corrections and viewport fixes
Alexander von Gluck IV [Wed, 19 Mar 2014 00:58:01 +0000 (00:58 +0000)]
haiku: Fix build through scons corrections and viewport fixes

* Add HAVE_PTHREAD, we do have pthread support wrappers now for
  non-native Haiku threaded applications.
* Viewport changed behavior recently breaking the build.
  We fix this by looking at the gl_context ViewportArray
  (Thanks Brian for the idea)

Acked-by: Brian Paul <brianp@vmware.com>
10 years agoi965: For color clears, only disable writes to components that exist.
Kenneth Graunke [Fri, 21 Mar 2014 10:47:16 +0000 (03:47 -0700)]
i965: For color clears, only disable writes to components that exist.

The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 50%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

v2: Use _mesa_format_has_color_component() to properly handle ALPHA
    formats (and generally be less fragile).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
10 years agomesa: Skip clearing color buffers when color writes are disabled.
Kenneth Graunke [Fri, 21 Mar 2014 22:58:02 +0000 (15:58 -0700)]
mesa: Skip clearing color buffers when color writes are disabled.

WebGL Aquarium in Chrome 24 actually hits this.

v2: Move to core Mesa (wisely suggested by Ian); only consider
    components which actually exist.

v3: Use _mesa_format_has_color_component to determine whether components
    actually exist, fixing alpha format handling.

v4: Add a comment, as requested by Brian.  No actual code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
10 years agomesa: Introduce a _mesa_format_has_color_component() helper.
Kenneth Graunke [Mon, 24 Mar 2014 08:16:57 +0000 (01:16 -0700)]
mesa: Introduce a _mesa_format_has_color_component() helper.

When considering color write masks, we often want to know whether an
RGBA component actually contains any meaningful data.  This function
provides an easy way to answer that question, and handles luminance,
intensity, and alpha formats correctly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
10 years agoi965: Fix compiler warning about signed/unsigned.
Eric Anholt [Mon, 24 Mar 2014 18:16:38 +0000 (11:16 -0700)]
i965: Fix compiler warning about signed/unsigned.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/gen8: Change the winsys MSAA blits from blorp to meta.
Eric Anholt [Thu, 13 Feb 2014 19:03:49 +0000 (11:03 -0800)]
i965/gen8: Change the winsys MSAA blits from blorp to meta.

This gets us equivalent code paths on BDW and pre-BDW, except for stencil
(where we don't have MSAA stencil resolve code yet)

Improves MSAA-forced citybench by 7.94496% +/- 2.38429% (n=16).  Reduces
DRI2 MSAA glxgears performance by -12.3559% +/- 1.52845% (n=9).

v2: Move the new meta code to brw_meta_updownsample.c, name it
    brw_meta_updownsample(), add a comment about
    intel_rb_storage_first_mt_slice(), and rename that function and move
    the RB generation into it (review ideas by Ken).
v3: Fix 2 src vs dst pasteos in previous change.
v4: Skip this path pre-gen8 for now, until we can analyze the glxgears
    performance delta some more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.
Eric Anholt [Mon, 3 Mar 2014 17:16:48 +0000 (09:16 -0800)]
mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.

Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys
FBOs *can* have NeedsFinishRenderTexture set.

v2: Keep the short-circuit for non-BindRenderbufferTexImage() drivers
    (review by Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Skip reallocating the private MSAA miptree, unless it's resized.
Eric Anholt [Fri, 21 Mar 2014 23:20:13 +0000 (16:20 -0700)]
i965: Skip reallocating the private MSAA miptree, unless it's resized.

Even if the singlesample_mt got reopened from DRI due to
pageflipping/buffer swapping, our private miptree shouldn't need any
changes.

Improves performance of a little swapbuffers-loving microbenchmark with
MSAA forced on, by 1.2371% +/- 0.624802% (n=102)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Simplify the no-reopening-the-winsys-buffer tests.
Eric Anholt [Fri, 21 Mar 2014 22:25:49 +0000 (15:25 -0700)]
i965: Simplify the no-reopening-the-winsys-buffer tests.

The formatting was weird, and the tests were duplicated, and it is
guaranteed that mt->region exists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Don't forget to free the old singlesample_mt.
Eric Anholt [Fri, 21 Mar 2014 22:36:24 +0000 (15:36 -0700)]
i965: Don't forget to free the old singlesample_mt.

Fixes a memory leak with MSAA winsys buffers since my move of
singlesample_mt to the rb in 4e0924c5de5f3964e4ca81f923d877dbb59fad0a

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Add an env var for forcing window system MSAA.
Eric Anholt [Fri, 21 Mar 2014 23:36:22 +0000 (16:36 -0700)]
i965: Add an env var for forcing window system MSAA.

Sometimes it would be nice to benchmark some app with MSAA versus not, but
it doesn't offer the controls you want.  Just provide a handy knob to
force the issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/vec4: Eliminate dead writes to the flag register.
Matt Turner [Wed, 19 Mar 2014 02:19:02 +0000 (19:19 -0700)]
i965/vec4: Eliminate dead writes to the flag register.

For each write, search previous instructions for unread writes to the
flag register and remove them. Note that this will not eliminate the
last unread write.

total instructions in shared programs: 788074 -> 788004 (-0.01%)
instructions in affected programs:     4930 -> 4860 (-1.42%)

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Eliminate writes that are never read.
Matt Turner [Tue, 11 Mar 2014 20:16:37 +0000 (13:16 -0700)]
i965/vec4: Eliminate writes that are never read.

With an awful O(n^2) algorithm that searches previous instructions for
dead writes.

total instructions in shared programs: 805582 -> 788074 (-2.17%)
instructions in affected programs:     144561 -> 127053 (-12.11%)

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Factor code out of DCE into a separate function.
Matt Turner [Wed, 12 Mar 2014 21:23:40 +0000 (14:23 -0700)]
i965/vec4: Factor code out of DCE into a separate function.

Will be reused in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Let dead code eliminate trim dead channels.
Matt Turner [Tue, 11 Mar 2014 20:14:08 +0000 (13:14 -0700)]
i965/vec4: Let dead code eliminate trim dead channels.

That is, modify

   mad dst, a, b, c

to be

   mad dst.xyz, a, b, c

if dst.w is never read.

total instructions in shared programs: 811869 -> 805582 (-0.77%)
instructions in affected programs:     168287 -> 162000 (-3.74%)

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Track live ranges per-channel, not per vgrf.
Matt Turner [Tue, 11 Mar 2014 20:06:20 +0000 (13:06 -0700)]
i965/vec4: Track live ranges per-channel, not per vgrf.

Will be squashed with the next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Don't dead code eliminate instructions writing the flag.
Matt Turner [Tue, 11 Mar 2014 20:07:42 +0000 (13:07 -0700)]
i965/vec4: Don't dead code eliminate instructions writing the flag.

A future patch adds support for removing dead writes to the flag
register. This patch simplifies the logic until then.

total instructions in shared programs: 811813 -> 811869 (0.01%)
instructions in affected programs:     3378 -> 3434 (1.66%)

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Preparatory clean up of dead_code_eliminate().
Matt Turner [Tue, 11 Mar 2014 20:04:26 +0000 (13:04 -0700)]
i965/vec4: Preparatory clean up of dead_code_eliminate().

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Add is_null() method to dst_reg.
Matt Turner [Thu, 13 Mar 2014 18:21:36 +0000 (11:21 -0700)]
i965/vec4: Add is_null() method to dst_reg.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Print the predicate in dump_instructions().
Matt Turner [Thu, 13 Mar 2014 18:22:08 +0000 (11:22 -0700)]
i965/vec4: Print the predicate in dump_instructions().

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Rename depends_on_flags() to reads_flag().
Matt Turner [Wed, 12 Mar 2014 07:16:24 +0000 (00:16 -0700)]
i965/vec4: Rename depends_on_flags() to reads_flag().

To be consistent with the fs backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Add and use vec4_instruction::writes_flag().
Matt Turner [Wed, 12 Mar 2014 07:14:07 +0000 (00:14 -0700)]
i965/vec4: Add and use vec4_instruction::writes_flag().

To be consistent with the fs backend. Also the instruction scheduler
incorrectly considered SEL with a conditional modifier to read the flag
register.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Add missing doxygen close brace.
Matt Turner [Wed, 12 Mar 2014 07:11:27 +0000 (00:11 -0700)]
i965/vec4: Add missing doxygen close brace.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlier
Chris Forbes [Sun, 23 Mar 2014 09:41:28 +0000 (22:41 +1300)]
mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlier

The ARB_framebuffer_object spec lists this case before the
FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases.

Fixes two broken cases in piglit's fbo-incomplete test, if
ARB_ES2_compatibility is not advertised. (If it is, this is masked
because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER /
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: Fix format matching checks for GL_INTENSITY* internalformats.
Chris Forbes [Sun, 23 Mar 2014 09:07:02 +0000 (22:07 +1300)]
mesa: Fix format matching checks for GL_INTENSITY* internalformats.

GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: recreate sampler view on context change v3
Christian König [Sat, 22 Mar 2014 20:30:07 +0000 (21:30 +0100)]
st/mesa: recreate sampler view on context change v3

With shared glx contexts it is possible that a texture is create and used
in one context and then used in another one resulting in incorrect
sampler view usage.

v2: avoid template copy
v3: add XXX comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoi965: Report the type of color clear in INTEL_DEBUG=blorp.
Kenneth Graunke [Fri, 21 Mar 2014 11:47:32 +0000 (04:47 -0700)]
i965: Report the type of color clear in INTEL_DEBUG=blorp.

It's useful to know whether a clear is fast (MCS-based), using the
SIMD16 repdata message, or slow.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoradeonsi: disable fast color clear for 1D-tiled surfaces on CIK
Marek Olšák [Sat, 22 Mar 2014 16:25:26 +0000 (17:25 +0100)]
radeonsi: disable fast color clear for 1D-tiled surfaces on CIK

This will be re-enabled once my kernel fix lands.

10 years agoRevert "i965: For color clears, only disable writes to components that exist."
Kenneth Graunke [Sat, 22 Mar 2014 00:02:41 +0000 (17:02 -0700)]
Revert "i965: For color clears, only disable writes to components that exist."

This reverts commit 2919c3fdb40cf457f2e47f378a46f4cefa9e9f6d.

For formats like BGRX, looping through 0..num_components works fine.
But for formats like XRGB, we'd check the color mask for X and fail to
check it for B.

10 years agoi965: For color clears, only disable writes to components that exist.
Kenneth Graunke [Fri, 21 Mar 2014 10:47:16 +0000 (03:47 -0700)]
i965: For color clears, only disable writes to components that exist.

The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 40%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
10 years agoi965: Print number of multisamples in INTEL_DEBUG=blorp output.
Kenneth Graunke [Fri, 21 Mar 2014 09:33:09 +0000 (02:33 -0700)]
i965: Print number of multisamples in INTEL_DEBUG=blorp output.

This lets us distinguish MSAA resolves from other ordinary blits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
10 years agoi965: Drop BLT TexSubImage Y-tiling restriction on Gen6+.
Kenneth Graunke [Thu, 20 Mar 2014 21:41:43 +0000 (14:41 -0700)]
i965: Drop BLT TexSubImage Y-tiling restriction on Gen6+.

Currently, we don't use this path on Sandybridge because we suspect
other paths will be faster.  But we potentially could.  If we do, we
should allow it to support Y-tiled BLTs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965: Enable ARB_vertex_type_10f_11f_11f_rev for Gen4/5 also.
Chris Forbes [Fri, 21 Mar 2014 10:00:58 +0000 (23:00 +1300)]
i965: Enable ARB_vertex_type_10f_11f_11f_rev for Gen4/5 also.

Tested on ILK and CTG (with the GL3isms taken out of the piglits).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoclover: Fix typo in validate_object()
Tom Stellard [Fri, 21 Mar 2014 18:08:26 +0000 (11:08 -0700)]
clover: Fix typo in validate_object()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
10 years agollvmpipe: add support for b5g6r5_srgb
Roland Scheidegger [Thu, 20 Mar 2014 15:43:36 +0000 (16:43 +0100)]
llvmpipe: add support for b5g6r5_srgb

The conversion code for srgb was tuned for n x 4x8bit AoS -> 4 x nxfloat SoA
(and vice versa), fix this to handle also 16bit 565-style srgb formats.
Still not really all that generic, things like r10g10b10a2_srgb or
r4g4b4a4_srgb wouldn't work (the latter trivial to fix, the former would not
require more work to not crash but near certainly need some higher precision
calculation) but not needed right now.
The code is not fully optimized for this (could use more direct calculation
instead of expanding to 8-bit range first) but should be good enough.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agogallium: add b5g6r5 srgb format
Roland Scheidegger [Thu, 20 Mar 2014 15:27:57 +0000 (16:27 +0100)]
gallium: add b5g6r5 srgb format

GL generally doesn't seem to allow srgb formats with less (or more) than 8 bit
for the rgb channels, though some hw could easily do it (typically for formats
with up to 10 bits for the rgb channels, at least for formats with less than 8
bits support is likely widespread even). While it may be true there aren't
really any benefits for such formats, we need for it for d3d, though luckily
only for b5g6r5_srgb it seems.
So add this format along with the util code for conversion - since that util
code is heavily tuned for 8bit srgb this isn't really all that well optimized
and rounding doesn't seem right but at least it should give some halfway
meaningful results.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agonvc0/ir: move sample id to second source arg to fix sampler2DMS
Ilia Mirkin [Thu, 20 Mar 2014 21:37:00 +0000 (17:37 -0400)]
nvc0/ir: move sample id to second source arg to fix sampler2DMS

The nvc0 texfetch instruction expects the sample id to be in the second
source (usually used for the offset) rather than as part of the texture
coordinate.

This fixes all the sampler2DMS/Array tests on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
10 years agost/mesa: drop the lowering of quad strips to triangle strips
Marek Olšák [Mon, 10 Mar 2014 15:27:21 +0000 (16:27 +0100)]
st/mesa: drop the lowering of quad strips to triangle strips

This fallback to triangle strips is silly and should be done in drivers
if they need it.

This should fix the case when quad strips are used with flatshading that is
enabled by the "flat" GLSL varying modifier. It also fixes primitive restart
for quad strips.

This fixes piglit:
  NV_primitive_restart/primitive-restart-draw-mode-quad_strip

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallium/u_gen_mipmap: remove the software fallback
Marek Olšák [Wed, 12 Mar 2014 01:18:06 +0000 (02:18 +0100)]
gallium/u_gen_mipmap: remove the software fallback

The last changes to it are from 2008 and 2009.
It doesn't support most texture formats and some texture targets.
Nobody can possibly be using this.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: fix generating mipmaps for cube arrays
Marek Olšák [Tue, 11 Mar 2014 13:52:39 +0000 (14:52 +0100)]
st/mesa: fix generating mipmaps for cube arrays

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: fix software fallback for generating mipmaps for 3D textures
Marek Olšák [Wed, 12 Mar 2014 01:04:03 +0000 (02:04 +0100)]
mesa: fix software fallback for generating mipmaps for 3D textures

It didn't use the driver-provided src/dstRowStride at all.
This was broken for the cases when stride != width*bpp.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: fix software fallback for generating mipmaps for cube arrays
Marek Olšák [Tue, 11 Mar 2014 14:04:33 +0000 (15:04 +0100)]
mesa: fix software fallback for generating mipmaps for cube arrays

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: allow generating mipmaps for cube arrays
Marek Olšák [Tue, 11 Mar 2014 14:04:00 +0000 (15:04 +0100)]
mesa: allow generating mipmaps for cube arrays

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: fix texture border handling for cube arrays
Marek Olšák [Tue, 11 Mar 2014 14:02:39 +0000 (15:02 +0100)]
mesa: fix texture border handling for cube arrays

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agor600g: use more appropriate names for async DMA functions
Marek Olšák [Mon, 17 Mar 2014 00:19:51 +0000 (01:19 +0100)]
r600g: use more appropriate names for async DMA functions

*_dma_copy calls either *_dma_copy_buffer or *_dma_copy_tile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agor600g: deobfuscate async DMA code
Marek Olšák [Mon, 17 Mar 2014 00:18:43 +0000 (01:18 +0100)]
r600g: deobfuscate async DMA code

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agor600g: don't flush the gfx IB explicitly before doing DMA
Marek Olšák [Sun, 16 Mar 2014 18:59:50 +0000 (19:59 +0100)]
r600g: don't flush the gfx IB explicitly before doing DMA

It's flushed by calling r600_context_bo_reloc.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agowinsys/radeon: only add duplicate relocations for DMA if VM isn't supported
Marek Olšák [Sun, 16 Mar 2014 16:17:58 +0000 (17:17 +0100)]
winsys/radeon: only add duplicate relocations for DMA if VM isn't supported

Also rewrite the comment for it to be readable and reorder the code.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoradeonsi: Implement DMA blit
Niels Ole Salscheider [Mon, 17 Mar 2014 17:48:06 +0000 (18:48 +0100)]
radeonsi: Implement DMA blit

This code is a slightly modified version of evergreen_dma_blit (and
evergreen_dma_copy as well as evergreen_dma_copy_tile).
It would be nice to share some of the code in the long term.

I have reused some "cik"-prefixed functions that also return the right
value for SI. I am not sure if they should be renamed.

v2: Marek> removed gfx.flush in si_dma_copy_tile

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeon: Move r600_need_dma_space to common code
Niels Ole Salscheider [Mon, 17 Mar 2014 17:48:05 +0000 (18:48 +0100)]
radeon: Move r600_need_dma_space to common code

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agollvmpipe: Tighten check for alpha-only formats
Richard Sandiford [Wed, 19 Mar 2014 17:12:38 +0000 (17:12 +0000)]
llvmpipe: Tighten check for alpha-only formats

The AoS version of ld_build_blend_factor was assuming that if the first
channel was alpha, there were no rgb components.

Fixes glean/blendFunc on System z.  No piglit regressions on x86_64.
The shortcut is still used in tests like spec/ARB_framebuffer_object/
fbo-alpha.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
10 years agonouveau: don't assume libdrm include prefix
Jonathan Gray [Thu, 20 Mar 2014 03:43:29 +0000 (14:43 +1100)]
nouveau: don't assume libdrm include prefix

drm headers may be installed in a different directory

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonouveau: use DLOPEN_LIBS instead of -ldl
Jonathan Gray [Thu, 20 Mar 2014 03:45:04 +0000 (14:45 +1100)]
nouveau: use DLOPEN_LIBS instead of -ldl

libdl does not exist on many platforms which have dlopen in libc.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoc11/threads: don't include assert.h if the assert macro is already defined
Brian Paul [Tue, 18 Mar 2014 23:25:07 +0000 (17:25 -0600)]
c11/threads: don't include assert.h if the assert macro is already defined

In the gallium code, the assert() macro could come from either the
system's assert.h file (via c11/threads.h) or from gallium's u_debug.h.
It looks like all known assert.h files unconditionally #undef assert
before defining their own version.  So the assert you get depends on
whether threads.h or u_debug.h was included last.

In the gallium code we really want to use the assert() from u_debug.h
(it behaves better on Windows).  In gallium, c11/threads.h is only
included after u_debug.h in the os_thread.h wrapper.  So Adding
an #ifndef assert test in the threads*.h files avoids using the system's
assert().

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agonouveau: there may not have been a texture if the fbo was incomplete
Ilia Mirkin [Mon, 17 Mar 2014 14:37:12 +0000 (10:37 -0400)]
nouveau: there may not have been a texture if the fbo was incomplete

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agonouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list
Ilia Mirkin [Thu, 13 Mar 2014 14:36:25 +0000 (10:36 -0400)]
nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agomesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture
Ilia Mirkin [Thu, 13 Mar 2014 11:01:15 +0000 (07:01 -0400)]
mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture

EXT_packed_depth_stencil is supported by all drivers, but
ARB_depth_texture isn't (notably nouveau_vieux). This should avoid
passing unexpected values down to ChooseTextureFormat.

The EXT_packed_depth_stencil spec does not make any explicit references
to requiring ARB_depth_texture in order to allow textures with that
format, however if there is no dependency, ARB_depth_texture would be
practically implied by the extension.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Note for 10.0 backport: This will produce a conflict, the solution is to
move the surrounding if as well.

10 years agoloader: add special logic to distinguish nouveau from nouveau_vieux
Ilia Mirkin [Mon, 17 Mar 2014 18:42:12 +0000 (14:42 -0400)]
loader: add special logic to distinguish nouveau from nouveau_vieux

There are a lot of different pci ids supported by nouveau, and more are
added all the time. The relevant distinguisher between drivers is the
chipset id.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
10 years agoglsl: Allow dot() on scalars, and throw out dotlike().
Matt Turner [Sun, 2 Mar 2014 18:34:45 +0000 (10:34 -0800)]
glsl: Allow dot() on scalars, and throw out dotlike().

In all uses of dotlike() we're writing generic code that operates on 1-4
component vectors. That our IR requires ir_binop_dot expressions'
operands to be 2+ component vectors is an implementation detail that's
not important when implementing built-in functions with dot(), which is
defined for scalar floats in GLSL.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Optimize pow(x, 2) into x * x.
Matt Turner [Fri, 28 Feb 2014 21:33:19 +0000 (13:33 -0800)]
glsl: Optimize pow(x, 2) into x * x.

Cuts two instructions out of SynMark's Gl32VSInstancing benchmark.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Match whitespace changes from previous patch.
Matt Turner [Tue, 18 Mar 2014 22:40:49 +0000 (15:40 -0700)]
glsl: Match whitespace changes from previous patch.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Expose pack/unpack built-ins for ARB_gpu_shader5.
Matt Turner [Tue, 11 Mar 2014 19:36:04 +0000 (12:36 -0700)]
glsl: Expose pack/unpack built-ins for ARB_gpu_shader5.

ARB_gpu_shader5 and ES 3.0 expose different subsets of
ARB_shading_language_packing.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Drop some more dead code from the old CACHED_BATCH feature.
Eric Anholt [Thu, 13 Mar 2014 23:53:09 +0000 (16:53 -0700)]
i965: Drop some more dead code from the old CACHED_BATCH feature.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Drop special case for edgeflag thanks to Marek's change to core.
Eric Anholt [Wed, 5 Mar 2014 01:26:54 +0000 (17:26 -0800)]
i965: Drop special case for edgeflag thanks to Marek's change to core.

As of 780ce576bb1781f027797039693b98253ee4813e, we end up with R8_SSCALED
anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: include stdbool.h in register_allocate.h to fix build
Brian Paul [Tue, 18 Mar 2014 17:55:50 +0000 (11:55 -0600)]
mesa: include stdbool.h in register_allocate.h to fix build

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