Antia Puentes [Mon, 30 Nov 2015 19:26:30 +0000 (20:26 +0100)]
mesa/main: Extend _mesa_base_format_has_channel to accept new pnames
The new pnames accepted by the function are:
- INTERNALFORMAT_RED_SIZE
- INTERNALFORMAT_GREEN_SIZE
- INTERNALFORMAT_BLUE_SIZE
- INTERNALFORMAT_ALPHA_SIZE
- INTERNALFORMAT_DEPTH_SIZE
- INTERNALFORMAT_STENCIL_SIZE
- INTERNALFORMAT_RED_TYPE
- INTERNALFORMAT_GREEN_TYPE
- INTERNALFORMAT_BLUE_TYPE
- INTERNALFORMAT_ALPHA_TYPE
- INTERNALFORMAT_DEPTH_TYPE
- INTERNALFORMAT_STENCIL_TYPE
It will be used by the ARB_internalformat_query2 implementation to
implement those pnames.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Mon, 30 Nov 2015 19:37:24 +0000 (20:37 +0100)]
mesa/main: Make legal_get_tex_level_parameter_target public
It will be used by the ARB_internalformat_query2 implementation
to check if the target is valid for those <pnames> that are said
in the spec that should return the same values than the
'glGetTexLevelParameter{if}v' function:
- INTERNALFORMAT_RED_SIZE
- INTERNALFORMAT_GREEN_SIZE
- INTERNALFORMAT_BLUE_SIZE
- INTERNALFORMAT_ALPHA_SIZE
- INTERNALFORMAT_DEPTH_SIZE
- INTERNALFORMAT_STENCIL_SIZE
- INTERNALFORMAT_SHARED_SIZE
- INTERNALFORMAT_RED_TYPE
- INTERNALFORMAT_GREEN_TYPE
- INTERNALFORMAT_BLUE_TYPE
- INTERNALFORMAT_ALPHA_TYPE
- INTERNALFORMAT_DEPTH_TYPE
- INTERNALFORMAT_STENCIL_TYPE
- IMAGE_FORMAT_COMPATIBILITY_TYPE
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Sat, 19 Dec 2015 16:03:18 +0000 (17:03 +0100)]
mesa/formatquery: Added INTERNALFORMAT_PREFERRED pname
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Tue, 22 Dec 2015 14:14:23 +0000 (15:14 +0100)]
mesa/formatquery: Added the INTERNALFORMAT_SUPPORTED <pname> query
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Tue, 22 Dec 2015 14:07:57 +0000 (15:07 +0100)]
mesa/formatquery: Added a func to check <internalformat> supported
From the ARB_internalformat_query2 specification:
"The INTERNALFORMAT_SUPPORTED <pname> can be used to determine if
the internal format is supported, and the other <pnames> are defined
in terms of whether or not the format is supported."
v2: Consider also FBO base formats when checking if the internalformat is
supported.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Sat, 19 Dec 2015 15:02:05 +0000 (16:02 +0100)]
mesa/formatquery: Added func to check if the 'resource' is supported
Checks that the 'resource', as defined by the ARB_internalformat_query2
specification, is supported by the implementation for those 'pnames'
that require this check.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Alejandro Piñeiro [Fri, 20 Nov 2015 09:34:50 +0000 (10:34 +0100)]
mesa/main: not fill mesa_error on _mesa_legal_texture_base_format_for_target
This would allow to use this method if you are just querying if it is
allowed, like for arb_internalformat_query2.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Sun, 15 Nov 2015 20:31:36 +0000 (21:31 +0100)]
mesa/teximage: Make _mesa_format_no_online_compression public
It will be used by the ARB_internalformat_query2 implementation
to check if a certain compressed 'internalformat' is supported
by texture 'targets'.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Wed, 4 Nov 2015 15:51:01 +0000 (16:51 +0100)]
mesa/teximage: make public is_renderable_texture_format
It will be used by the ARB_internalformat_query2 implementation
to check if the 'internalformat' passed is supported by texture
MULTISAMPLE 'targets'.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Tue, 17 Nov 2015 17:02:12 +0000 (18:02 +0100)]
mesa/main: Added empty skeleton of glGetInternalformati64v
Reviewed-by: Dave Airlie <airlied@redhat.com>
Alejandro Piñeiro [Thu, 19 Nov 2015 10:26:05 +0000 (11:26 +0100)]
mesa: Add dispatch and extension XML for GL_ARB_internalformat_query2
Equivalent to commit bda540 (that added GL_ARB_internalformat_query)
v2: include the new xml to to API_XML list at Makefile.am (Emil Velikov)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Thu, 17 Dec 2015 15:08:34 +0000 (16:08 +0100)]
mesa/formatquery: Added boilerplate code to extend GetInternalformativ
The goal is to extend the GetInternalformativ query to implement the
ARB_internalformat_query2 specification, keeping the behaviour defined
by the ARB_internalformat_query if ARB_internalformat_query2 is not
supported.
v2: Don't require ARB_internalformat_query when profile is GLES3.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Wed, 16 Dec 2015 19:46:49 +0000 (20:46 +0100)]
mesa/formatquery: Added a func to check if the <target> is supported
From the ARB_internalformat_query2 spec:
"If the particular <target> and <internalformat> combination do not make
sense, or if a particular type of <target> is not supported by the
implementation the "unsupported" answer should be given. This is not an
error."
This function checks if the <target> is supported by the implementation.
v2: Allow RENDERBUFFER targets also on GLES 3 profiles.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Wed, 16 Dec 2015 19:36:31 +0000 (20:36 +0100)]
mesa/formatquery: Added function to set 'unsupported' responses
The ARB_internalformat_query2 specification defines which is the
reponse best representing "not supported" or "not applicable" for
each <pname>.
Queries for unsupported features, targets, internalformats, combinations
of: target and internalformat, target and pname, pname and internalformat,
do not return an error but the corresponding 'unsupported' response.
We will use that response as the default answer.
For SAMPLES the 'unsupported' response is to not modify the 'params' buffer.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Wed, 16 Dec 2015 19:31:15 +0000 (20:31 +0100)]
mesa/formatquery: Added function to validate parameters
Handles the cases where an error should be returned according
to the ARB_internalformat_query and ARB_internalformat_query2
specifications.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Antia Puentes [Wed, 21 Oct 2015 12:51:09 +0000 (14:51 +0200)]
mesa/main: Add extension tracking bit for ARB_internalformat_query2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Wed, 16 Dec 2015 17:11:36 +0000 (18:11 +0100)]
mesa: Completely remove QuerySamplesForFormat from driver func table
At this point, all uses have been replaced by the more general hook
QueryInternalFormat, introduced by ARB_internalformat_query2.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Wed, 16 Dec 2015 16:49:29 +0000 (17:49 +0100)]
mesa/formatquery: Use new driver hook QueryInternalFormat
Implements SAMPLES and NUM_SAMPLE_COUNTS queries using the new generic
driver call QueryInternalFormat, which is being introduced as replacement
of QuerySamplesForFormat to support ARB_internalformat_query2.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Wed, 16 Dec 2015 16:32:19 +0000 (17:32 +0100)]
mesa/formatquery: Remove tracking of number of elements in the response
Currently, the number of integers returned in the response to
GetInternalFormativ is being tracked by a 'count' variable.
This is so only the modified elements from the temporary buffer are copied into
the original user buffer.
However, with the introduction of ARB_internalformat_query2, keeping track
of 'count' would complicate the code a lot, considering the high number of
queries.
So, we propose to forget about tracking count, and move all the 16 elements
in the temporary buffer, back to the user buffer (clamped to user buffer size
of course). This is basically a trade-off between performance and code clarity.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 24 Nov 2015 21:32:00 +0000 (22:32 +0100)]
mesa/multisample: Check sample count using the new driver hook
Use QueryInternalFormat instead of QuerySamplesForFormat to obtain the
highest supported sample. QuerySamplesForFormat is to be removed.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 24 Nov 2015 21:22:00 +0000 (22:22 +0100)]
st/format: Replace QuerySamplesForFormat by new QueryInternalFormat hook
The previous code for SAMPLES and NUM_SAMPLE_COUNTS is reused as a private function.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 24 Nov 2015 20:43:28 +0000 (21:43 +0100)]
i965/formatquery: Respond queries SAMPLES and NUM_SAMPLE_COUNTS
This effectively disables old QuerySamplesForFormat driver hook, since it is
never called by Mesa anymore.
v2: Call brw_query_samples_for_format() with a dummy buffer to calculate num
samples, to avoid modifying the original buffer.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Sat, 14 Nov 2015 11:21:21 +0000 (12:21 +0100)]
i965: Move brw_query_samples_for_format() to brw_queryformat.c
Now that there is a dedicated source file for internal format queries, this
function belongs there.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 27 Oct 2015 15:16:24 +0000 (16:16 +0100)]
i965: Add boilerplate function for QueryInternalFormat driver hook
By default, we call back the driver's hook fallback function that has generic
implementations for the all the queries.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 27 Oct 2015 14:58:59 +0000 (15:58 +0100)]
mesa: Add a default QueryInternalFormat() function for drivers
This is a fallback function for drivers not implementing
ARB_internalformat_query2.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Eduardo Lima Mitev [Tue, 27 Oct 2015 14:18:45 +0000 (15:18 +0100)]
mesa: Add QueryInternalFormat to device driver virtual table
This new function queries different driver parameters for a particular target
and texture format. It is basically a driver hook to support
ARB_internalformat_query2.
Since ARB_internalformat_query2 introduced several new query parameters
over ARB_internalformat_query, having one driver hook for each parameter
is no longer feasible. So this is the generic entry-point for calls
to glGetInternalFormativ and glGetInternalFormati64v.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Iago Toral Quiroga [Thu, 3 Mar 2016 08:12:16 +0000 (09:12 +0100)]
glsl/opt_array_splitting: Fix indentation
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Iago Toral Quiroga [Thu, 3 Mar 2016 08:02:30 +0000 (09:02 +0100)]
glsl/opt_array_splitting: Fix crash when doing array indexing into other arrays
When we find indirect indexing into an array, the current implementation
of the array spliiting optimization pass does not look further into the
expression tree. However, if the variable expression involves variable
indexing into other arrays, we can miss that these other arrays also have
variable indexing. If that happens, the pass will crash later on after
hitting an assertion put there to ensure that split arrays are in fact
always indexed via constants:
shader_runner: opt_array_splitting.cpp:296:
void ir_array_splitting_visitor::split_deref(ir_dereference**): Assertion `constant' failed.
This patch fixes the problem by letting the pass step into the variable
index expression to identify these cases properly.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89607
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Oded Gabbay [Wed, 2 Mar 2016 19:11:57 +0000 (21:11 +0200)]
radeonsi: Do colorformat endian swap for PIPE_USAGE_STAGING
There is an old if statement (dated to 2011) that prevented doing
endian swap for colorformat, in case the buffer is marked as
PIPE_USAGE_STAGING.
This is now wrong because st_ReadPixels() reads into a destination
texture that is marked with PIPE_USAGE_STAGING. Therefore, even if
the texture is rendered correctly to the monitor, when reading it
back we get unswapped/wrong values.
This patch makes the check_rgba() function in gl-1.0-readpixsanity
piglit test pass in big-endian.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Oded Gabbay [Wed, 2 Mar 2016 19:11:49 +0000 (21:11 +0200)]
r600g: Do colorformat endian swap for PIPE_USAGE_STAGING
There is an old if statement (dated to 2011) that prevented doing
endian swap for colorformat, in case the buffer is marked
as PIPE_USAGE_STAGING.
This is now wrong because st_ReadPixels() reads into a destination
texture that is marked with PIPE_USAGE_STAGING. Therefore, even if
the texture is rendered correctly to the monitor, when reading it
back we get unswapped/wrong values.
This patch makes the check_rgba() function in gl-1.0-readpixsanity
piglit test pass in big-endian.
v2: removed duplicate call to r600_colorformat_endian_swap() inside
evergreen_init_color_surface_rat()
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tim Rowley [Thu, 25 Feb 2016 02:56:38 +0000 (20:56 -0600)]
mesa/build: add OpenSWR to build
Tested on Linux (centos, ubuntu, and suse variants)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tim Rowley [Thu, 25 Feb 2016 00:28:13 +0000 (18:28 -0600)]
gallium/docs - add OpenSWR documentation
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tim Rowley [Wed, 24 Feb 2016 23:45:55 +0000 (17:45 -0600)]
gallium/target-helpers: add OpenSWR driver
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tim Rowley [Fri, 19 Feb 2016 03:30:46 +0000 (21:30 -0600)]
gallium/auxilary: more __cplusplus exports
swr driver which is written in C++ needs access to some more
gallium utility functions than are currently exposed.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tim Rowley [Tue, 16 Feb 2016 23:28:09 +0000 (17:28 -0600)]
gallium/swr: add OpenSWR rasterizer
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Tim Rowley [Tue, 16 Feb 2016 23:27:28 +0000 (17:27 -0600)]
gallium/swr: add OpenSWR driver
OpenSWR is a new software rasterizer for x86 processors designed
for high performance and high scalablility on visualization workloads.
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Timothy Arceri [Wed, 24 Feb 2016 08:45:37 +0000 (19:45 +1100)]
glsl: replace remaining tabs in ir_builder.cpp
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Anuj Phogat [Thu, 11 Feb 2016 18:52:49 +0000 (10:52 -0800)]
mesa: Update comment
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Anuj Phogat [Thu, 11 Feb 2016 20:24:40 +0000 (12:24 -0800)]
mesa: Fix function description
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Anuj Phogat [Wed, 2 Mar 2016 00:46:22 +0000 (16:46 -0800)]
meta: Remove the 'allocate_storage' parameter in _mesa_meta_pbo_GetTexSubImage()
Texture is already allocated before calling this meta function. So,
the value of 'allocate_storage' passed to the function is always false.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Anuj Phogat [Fri, 18 Dec 2015 23:33:35 +0000 (15:33 -0800)]
meta: Fix the pbo usage in meta for GLES{1,2} contexts
OpenGL ES 1.0 doesn't support using GL_STREAM_DRAW and both
ES 1.0 and 2.0 don't support GL_STREAM_READ in glBufferData().
So, handle it correctly by calling the _mesa_meta_begin()
before create_texture_for_pbo().
V2: Remove the changes related to allocate_storage. (Ian)
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Matt Turner [Wed, 2 Mar 2016 19:01:33 +0000 (11:01 -0800)]
program: Clean up after condition code removal.
Matt Turner [Wed, 2 Mar 2016 19:00:31 +0000 (11:00 -0800)]
program: Remove variable used only in assert().
Matt Turner [Wed, 2 Mar 2016 19:00:01 +0000 (11:00 -0800)]
program: Drop GL_FRAGMENT_PROGRAM_NV from switch statement.
Samuel Pitoiset [Wed, 2 Mar 2016 17:11:07 +0000 (18:11 +0100)]
gk110/ir: fix wrong emission of NOT modifier for VOTE
Spotted by Coverity.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reported-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Thomas Hindoe Paaboel Andersen [Tue, 1 Mar 2016 21:45:00 +0000 (14:45 -0700)]
gallium/cso: fix indentation
Only one of these were recently introduced. However, since
we keep copy/pasting the same wrong indentation we should
probably just fix it.
Reviewed-by: Brian Paul <brianp@vmware.com>
Thomas Hindoe Paaboel Andersen [Tue, 1 Mar 2016 21:45:00 +0000 (14:45 -0700)]
st/mesa: move dereference after null check
We should not dereference shader before we have done the
null check.
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Matt Turner [Tue, 1 Mar 2016 23:27:45 +0000 (15:27 -0800)]
i965/gen6/gs: Replace V-immediate with VF-immediate.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Marek Olšák [Tue, 1 Mar 2016 01:01:59 +0000 (02:01 +0100)]
gallium: fix PIPE_BIND_QUERY_BUFFER - PIPE_BIND_SCANOUT overlap
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Samuel Iglesias Gonsálvez [Fri, 26 Feb 2016 07:27:48 +0000 (08:27 +0100)]
i965: set ctx->Const.MaxViewport{Width,Height} to 32k
From ARB_viewport_array spec:
" * On GL3-capable hardware the VIEWPORT_BOUNDS_RANGE should be at least
[-16384, 16383].
* On GL4-capable hardware the VIEWPORT_BOUNDS_RANGE should be at least
[-32768, 32767]."
This range is set using ctx->Const.MaxViewportWidth value, so just bump
those constants to 32k for gen7+ which can support OpenGL 4.0.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Samuel Iglesias Gonsálvez [Tue, 1 Mar 2016 11:04:52 +0000 (12:04 +0100)]
main: remove MAX_VIEWPORT_WIDTH and MAX_VIEWPORT_HEIGHT constants
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Samuel Iglesias Gonsálvez [Tue, 1 Mar 2016 11:02:27 +0000 (12:02 +0100)]
main: call invalidate_framebuffer_storage() with driver's viewport limits
Don't use hardcoded ones because the driver can set different ones.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Rob Clark [Tue, 1 Mar 2016 22:51:36 +0000 (17:51 -0500)]
freedreno/ir3: enable shareable shaders
Now that we are no longer using the pctx reference in the shader, drop
it and turn on shareable shaders.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 1 Mar 2016 22:41:52 +0000 (17:41 -0500)]
freedreno/ir3: pass ctx to constant-emit code
Rather than fishing it out of the shader. This removes the other big
user of shader->pctx.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 1 Mar 2016 22:31:21 +0000 (17:31 -0500)]
freedreno/ir3: add dev ptr to ir3_compiler
And use this for allocating bo's to hold the shader binary, rather than
accessing the dev via ctx ptr. One step towards making shaders sharable
across contexts.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Matt Turner [Sat, 27 Feb 2016 23:30:09 +0000 (15:30 -0800)]
mesa: Remove NV_fragment_program remnants from dlist.c.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 22:24:58 +0000 (14:24 -0800)]
mesa: Remove NV_fragment_program_option enable bit.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 22:05:17 +0000 (14:05 -0800)]
program: Remove NV_fragment_program opcode parsing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Mon, 29 Feb 2016 22:47:43 +0000 (14:47 -0800)]
program: Remove NV_fragment_program scalar suffix parsing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 22:05:42 +0000 (14:05 -0800)]
program: Remove NV_fragment_program_option parsing support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 22:04:30 +0000 (14:04 -0800)]
program: Remove NV_fragment_program Abs support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 21:55:27 +0000 (13:55 -0800)]
program: Remove incorrect comment about OPCODE_TXD.
The table in prog_instruction.h is correct.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 21:53:50 +0000 (13:53 -0800)]
program: Remove OPCODE_TXP_NV.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 21:29:32 +0000 (13:29 -0800)]
program: Clean up after previous commit.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 19:06:25 +0000 (11:06 -0800)]
program: Remove condition-code and precision support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 21:19:50 +0000 (13:19 -0800)]
program: Remove OPCODE_KIL_NV.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 21:44:50 +0000 (13:44 -0800)]
program: Remove RelAddr2 support.
Looks like more never-used crap from the first geometry shader attempt.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 22:15:26 +0000 (14:15 -0800)]
program: Mark table const.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 19:23:32 +0000 (11:23 -0800)]
mesa: Remove EmitCondCodes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sat, 27 Feb 2016 19:19:41 +0000 (11:19 -0800)]
docs: Remove descriptions of long dead Emit* fields.
Dead since commit
d8a366200 in 2010.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Matt Turner [Sun, 28 Feb 2016 00:38:26 +0000 (16:38 -0800)]
glsl: Initialize gl_shader_program::EmptyUniformLocations.
Commit
65dfb30 added exec_list EmptyUniformLocations, but only
initialized the list if ARB_explicit_uniform_location was enabled,
leading to crashes if the extension was not available.
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Ian Romanick [Sat, 14 Nov 2015 01:57:18 +0000 (17:57 -0800)]
i965/meta: Don't pollute the framebuffer namespace
tl;dr: For many types of GL object, we can *NEVER* use the Gen function.
In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions. The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.
Here's the problem scenario:
- Application calls a meta function that generates a name. The first
Gen will probably return 1.
- Application decides to use the same name for an object of the same
type without calling Gen. Many demo programs use names 1, 2, 3,
etc. without calling Gen.
- Application calls the meta function again, and the meta function
replaces the data. The application's data is lost, and the app
fails. Have fun debugging that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Sat, 14 Nov 2015 01:35:30 +0000 (17:35 -0800)]
i965/meta: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Sat, 14 Nov 2015 00:51:27 +0000 (16:51 -0800)]
meta: Don't pollute the framebuffer namespace
tl;dr: For many types of GL object, we can *NEVER* use the Gen function.
In OpenGL ES (all versions!) and OpenGL compatibility profile,
applications don't have to call Gen functions. The GL spec is very
clear about how you can mix-and-match generated names and non-generated
names: you can use any name you want for a particular object type until
you call the Gen function for that object type.
Here's the problem scenario:
- Application calls a meta function that generates a name. The first
Gen will probably return 1.
- Application decides to use the same name for an object of the same
type without calling Gen. Many demo programs use names 1, 2, 3,
etc. without calling Gen.
- Application calls the meta function again, and the meta function
replaces the data. The application's data is lost, and the app
fails. Have fun debugging that.
Fixes piglit tests:
- object-namespace-pollution glGetTexImage-compressed framebuffer
- object-namespace-pollution glGenerateMipmap framebuffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Sat, 14 Nov 2015 01:21:38 +0000 (17:21 -0800)]
meta/decompress: Track framebuffer using gl_framebuffer instead of GL API object handle
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Sat, 14 Nov 2015 01:14:00 +0000 (17:14 -0800)]
meta/generate_mipmap: Track framebuffer using gl_framebuffer instead of GL API object handle
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 19:12:57 +0000 (11:12 -0800)]
meta: Use _mesa_bind_framebuffers instead of _mesa_BindFramebuffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 19:06:51 +0000 (11:06 -0800)]
meta: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers
This enables later patches that will stop calling _mesa_GenFramebuffers
or _mesa_CreateFramebuffers which pollute the framebuffer namespace.
For framebuffers, the Bind call is still necessary.
sed -i -e 's/_mesa_GenFramebuffers/_mesa_CreateFramebuffers/' \
src/mesa/drivers/common/*.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 19:04:25 +0000 (11:04 -0800)]
i965/meta: Use _mesa_CreateFramebuffers instead of _mesa_GenFramebuffers
This enables later patches that will stop calling _mesa_GenFramebuffers
or _mesa_CreateFramebuffers which pollute the framebuffer namespace.
For framebuffers, the Bind call is still necessary.
sed -i -e 's/_mesa_GenFramebuffers/_mesa_CreateFramebuffers/' \
src/mesa/drivers/dri/i965/*.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 18:51:01 +0000 (10:51 -0800)]
meta: Save and restore the framebuffer using gl_framebuffer instead of GL API object handle
Some meta operations can be called recursively. Future changes (the
"Don't pollute the ... namespace" changes) will cause objects with
invalid names to be used. If a nested meta operation tries to restore
an object named 0xDEADBEEF, it will fail.
This also fixes another latent bug in meta. In a multithreaded,
multicontext application, one thread can delete an object that is bound
in another thread. That object continues to exist until it is unbound
(i.e., its refcount drops to zero). Meta unbinds objects all over the
place. As a result, the rebind in _mesa_meta_end could fail because the
object vanished!
See https://bugs.freedesktop.org/show_bug.cgi?id=92363#c8.
Using _mesa_reference_<object type> to save and restore the objects
prevents the refcount from going to zero.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 18:46:40 +0000 (10:46 -0800)]
mesa: Refactor bind_framebuffer to make _mesa_bind_framebuffers
Fixing dd_function_table::BindFramebuffer will come later because that
change is probably not suitable for stable.
v2: Fix whitespace issue noticed by Topi.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 01:18:53 +0000 (17:18 -0800)]
meta: Use _mesa_check_framebuffer_status instead of _mesa_CheckFramebufferStatus
sed -i -e 's/_mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
-e 's/_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER[^)]*/_mesa_check_framebuffer_status(ctx, ctx->DrawBuffer/' \
-e 's/_mesa_CheckFramebufferStatus(GL_READ_FRAMEBUFFER/_mesa_check_framebuffer_status(ctx, ctx->ReadBuffer/' \
$(grep -rl _mesa_CheckFramebufferStatus src/mesa/drivers)
The second expression catches both GL_FRAMEBUFFER and GL_FRAMEBUFFER_EXT.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 01:11:30 +0000 (17:11 -0800)]
meta: Obvious refactor of _mesa_meta_framebuffer_texture_image
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Ian Romanick [Fri, 13 Nov 2015 01:05:27 +0000 (17:05 -0800)]
meta: Convert _mesa_meta_bind_fbo_image to take a gl_framebuffer instead of a GL API handle
Also change the name of the function to
_mesa_meta_framebuffer_texture_image. The function is basically a
wrapper around _mesa_framebuffer_texture (which is used to implement
glFramebufferTexture1D and friends), so it makes sense for it's name to
be similar to that.
The next patch will clean _mesa_meta_framebuffer_texture_image up
considerably.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Dave Airlie [Tue, 1 Mar 2016 05:48:44 +0000 (15:48 +1000)]
virgl: add support for passing render condition flags to host.
This just passes the extra blit info to fix the render condition
tests.
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Kenneth Graunke [Wed, 17 Feb 2016 08:37:04 +0000 (00:37 -0800)]
i965: Push most TES inputs in vec4 mode.
(This is commit
4a1c8a3037cd29938b2a6e2c680c341e9903cfbe for vec4 mode.)
Using the push model for inputs is much more efficient than pulling
inputs - the hardware can simply copy a large chunk into URB registers
at thread creation time, rather than having the thread send messages to
request data from the L3 cache. Unfortunately, it's possible to have
more TES inputs than fit in registers, so we have to fall back to the
pull model in some cases.
However, it turns out that most tessellation evaluation shaders are
fairly simple, and don't use many inputs. An arbitrary cut-off of
24 vec4 slots (12 registers) should suffice. (I chose this instead of
the 32 vec4 slots used in the scalar backend to avoid regressing a few
Piglit tests due to the vec4 register allocator being too stupid to
figure out what to do. We probably ought to fix that, but it's a
separate issue.)
Improves performance in GPUTest's tessmark_x64 microbenchmark by
41.5394% +/- 0.288519% (n = 115) at 1024x768 on my Clevo W740SU
(with Iris Pro 5200).
Improves performance in Synmark's Gl40TerrainFlyTess microbenchmark by
38.3576% +/- 0.759748% (n = 42).
v2: Simplify abs/negate handling, as requested by Matt.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Marek Olšák [Tue, 23 Feb 2016 22:32:44 +0000 (23:32 +0100)]
r600g: remove support for DRM < 2.12.0
Marek Olšák [Tue, 23 Feb 2016 22:32:44 +0000 (23:32 +0100)]
r300g: remove support for DRM < 2.12.0
Marek Olšák [Tue, 23 Feb 2016 22:24:12 +0000 (23:24 +0100)]
winsys/radeon: drop support for DRM 2.12.0 (kernel < 3.2)
in order to make some winsys interface changes easier
This distros should use new DRM if they want to use new Mesa:
Distro kernel mesa eol
SLES 10 2.6.16 6.4.2 2016-07
SLED 11 3.0 9.0.3 2022-03
RHEL 5 2.6.18 6.5.1 2017-03
RHEL 6 2.6.32 10.4.3 2020-11
Debian 6 2.6.32 7.7.1 2016-02
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 25 Feb 2016 16:54:01 +0000 (17:54 +0100)]
radeonsi: also dump shaders on a VM fault
Reviewed-by: Christian König <christian.koenig@amd.com>
Marek Olšák [Thu, 25 Feb 2016 16:12:15 +0000 (17:12 +0100)]
radeonsi: dump full shader disassemblies into ddebug logs
including prolog and epilog disassemblies
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 25 Feb 2016 16:11:20 +0000 (17:11 +0100)]
radeonsi: allow dumping shader disassemblies to a file
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 21 Feb 2016 23:40:04 +0000 (00:40 +0100)]
radeonsi: use re-Z
This can increase perf for shaders that kill pixels (kill, alpha-test,
alpha-to-coverage).
v2: add comments
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 21 Feb 2016 23:23:10 +0000 (00:23 +0100)]
tgsi/scan: count memory instructions
for radeonsi
Reviewed-by: Brian Paul <brianp@vmware.com>
Dave Airlie [Mon, 29 Feb 2016 07:16:10 +0000 (17:16 +1000)]
mesa/fbobject: propogate Layered when reusing attachments.
When reusing a depth attachment as a stencil, we need to propogate
the layered bit, otherwise we fail to complete the framebuffer.
discovered running ./bin/fbo-depth-array depth-layered-clear
on virgl on haswell.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Axel Davy [Sat, 27 Feb 2016 10:02:21 +0000 (11:02 +0100)]
st/nine: Fix second Multithreading issue with MANAGED buffers
Here is another threading issue with MANAGED buffers:
Thread 1: buffer creation
Thread 1: buffer lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock
Without this patch, the buffer is initially dirty
and in the list of things to upload after its creation.
The draw call will then upload the data and unset the dirty flag,
and the Unlock won't trigger a second upload.
Fixes regression introduced by
cc0114f30b587a10766ec212afb3ad356099ef23:
"st/nine: Implement Managed vertex/index buffers"
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Thu, 25 Feb 2016 18:07:37 +0000 (19:07 +0100)]
st/nine: Fix Multithreading issue with MANAGED buffers
d3d calls are protected by mutexes, however if app is doing in
two threads:
Thread 1: buffer Lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock
Then before this patch, the Draw call would begin to upload
the buffer.
Solves this by moving the moment we add the buffer to the queue
of things to upload (We move it from Lock time to Unlock time).
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 24 Feb 2016 22:44:40 +0000 (23:44 +0100)]
st/nine: Handle READONLY for buffer MANAGED pool
READONLY won't trigger an upload.
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sun, 21 Feb 2016 15:35:31 +0000 (16:35 +0100)]
st/nine: Use Position input helper for ps3 declared inputs
When the semantic is Position (which can happen with index 0 only),
use the helper to get Position input.
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sun, 21 Feb 2016 15:30:15 +0000 (16:30 +0100)]
st/nine: Introduce helper for Position shader input
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>