summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-25Revert "build: llvm libs may not be in system search path, add rpath"HEADmasterIlia Mirkin1-1/+0
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>
2014-03-26Revert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."Chris Forbes1-12/+8
This reverts commit 40d7b5195351d3e4199e7a840615a595a6dbaefc.
2014-03-25mesa: move GLbitfield any_valid_stages declaration before codeBrian Paul1-1/+2
To fix MSVC build.
2014-03-25glsl: Clean up "unused parameter" warningsIan Romanick1-5/+5
../../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>
2014-03-25glsl: Minor clean ups in constant_referencedIan Romanick1-11/+6
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>
2014-03-25glsl: Remove ir_dereference::constant_referencedIan Romanick2-61/+0
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>
2014-03-25glsl: Fold implementation of ir_dereference_array::constant_referenced into ↵Ian Romanick1-46/+43
wrapper Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25glsl: Fold implementation of ir_dereference_record::constant_referenced into ↵Ian Romanick1-17/+21
wrapper Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25glsl: Fold implementation of ir_dereference_variable::constant_referenced ↵Ian Romanick1-12/+13
into wrapper Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25glsl: Add wrapper function that calls ir_dereference::constant_referencedIan Romanick1-16/+36
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25glsl: Group all of the constant_referenced functions togetherIan Romanick2-96/+109
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25i965: fix dma_buf import with non-zero offset.Gwenole Beauchesne1-0/+9
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>
2014-03-25mesa/sso: Implement ValidateProgramPipelineGregory Hainaut4-3/+203
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>
2014-03-25mesa/sso: Add _mesa_sampler_uniforms_pipeline_are_validGregory Hainaut2-0/+79
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>
2014-03-25mesa/sso: Add gl_pipeline_object::InfoLog supportGregory Hainaut2-3/+24
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>
2014-03-25mesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGetGregory Hainaut2-0/+12
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25mesa/sso: Implement _mesa_BindProgramPipelineGregory Hainaut1-0/+69
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>
2014-03-25mesa/sso: Implement _mesa_UseProgramStagesGregory Hainaut1-0/+102
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>
2014-03-25mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_programGregory Hainaut3-15/+24
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>
2014-03-25meta/sso: Update meta to save and restore SSO state.Gregory Hainaut2-0/+20
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>
2014-03-25mesa/sso: rename Shader to the pointer _ShaderGregory Hainaut32-110/+124
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>
2014-03-25mesa/sso: replace Shader binding point with _ShaderGregory Hainaut3-3/+125
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>
2014-03-25llvmpipe: Simplify vertex and geometry shaders.José Fonseca5-70/+33
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>
2014-03-25draw: Duplicate TGSI tokens in draw_pipe_pstipple module.José Fonseca1-1/+2
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>
2014-03-24haiku: Fix build through scons corrections and viewport fixesAlexander von Gluck IV2-3/+14
* 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>
2014-03-24i965: For color clears, only disable writes to components that exist.Kenneth Graunke1-1/+2
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>
2014-03-24mesa: Skip clearing color buffers when color writes are disabled.Kenneth Graunke1-1/+26
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>
2014-03-24mesa: Introduce a _mesa_format_has_color_component() helper.Kenneth Graunke2-0/+33
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>
2014-03-24i965: Fix compiler warning about signed/unsigned.Eric Anholt1-1/+1
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24i965/gen8: Change the winsys MSAA blits from blorp to meta.Eric Anholt4-8/+152
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>
2014-03-24mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.Eric Anholt1-2/+3
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>
2014-03-24i965: Skip reallocating the private MSAA miptree, unless it's resized.Eric Anholt1-17/+28
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>
2014-03-24i965: Simplify the no-reopening-the-winsys-buffer tests.Eric Anholt1-22/+16
The formatting was weird, and the tests were duplicated, and it is guaranteed that mt->region exists. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24i965: Don't forget to free the old singlesample_mt.Eric Anholt1-0/+1
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>
2014-03-24i965: Add an env var for forcing window system MSAA.Eric Anholt2-0/+17
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>
2014-03-24i965/vec4: Eliminate dead writes to the flag register.Matt Turner1-18/+48
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>
2014-03-24i965/vec4: Eliminate writes that are never read.Matt Turner1-0/+46
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>
2014-03-24i965/vec4: Factor code out of DCE into a separate function.Matt Turner1-34/+39
Will be reused in the next commit. Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Let dead code eliminate trim dead channels.Matt Turner1-3/+26
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>
2014-03-24i965/vec4: Track live ranges per-channel, not per vgrf.Matt Turner2-14/+41
Will be squashed with the next patch. Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Don't dead code eliminate instructions writing the flag.Matt Turner1-1/+5
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>
2014-03-24i965/vec4: Preparatory clean up of dead_code_eliminate().Matt Turner1-22/+23
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Add is_null() method to dst_reg.Matt Turner2-0/+10
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Print the predicate in dump_instructions().Matt Turner1-0/+5
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Rename depends_on_flags() to reads_flag().Matt Turner2-3/+3
To be consistent with the fs backend. Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24i965/vec4: Add and use vec4_instruction::writes_flag().Matt Turner2-2/+7
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>
2014-03-24i965/vec4: Add missing doxygen close brace.Matt Turner1-0/+1
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlierChris Forbes1-6/+6
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>
2014-03-25mesa: Fix format matching checks for GL_INTENSITY* internalformats.Chris Forbes1-8/+12
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>
2014-03-24st/mesa: recreate sampler view on context change v3Christian König1-0/+10
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>