Commit Graph

76715 Commits

Author SHA1 Message Date
Eduardo Lima Mitev
a347a0f53f 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
993d7345b7 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
25ee5c60dc 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
1f0b2ce8ec 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
ee31b0b1d0 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
82be7735f3 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
2dabff9068 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
28144c4476 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
45054f9702 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>
2016-03-03 15:14:05 +01:00
Eduardo Lima Mitev
93d30c3de9 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>
2016-03-03 15:14:05 +01:00
Iago Toral Quiroga
283c8372cb glsl/opt_array_splitting: Fix indentation
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-03-03 09:12:41 +01:00
Iago Toral Quiroga
4a60002424 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>
2016-03-03 09:02:30 +01:00
Oded Gabbay
914d4967d7 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>
2016-03-03 09:20:08 +02:00
Oded Gabbay
ef5183faea 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>
2016-03-03 09:20:08 +02:00
Tim Rowley
7bb193d28c 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>
2016-03-02 18:38:42 -06:00
Tim Rowley
d003be2a30 gallium/docs - add OpenSWR documentation
Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-03-02 18:38:41 -06:00
Tim Rowley
da4f95d168 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>
2016-03-02 18:38:41 -06:00
Tim Rowley
ea37602273 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>
2016-03-02 18:38:41 -06:00
Tim Rowley
c6e67f5a93 gallium/swr: add OpenSWR rasterizer
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
2016-03-02 18:38:41 -06:00
Tim Rowley
2b2d3680bf 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>
2016-03-02 18:38:41 -06:00
Timothy Arceri
2eec41f6f1 glsl: replace remaining tabs in ir_builder.cpp
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
2016-03-03 11:25:57 +11:00
Anuj Phogat
7026f27e33 mesa: Update comment
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-02 15:06:46 -08:00
Anuj Phogat
6ccead5b48 mesa: Fix function description
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-03-02 15:06:46 -08:00
Anuj Phogat
de61849994 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>
2016-03-02 15:06:46 -08:00
Anuj Phogat
6d4ebbe9e5 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>
2016-03-02 15:06:45 -08:00
Matt Turner
0d047d10f1 program: Clean up after condition code removal. 2016-03-02 12:15:58 -08:00
Matt Turner
961ead6746 program: Remove variable used only in assert(). 2016-03-02 12:15:58 -08:00
Matt Turner
de2ef0401b program: Drop GL_FRAGMENT_PROGRAM_NV from switch statement. 2016-03-02 12:15:58 -08:00
Samuel Pitoiset
b94a46aa8e 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>
2016-03-02 20:36:18 +01:00
Thomas Hindoe Paaboel Andersen
535002f4da 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>
2016-03-02 08:55:20 -07:00
Thomas Hindoe Paaboel Andersen
37cfc51b13 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>
2016-03-02 08:55:20 -07:00
Matt Turner
ad17511302 i965/gen6/gs: Replace V-immediate with VF-immediate.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-03-02 07:28:52 -08:00
Marek Olšák
43f74ac67c 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>
2016-03-02 15:32:52 +01:00
Samuel Iglesias Gonsálvez
e8fd60e789 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>
2016-03-02 07:19:01 +01:00
Samuel Iglesias Gonsálvez
add57b3fa8 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>
2016-03-02 07:19:01 +01:00
Samuel Iglesias Gonsálvez
aa849d97a0 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>
2016-03-02 07:19:01 +01:00
Rob Clark
c4ae047cab 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>
2016-03-01 19:21:45 -05:00
Rob Clark
c3f2f8cbe4 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>
2016-03-01 19:20:44 -05:00
Rob Clark
5fd152bae8 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>
2016-03-01 19:20:33 -05:00
Matt Turner
1be953797e 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>
2016-03-01 11:41:30 -08:00
Matt Turner
89abb22a85 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>
2016-03-01 11:41:30 -08:00
Matt Turner
ed72a1c118 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>
2016-03-01 11:41:29 -08:00
Matt Turner
5429554f09 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>
2016-03-01 11:41:29 -08:00
Matt Turner
409c24f9cc 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>
2016-03-01 11:41:29 -08:00
Matt Turner
fe2d2c7ad8 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>
2016-03-01 11:41:29 -08:00
Matt Turner
0d1f6c752f 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>
2016-03-01 11:41:29 -08:00
Matt Turner
624d06708d 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>
2016-03-01 11:41:29 -08:00
Matt Turner
aaef6cf4e3 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>
2016-03-01 11:41:29 -08:00
Matt Turner
7b50b0457d 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>
2016-03-01 11:41:29 -08:00
Matt Turner
9e11ff7e11 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>
2016-03-01 11:41:29 -08:00