José Fonseca [Thu, 1 May 2014 13:18:15 +0000 (14:18 +0100)]
util/u_debug_flush: Use util_snprintf.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Emil Velikov [Sat, 5 Apr 2014 01:15:33 +0000 (02:15 +0100)]
targets/omx: add nouveau target
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Sat, 5 Apr 2014 01:42:30 +0000 (02:42 +0100)]
targets/omx: use GALLIUM_VIDEO_CFLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Emil Velikov [Sat, 5 Apr 2014 17:04:18 +0000 (18:04 +0100)]
targets/pipe-loader: cleanup version-script
Drop the version/name tag from the script as it was never
meant to be there. Add swrast_create_screen as it is used
when loading swrast. Rename the file to pipe.sym.
v2: Rebase on top of the LD_NO_UNDEFINED changes.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Emil Velikov [Fri, 4 Apr 2014 22:37:15 +0000 (23:37 +0100)]
targets/opencl: hide all the exported llvm/clang mayhem... hopefully
Both llvm and clang polute the exported symbol table, as soon
as we try to link with either one. Other than those two
everything else looks good (clean).
Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Emil Velikov [Sat, 5 Apr 2014 17:03:05 +0000 (18:03 +0100)]
targets/egl-static: freshen up the version script
Namely drop the version/name tag of the exported symbol, and
rename the filename to egl.sym.
v2: Rebase on top of the LD_NO_UNDEFINED changes.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 4 Apr 2014 20:44:36 +0000 (21:44 +0100)]
targets/gbm: add version-script to limit exported symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 4 Apr 2014 22:59:30 +0000 (23:59 +0100)]
targets/vdpau: use version script to limit the exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Emil Velikov [Sat, 5 Apr 2014 17:09:59 +0000 (18:09 +0100)]
targets/omx: drop the version from the omx targets
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 4 Apr 2014 22:53:13 +0000 (23:53 +0100)]
targets/omx: use version script to limit amount of exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.
radeon_drm_winsys_create is not needed, avoid exporting it.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Emil Velikov [Fri, 4 Apr 2014 22:52:21 +0000 (23:52 +0100)]
targets/dri: use a single version script to restict exported symbols
Rather than having multiple (almost) identical version scripts use
a single one.
Cc: Christian König <christian.koenig@amd.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 4 Apr 2014 22:46:13 +0000 (23:46 +0100)]
targets/xvmc: limit the amount of exported symbols
In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).
Considering that there are only ~25 symbols, explicitly list them
to minimize the chances of rogue symbols sneaking in.
Drop the *winsys_create functions as they were only meant for
gl-vdpau interop.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Emil Velikov [Fri, 4 Apr 2014 17:32:38 +0000 (18:32 +0100)]
targets/osmesa: hide osmesa_create_screen
The symbol is not meant to be exported, and its presence was
only a side effect due to the missing visibility flags.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Emil Velikov [Fri, 4 Apr 2014 14:45:08 +0000 (15:45 +0100)]
targets/pipe-loader: drop driver_descriptor symbol from swrast
The symbol is used for hardware only drivers. For swrast the
loader uses swrast_create_screen. Add VISIBILITY_CFLAGS while
we're here.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Juha-Pekka Heikkila [Sun, 27 Apr 2014 20:04:58 +0000 (23:04 +0300)]
mesa: add extra null checks in vbo_rebase_prims()
v2 [idr]: Move declarations before code to prevent MSVC build breaks.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Juha-Pekka Heikkila [Sun, 27 Apr 2014 20:04:57 +0000 (23:04 +0300)]
mesa: add missing null checks in _tnl_register_fastpath()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Tue, 4 Mar 2014 13:39:37 +0000 (15:39 +0200)]
mesa: Add _mesa_error_no_memory for logging out-of-memory messages
This can be called from locations that don't have a context pointer
handy. This patch also adds enough infrastructure so that the unit
tests for the GLSL compiler and the stand-alone compiler will build and
function.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Chia-I Wu [Tue, 22 Apr 2014 08:58:16 +0000 (16:58 +0800)]
glsl: make static constant variables "static const"
This allows them to be moved to .rodata, and allow us to be sure that they
will not be modified.
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Petri Latvala [Wed, 23 Apr 2014 08:08:55 +0000 (11:08 +0300)]
docs: update 10.2 release notes
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Petri Latvala [Wed, 23 Apr 2014 08:08:54 +0000 (11:08 +0300)]
i965: Enable INTEL_performance_query for Gen5+.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Petri Latvala [Wed, 23 Apr 2014 08:08:53 +0000 (11:08 +0300)]
mesa: Implement INTEL_performance_query.
Using the existing driver hooks made for AMD_performance_monitor, implement
INTEL_performance_query functions.
v2: Whitespace changes.
v3: Whitespace changes, add a _mesa_warning()
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Petri Latvala [Wed, 23 Apr 2014 08:08:52 +0000 (11:08 +0300)]
mesa: Add core support for the GL_INTEL_performance_query extension.
Like AMD_performance_monitor, this extension provides an interface for
applications (and OpenGL-based tools) to access GPU performance
counters. Since the exact performance counters available vary between
vendors and hardware generations, the extension provides an API the
application can use to get the names, types, and minimum/maximum
values of all available counters.
Applications create performance queries based on available query
types, and begin/end measurement collection. Multiple queries can be
measuring simultaneously.
v2: Whitespace changes
v3: src/mapi/glapi/gen/gl_API.xml: Also expose the functions to GLES2.
v4: Whitespace changes, static_dispatch="false" for all functions, fix
dispatch_sanity test for GLES2 functions
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Petri Latvala [Wed, 23 Apr 2014 08:08:51 +0000 (11:08 +0300)]
mesa: Add INTEL_performance_query enums to tests/enum_strings.cpp
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Petri Latvala [Wed, 23 Apr 2014 08:08:50 +0000 (11:08 +0300)]
Regenerate gl_mangle.h.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Ilia Mirkin [Thu, 1 May 2014 02:08:33 +0000 (22:08 -0400)]
docs: update ARB_buffer_storage for nouveau
Ilia Mirkin [Wed, 30 Apr 2014 20:45:16 +0000 (16:45 -0400)]
nouveau: add ARB_buffer_storage support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Wed, 30 Apr 2014 06:08:52 +0000 (02:08 -0400)]
nouveau: remove cb_dirty, it's never used
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Wed, 30 Apr 2014 01:51:42 +0000 (21:51 -0400)]
nvc0: treat non-linear 2DRect textures the same as 2D
This fixes textureGather(2DRect) piglit tests, and does not appear to
have any adverse effects.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Tue, 29 Apr 2014 03:13:37 +0000 (23:13 -0400)]
mesa/st: enable carry/borrow lowering pass
This handles the last of the ARB_gs5 instructions currently present in
mesa.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Ilia Mirkin [Tue, 29 Apr 2014 03:13:08 +0000 (23:13 -0400)]
glsl: add lowering passes for carry/borrow
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Ian Romanick [Thu, 27 Mar 2014 17:29:30 +0000 (10:29 -0700)]
mesa: Eliminate gl_shader_program::InternalSeparateShader
This was a work-around to allow linking a program with only a fragment
shader in a GLES context. Now that we have GL_EXT_separate_shader_objects
in GLES contexts, we can just use that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Wed, 26 Mar 2014 20:11:44 +0000 (13:11 -0700)]
mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Wed, 26 Mar 2014 18:43:32 +0000 (11:43 -0700)]
glsl: Sort the list of extensions
ARB, OES, then everything else. If there's ever a KHR shading language
extension, it should go between ARB and OES.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Wed, 26 Mar 2014 18:25:16 +0000 (11:25 -0700)]
mesa: Remove support for desktop OpenGL GL_EXT_separate_shader_objects
I don't know of any applications that actually use it. Now that Mesa
supports GL_ARB_separate_shader_objects in all drivers, this extension
is just cruft.
The entrypoints for the extension remain in the XML. This is done so
that a new libGL will continue to provide dispatch support for old
drivers that try to expose this extension.
Future patches will add OpenGL ES GL_EXT_separate_shader_objects, but
that's a different thing.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Sat, 29 Jun 2013 02:39:28 +0000 (19:39 -0700)]
mesa/sso: Enable GL_ARB_separate_shader_objects by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Tue, 29 Apr 2014 23:24:24 +0000 (16:24 -0700)]
sso: Add display list support for ARB_separate_shader_objects new functions
With this patch, the piglit arb_separate_shader_object-dlist test
passes.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Wed, 2 Oct 2013 19:39:29 +0000 (12:39 -0700)]
linker: Modify cross_validate_outputs_to_inputs to match using explicit locations
This will be used for GL_ARB_separate_shader_objects. That extension
not only allows separable shaders to rendezvous by location, but it also
allows traditionally linked shaders to rendezvous by location. The spec
says:
36. How does the behavior of input/output interface matching differ
between separable programs and non-separable programs?
RESOLVED: The rules for matching individual variables or block
members between stages are identical for separable and
non-separable programs, with one exception -- matching variables
of different type with the same location, as discussed in issue
34, applies only to separable programs.
However, the ability to enforce matching requirements differs
between program types. In non-separable programs, both sides of
an interface are contained in the same linked program. In this
case, if the linker detects a mismatch, it will generate a link
error.
v2: Make sure consumer_inputs_with_locations is initialized when
consumer is NULL. Noticed by Chia-I.
v3: Rebase on removal of ir_variable::user_location.
v4: Replace a (stale) FINISHME with some good explanation comments from
Eric.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Tue, 11 Feb 2014 23:38:23 +0000 (15:38 -0800)]
linker: Sort shader I/O variables into a canonical order
v2: Rebase on removal of ir_variable::user_location.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Fri, 24 Jan 2014 02:26:29 +0000 (18:26 -0800)]
linker: Allow geometry shader without vertex shader for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Fri, 14 Feb 2014 20:10:27 +0000 (12:10 -0800)]
linker: Assign varying locations for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Fri, 14 Feb 2014 20:08:53 +0000 (12:08 -0800)]
linker: Allow consumer stage or producer stage to be NULL
When linking a separable program that contains only a fragment shader,
the producer will be NULL. Similar cases will exist with geometry
shaders and, eventually, tessellation shaders.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Thu, 3 Oct 2013 01:01:13 +0000 (18:01 -0700)]
linker: Refactor code that gets an input matching an output
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Wed, 2 Oct 2013 22:57:03 +0000 (15:57 -0700)]
glsl: Exit when the shader IR contains an interface block instance
While writing the link_varyings::single_interface_input test, I
discovered that populate_consumer_input_sets assumes that all shader
interface blocks have been lowered to discrete variables. Since there
is a pass that does this, it is a reasonable assumption. It was,
however, non-obvious. Make the code fail when it encounters such a
thing, and add a test to verify that behavior.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Wed, 2 Oct 2013 22:44:14 +0000 (15:44 -0700)]
glsl/tests: Add first simple tests of populate_consumer_input_sets
Four initial tests:
* Create an IR list with a single input variable and verify that
variable is the only thing in the hash tables.
* Same as the previous test, but use a built-in variable
(gl_ClipDistance) with an explicit location set.
* Create an IR list with a single input variable from an interface block
and verify that variable is the only thing in the hash tables.
* Create an IR list with a single input variable and a single input
variable from an interface block. Verify that each is the only thing
in the proper hash tables.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Wed, 2 Oct 2013 22:39:45 +0000 (15:39 -0700)]
linker: Refactor code that builds hash tables of varyings during linking
I want to make some changes to this code, but first I want to make some
unit tests for it... so that I can capture the pre- and
post-invariants. Pulling the code out into its own function in a
non-anonymous namespace enables that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 26 Mar 2014 01:34:31 +0000 (18:34 -0700)]
meta: Fix saving the program pipeline state
This code was broken in some odd ways before. Too much state was being
saved, it was being restored in the wrong order, and in the wrong way.
The biggest problem was that the pipeline object was restored before
restoring the programs attached to the default pipeline.
Fixes a regression in the glean texgen test.
v3: Fairly significant re-write. I think it's much cleaner now, and it
avoids a bug with some meta ops that use shaders (reported by Chia-I).
v4: Check Pipeline.Current against NULL instead of Pipeline.Default.
Suggested by Chia-I.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Ian Romanick [Wed, 26 Mar 2014 01:19:42 +0000 (18:19 -0700)]
mesa/sso: Refactor new function _mesa_bind_pipeline
Pull most of the guts out of _mesa_BindPipeline into a new utility
function that can be use elsewhere (e.g., meta).
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Sun, 27 Apr 2014 21:16:48 +0000 (14:16 -0700)]
linker: Make lower_packed_varyings work with explicit locations
Don't do anything with variables that have explicitly assigned
locations. This is also how built-in varyings are handled.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Sun, 27 Apr 2014 00:45:35 +0000 (17:45 -0700)]
glsl: Remove varying "base" parameters
In February 2013 Paul unified the values used for shader stage outputs
and shader stage inputs. See commits
8a076c5f0^..
eed6baf76. Since that
time, the location_base parameters are always VARYING_SLOT_VAR0.
Instead of passing that around, just hard code it.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Thu, 13 Feb 2014 00:35:57 +0000 (16:35 -0800)]
glsl: Constify parameter to a couple varying_matches methods
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tom Stellard [Wed, 30 Apr 2014 19:57:24 +0000 (12:57 -0700)]
clover: Add a stub implementation of clCreateImage() v3
Now that we are uisng the OpenCL 1.2 headers, applications expect all
the OpenCL 1.2 functions to be implemented.
This fixes linking errors with the piglit CL tests.
v2:
- Use c++ features
- Fix error code handling
v3:
- Move <iostream> into api/util.hpp
- Fix indentation
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Chris Forbes [Fri, 2 May 2014 05:09:13 +0000 (17:09 +1200)]
docs: Add missing ARB_gpu_shader5 subfeature to GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Fredrik Höglund [Mon, 18 Nov 2013 17:53:23 +0000 (18:53 +0100)]
docs: Mark ARB_multi_bind as done
...and update relnotes.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 19:07:30 +0000 (20:07 +0100)]
mesa: Enable ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 17 Jan 2014 17:37:06 +0000 (18:37 +0100)]
mesa: Implement glBindImageTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 19:01:07 +0000 (20:01 +0100)]
mesa: Implement glBindVertexBuffers
v2: Use the user provided offset and stride when the buffer ID is zero.
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
Fredrik Höglund [Fri, 15 Nov 2013 18:57:41 +0000 (19:57 +0100)]
mesa: Implement glBindBuffersRange
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:56:07 +0000 (19:56 +0100)]
mesa: Implement glBindBuffersBase
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:53:29 +0000 (19:53 +0100)]
mesa: Add _mesa_set_transform_feedback_binding()
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:51:02 +0000 (19:51 +0100)]
mesa: Refactor set_ubo_binding()
Make set_ubo_binding() just update the binding, and move the code
that does validation, flushes the vertices etc. into a new
bind_uniform_buffer() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:47:20 +0000 (19:47 +0100)]
mesa: Add helper functions for looking up multiple buffers
v2: Document the difference between _mesa_lookup_bufferobj() and
_mesa_multi_bind_lookup_bufferobj().
v3: Don't create the buffer objects when they don't exist.
Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Fredrik Höglund [Fri, 15 Nov 2013 18:45:43 +0000 (19:45 +0100)]
mesa: Refactor set_atomic_buffer_binding()
Make set_atomic_buffer_binding() just update the binding, and move
the code that does validation, flushes the vertices etc. into a new
bind_atomic_buffer() function.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:43:01 +0000 (19:43 +0100)]
mesa: Implement glBindTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Thu, 23 Jan 2014 13:02:24 +0000 (14:02 +0100)]
mesa: Add a texUnit parameter to dd_function_table::BindTexture
This is for glBindTextures(), since it doesn't change the active
texture unit.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 17 Jan 2014 17:35:31 +0000 (18:35 +0100)]
mesa: Add helper functions for looking up multiple textures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Fri, 15 Nov 2013 18:41:11 +0000 (19:41 +0100)]
mesa: Implement glBindSamplers
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Wed, 13 Nov 2013 18:02:10 +0000 (19:02 +0100)]
glapi: Add infrastructure for ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Wed, 13 Nov 2013 17:46:03 +0000 (18:46 +0100)]
mesa: Add functions for doing unlocked hash table lookups
This patch adds functions for locking/unlocking the mutex, along with
_mesa_HashLookupLocked() and _mesa_HashInsertLocked()
that do lookups and insertions without locking the mutex.
These functions will be used by the ARB_multi_bind entry points to
avoid locking/unlocking the mutex for each binding point.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Tue, 12 Nov 2013 16:34:35 +0000 (17:34 +0100)]
mesa: Optimize unbind_texobj_from_texunits()
The texture can only be bound to the index that corresponds to its
target, so there is no need to loop over all possible indices
for every unit and checking if the texture is bound to it.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Tue, 12 Nov 2013 16:28:12 +0000 (17:28 +0100)]
mesa: Add a _BoundTextures field in gl_texture_unit
This will be used by glBindTextures() when unbinding textures,
to avoid having to loop over all the targets.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fredrik Höglund [Tue, 12 Nov 2013 16:23:05 +0000 (17:23 +0100)]
mesa: Store the target index in gl_texture_object
This will be used by glBindTextures() so we don't have to look it up
for each texture.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Tue, 29 Apr 2014 22:31:16 +0000 (15:31 -0700)]
i965: Fix the file comment for intel_image.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Tue, 29 Apr 2014 22:30:15 +0000 (15:30 -0700)]
i965: Rename intel_regions.h to something more appropriate now.
We had the EGLimage structure laying around in intel_regions.h, but now
it's the only thing left in the file.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 20:50:10 +0000 (13:50 -0700)]
i965: Delete the intel_regions.c code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 20:44:41 +0000 (13:44 -0700)]
i965: Drop region usage from DRI2 winsys-allocated buffers.
v2: Fix bad pointer on unreference (caught by Chad)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Eric Anholt [Fri, 25 Apr 2014 22:18:14 +0000 (15:18 -0700)]
i965: Drop a funny assert about mt pitch.
I slipped this in in the region->pitch change from pixels to bytes, but I
don't see any reason for it any more -- the libdrm code doesn't appear to
divide pitch by a cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 22:14:47 +0000 (15:14 -0700)]
i965: Fix intel_bufferobj_buffer range for blit drawpixels.
If the stride wasn't width*cpp, we wouldn't track how much of the src is
busy, and allow a subdata into the end to proceed unsynchronized.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 20:29:41 +0000 (13:29 -0700)]
i965: Drop use of intel_region from miptrees.
Note: region->width/height used to reflect the total_width/height padding
of separate stencil, though mt->total_width didn't. region->width/height
was being used in EGL images, where the padded value would have been the
wrong one, so I converted them to use rb->Width/Height.
v2: Drop debug printf that slipped in (caught by Ken)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 19:14:34 +0000 (12:14 -0700)]
i965: Replace the region in DRIimage with just a BO pointer and stride.
Regions aren't refcounted safely for multithreaded applications, and
they're not terribly useful wrappers of a BO, so I'm trying to remove
them.
Even the stride I added here could probably be reduced to use of an
existing field in the __DRIimageRec, but I want this to be as mechanical
of a change as possible.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 20:18:48 +0000 (13:18 -0700)]
i965: Make intel_set_texture_region just take a BO and pitch.
I want to do this to get the region removed from DRI images. However, it
does mean that we won't share the intel_region between the rb and the
texture for texture_from_pixmap. I think that's fine.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 19:38:01 +0000 (12:38 -0700)]
i965: Stop making a pointless region for DRI2 to just throw it away.
I noticed that we were doing this while changing the DRI3 path to not use
regions, which involved changing the signature of
intel_update_winsys_renderbuffer_miptree() this way.
v2: Replace my comment with Chad's version.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 19:21:11 +0000 (12:21 -0700)]
i965: Drop the global GEM name from regions.
Once a buffer has been named, drm_intel_bo_flink() is just a getter.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 19:10:57 +0000 (12:10 -0700)]
i965: Drop the tiling argument to intel_miptree_create_for_bo.
The drm function to get the tiling is just a getter storing the two
pointers, so we don't need to go out of our way to avoid it.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 18:47:13 +0000 (11:47 -0700)]
i965: Drop pointless cast of texObj to intelObj.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 18:36:38 +0000 (11:36 -0700)]
i965: Move intel_region_get_aligned_offset() to be a miptree function.
All the consumers are doing it on a miptree.
v2: fix a silly duplicated dereference (review by Ken)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
Eric Anholt [Fri, 25 Apr 2014 18:20:57 +0000 (11:20 -0700)]
i965: Move intel_region_get_tile_masks() to be a miptree function.
All the consumers are doing it on a miptree.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 18:19:05 +0000 (11:19 -0700)]
i965: Fix another broken offset-aligned-to-tile test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 18:17:41 +0000 (11:17 -0700)]
i965: Fix offset-aligned-to-tile test in dma_buf import.
v1 of the patch got pushed, insted of the v2 that I had reviewed.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Fri, 25 Apr 2014 18:26:27 +0000 (11:26 -0700)]
i965: Reuse intel_miptree_get_tile_offsets().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Brian Paul [Thu, 1 May 2014 19:05:19 +0000 (13:05 -0600)]
mesa: move declarations before code in texstore.c
To fix MSVC build.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Ville Syrjälä [Thu, 24 Apr 2014 11:11:44 +0000 (14:11 +0300)]
i965: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.
In practice this makes the depth buffer Z24 even if the visual has
depthBits==16.
The incorrect depth buffer format doesn't seem to cause any actual
problems in i965, but it seems like we should fix it anyway. I see
Z16 has been more or less deprecated in the driver except the for
the depthBits==16 case. But if we want to use Z24 even in that
case (not sure it's really legal?) it would look better if the
code made that decision explicitly rather than relying on the
format to get magically overwritten by the renderbuffer code.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Ville Syrjälä [Thu, 24 Apr 2014 11:11:43 +0000 (14:11 +0300)]
i915: Don't advertise Z formats in TextureFormatSupported on gen2
Gen2 doesn't support texturing from Z formats, so state as much.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Ville Syrjälä [Thu, 24 Apr 2014 11:11:42 +0000 (14:11 +0300)]
i915: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.
Long time ago things worked by accident because
_mesa_choose_tex_format() checked for ARB_depth_texture
and thus returned MESA_FORMAT_NONE on gen2 hardware. Somehow
that ended up working when depthBits==16 because the driver
would then pick DEPTH_FRMT_16_FIXED. Not sure how, but things
also seemed to work with depthBits==24.
Things started to go more sideways at:
commit
6ae473221a53d8bcb584021483c5328797c6b67c
Author: Eric Anholt <eric@anholt.net>
Date: Mon Apr 22 16:04:25 2013 -0700
intel: Fold the one last function intel_tex_format.c into the caller.
since that caused intel_miptree_create_layout() to divide by zero
when encoutering MESA_FORMAT_NONE (bw==0). So after this
commit things were broken enough that many applications wouldn't even
run.
Things got a bit better at:
commit
c245efe7e8247ba0c845dee7b77e63fdbfc7e1b3
Author: Eric Anholt <eric@anholt.net>
Date: Thu Mar 21 09:50:45 2013 -0700
mesa: Remove extension checking from ChooseTexFormat.
since now _mesa_choose_tex_format() would return MESA_FORMAT_X8_Z24
for GL_DEPTH_COMPONENT due to i915 erroneosly claiming that
MESA_FORMAT_X8_S24 (and others) are supported texture formats even
on gen2 hardware. So now the the div-by-zero was gone, but now the
driver would pick DEPTH_FRMT_24_FIXED_8_OTHER even when
depthBits==16 which caused rendering problems.
If we prevent rb->Format from getting clobbered for the depth buffer
things work much better. This makes the spinning title text visible
again in chromium-bsu at 16bpp, for example.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Anuj Phogat [Fri, 21 Mar 2014 18:19:42 +0000 (11:19 -0700)]
mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()
Fixes a crash in Khronos OpenGL CTS packed_pixels tests.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Fri, 21 Mar 2014 18:16:00 +0000 (11:16 -0700)]
mesa: Add support to unpack depth-stencil texture in to FLOAT_32_UNSIGNED_INT_24_8_REV
V2: Follow the new naming convention for unpack functions.
Use double precision for converting Z24 to a float.
V3: Unpack stencil value to most significant byte.
Use 'struct z32f_x24s8' type.
V4: Unpack stencil value to least significant byte.
Add a comment to clarify stencil packing.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Fri, 21 Mar 2014 18:05:55 +0000 (11:05 -0700)]
mesa: Add new helper function _mesa_unpack_depth_stencil_row()
This patch makes non-functional changes in the code. New helper
function added here will make it easier to support more data
types in the following patches.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Thu, 20 Mar 2014 19:16:40 +0000 (12:16 -0700)]
mesa: Remove redundant if checks in _mesa_texstore_xx_xx() functions
This patch contains non-functional changes. Assertion checks made
earlier in the functions make the if checks redundant. So, remove
the if checks and unindent the code in if block.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Fri, 21 Mar 2014 20:07:13 +0000 (13:07 -0700)]
mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions
_mesa_texstore_z24_s8() and _mesa_texstore_z32f_x24s8() are capable of
handling GL_DEPTH_STENCIL format. So, allow it in both the functions.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Fri, 21 Mar 2014 19:55:19 +0000 (12:55 -0700)]
mesa: Add missing types in _mesa_texstore_xx_xx() functions
Depth-stencil teture targets are allowed to use source data of type
GL_UNSIGNED_INT_24_8_EXT and GL_FLOAT_32_UNSIGNED_INT_24_8_REV.
Fixes few crashes in Khronos OpenGL CTS packed_pixels tests.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Anuj Phogat [Wed, 19 Mar 2014 18:55:50 +0000 (11:55 -0700)]
i965: Fix crash in do_blit_readpixels()
Fixes a crash in Khronos CTS packed_pixels tests.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>