Commit Graph

85285 Commits

Author SHA1 Message Date
Ilia Mirkin 67fbaa5873 st/mesa: enable GL_ANDROID_extension_pack_es31a when available
For now that's never since advanced blend hasn't been piped through.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2016-09-27 00:20:41 -04:00
Timothy Arceri 63e8221574 glsl: move some uniform linking code to new link_assign_uniform_storage()
This makes link_assign_uniform_locations() easier to follow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-27 11:29:05 +10:00
Timothy Arceri ab67b6afdf glsl: move some uniform linking code to new link_setup_uniform_remap_tables()
This makes link_assign_uniform_locations() easier to follow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-27 11:29:05 +10:00
Timothy Arceri 856e0bd707 i965: create populate key functions for tcs and tes
These will be used by the on disk shader cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-27 11:11:15 +10:00
Timothy Arceri ec75570415 i965: make gs key generation helper available to shader cache
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-27 11:11:15 +10:00
Timothy Arceri 481d8ec291 glsl: use reproducible name for lowered const arrays
Otherwise we can end up with mismatching names between the cached
binary and the cached metadata.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-27 11:11:15 +10:00
Carl Worth 017081a3e5 i965: make vs and fs key generation helpers available to shader cache
Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
2016-09-27 11:11:15 +10:00
Carl Worth f61669f997 glsl: Prepare standalone compiler to be able to use parameter lists
As part of the shader-cache work an upcoming change will add new
references to _mesa_add_parameter and _mesa_new_parameter_list from
the glsl code. To prepare for that, and to allow the standalone
glsl_compiler to still link, here we add mesa/program/prog_parameter.c
to the libglsl_util sources.

Then, in order to get *that* to work, we also add to stubs to
standalone_scaffolding:

	_mesa_program_state_flags
	_mesa_program_state_string

These functions aren't actually used by the two functions in
prog_parameter.c that we are actually calling. They are used in other
functions in the same file. So we don't care what the implementation
of these stubs is, (they won't be called by glsl_compiler). We just
need the stubs present so that it can link.

Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-27 11:11:15 +10:00
Samuel Pitoiset f24b517858 nv50/ir: fix comments about instructions info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-26 21:59:37 +02:00
Rob Clark ecd6fce261 mesa/st: support lowering multi-planar YUV
Support multi-planar YUV for external EGLImage's (currently just in the
dma-buf import path) by lowering to multiple texture fetch's for each
plane and CSC in shader.

There was some discussion of alternative approaches for tracking the
additional UV or U/V planes:

  https://lists.freedesktop.org/archives/mesa-dev/2016-September/127832.html

They all seemed worse than pipe_resource::next

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-26 15:29:17 -04:00
Rob Clark e0ec1c3134 mesa/st: add nir pass to lower tex_src_plane
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-26 15:29:17 -04:00
Rob Clark c2a60cacd4 mesa/st: add lowering pass for YUV samplers
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-26 15:29:17 -04:00
Sirisha Gandikota 8e3e9d74b5 aubinator: Fix the decoding of values that span two Dwords
Fixed the way the values that span two Dwords are decoded.
Based on the start and end indices of the field, the Dwords
are fetched and decoded accordingly.

v2: rename dw to qw in gen_field_iterator_next
and remove extra white space (Anuj)

v3: change all instances of dw to qw (Anuj)

Earlier, 64-bit fields (such as most pointers on Gen8+)
weren't decoded correctly.  gen_field_iterator_next seemed
to walk one DWord at a time, sets v.dw, and then passes it
to field(). So, even though field() takes a uint64_t, we're
passing it a uint32_t (which gets promoted, so the top 32
bits will always be zero). This seems pretty bogus... (Ken)

Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-26 11:18:52 -07:00
Samuel Pitoiset ac859d68f4 nvc0: allow to force compiling programs in debug build
This adds a new envvar called NV50_PROG_CHIPSET which allows to
compile shaders with a different target, especially useful for
shader-db.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-26 19:39:04 +02:00
Samuel Pitoiset e05042b367 nv50/ir: drop unused NVISA_XXX_CHIPSET constants
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-26 19:39:04 +02:00
Samuel Pitoiset be0535b8c7 gallium/util: make use of strtol() in debug_get_num_option()
This allows to use hexadecimal numbers which are automatically
detected by strtol() when the base is 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Brian Paul <brianp@vmware.com>
2016-09-26 19:39:04 +02:00
Glenn Kennard 5da24242b3 r600g: Add support for PK2H/UP2H
Based off of Ilia's original patch, but with output values replicated so
that it matches the TGSI semantics.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2016-09-26 17:08:49 +02:00
Timothy Arceri eb2dc04127 i965: stop passing stage as a function parameter
We already pass the shader so we can just get the stage from this.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2016-09-26 09:59:24 +10:00
Nayan Deshmukh b3827819aa aubinator: fix resource leak
CovID: 1373370

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-25 12:32:48 -07:00
Emilio Cobos Álvarez cb7c2c9d65 osmesa: Unbind the current context when given a null context and buffer.
This is needed to be consistent with other drivers.

Signed-off-by: Emilio Cobos Álvarez <me@emiliocobos.me>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-23 19:55:50 -06:00
Brian Paul 07d1f8faf9 st/mesa: small optimization in swizzle_swizzle()
Usually, there's no user-specified texture swizzle so we can optimize
the swizzle_swizzle() function and skip the loop/switch.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul 1cdc232e1a st/mesa: fix swizzle issue in st_create_sampler_view_from_stobj()
Some demos, like Heaven, were creating and destroying a large number
of sampler views because of a swizzle issue.

Basically, we compute the sampler view's swizzle by examining the
texture format, user swizzle, depth mode, etc.  Later, during validation
we recompute that swizzle (in case something like depth mode changes)
and see if it matches the view's swizzle.

In the case of PIPE_FORMAT_RGTC2_UNORM, get_texture_format_swizzle
returned SWIZZLE_XYZW but the u_sampler_view_default_template() function
was setting the sampler view's swizzle to SWIZZLE_XY01.  This mismatch
caused the validation step to always "fail" so we'd destroy the old
sampler view and create a new one.

By removing the conditional, the sampler view's swizzle and the computed
texture swizzle match and validation "passes".  When creating a new sampler
view, we always want to use the texture swizzle which we just computed.

Fixes VMware issue 1733389.

Cc: mesa-stable@lists.freedesktop.org

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul c0d7b6073d svga: set PIPE_BIND_DEPTH_STENCIL flag for new resources when possible
When we create a depth/stencil texture, also check if we can render to
it and set the PIPE_BIND_DEPTH_STENCIL flag.  We were previously doing
this for color textures (PIPE_BIND_RENDER_TARGET).

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul f942a70340 svga: don't special case caps for SVGA3D_R32_FLOAT
This may have been needed years ago during development, but not now.
Prevents some regressions after introducing the next patch.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul 14639cdf8f svga: use new adjust_z_layer() helper in svga_pipe_blit.c
To handle z/layer fix-ups for blitting and copying.  Note that we weren't
doing this properly in svga_blit() before.

Also, remove redundant stex, dtex assignments.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul c42000545d svga: simplify/improve the format compatibility check for region copies
The util_is_format_compatible() function didn't quite do what we wanted
for vgpu10.  This check is more flexible and allows copies between
formats such as R32G32B32A32_FLOAT and R32G32B32A32_INT.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul 2ad4ba0727 svga: add const qualifier on svga_translate_format()
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Brian Paul 4d04696524 svga: eliminate unneeded gotos in svga_validate_surface_view()
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:54:42 -06:00
Neha Bhende 47f16f5e7f svga: disable srgb format related code from svga_blit()
With latest mesa and latest piglit tests srgb<->linear conversion
is not required as per GL4.4 rules

See commit b662c70aea.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-23 19:53:51 -06:00
Timothy Arceri 29c174a3e5 Revert "glsl: move xfb BufferStride into gl_transform_feedback_info"
This reverts commit f5a6aab403.

This broke some tests. It seems gl_transform_feedback_info gets memset
to 0 so we were losing the values in BufferStride before we used them.
2016-09-24 10:17:26 +10:00
Kenneth Graunke 943b69cddd glsl: Delete linker stuff relating to built-in functions.
Now that we generate built-in functions inline, there's no need to link
against the built-in shader, and no built-in prototypes to consider.

This lets us delete a bunch of code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by; Ian Romanick <ian.d.romanick@intel.com>
2016-09-23 16:40:40 -07:00
Kenneth Graunke f7a5c714b3 glsl: Delete ftransform support from builtin_functions.cpp.
This is now handled directly by ast_function.cpp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by; Ian Romanick <ian.d.romanick@intel.com>
2016-09-23 16:40:40 -07:00
Kenneth Graunke b04ef3c08a glsl: Immediately inline built-ins rather than generating calls.
In the past, we imported the prototypes of built-in functions, generated
calls to those, and waited until link time to resolve the calls and
import the actual code for the built-in functions.

This severely limited our compile-time optimization opportunities: even
trivial functions like dot() were represented as function calls.  We
also had no way of reasoning about those calls; they could have been
1,000 line functions with side-effects for all we knew.

Practically all built-in functions are trivial translations to
ir_expression opcodes, so it makes sense to just generate those inline.
Since we eventually inline all functions anyway, we may as well just do
it for all built-in functions.

There's only one snag: built-in functions that refer to built-in global
variables need those remapped to the variables in the shader being
compiled, rather than the ones in the built-in shader.  Currently,
ftransform() is the only function matching those criteria, so it seemed
easier to just make it a special case.

On Skylake:

total instructions in shared programs: 12023491 -> 12024010 (0.00%)
instructions in affected programs: 77595 -> 78114 (0.67%)
helped: 97
HURT: 309

total cycles in shared programs: 137239044 -> 137295498 (0.04%)
cycles in affected programs: 16714026 -> 16770480 (0.34%)
helped: 4663
HURT: 4923

while these statistics are in the wrong direction, the number of
hurt programs is small (309 / 41282 = 0.75%), and I don't think
anything can be done about it.  A change like this significantly
alters the order in which optimizations are performed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by; Ian Romanick <ian.d.romanick@intel.com>
2016-09-23 16:40:40 -07:00
Kenneth Graunke 1617f59bc6 glsl: Check TCS barrier restrictions at ast_to_hir time, not link time.
We want to check prior to optimization - otherwise we might fail to
detect cases where barrier() is in control flow which is always taken
(and therefore gets optimized away).

We don't currently loop unroll if there are function calls inside;
otherwise we might have a problem detecting barrier() in loops that
get unrolled as well.

Tapani's switch handling code adds a loop around switch statements, so
even with the mess of if ladders, we'll properly reject it.

Enforcing these rules at compile time makes more sense more sense than
link time.  Doing it at ast-to-hir time (rather than as an IR pass)
allows us to emit an error message with proper line numbers.
(Otherwise, I would have preferred the IR pass...)

Fixes spec/arb_tessellation_shader/compiler/barrier-switch-always.tesc.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by; Ian Romanick <ian.d.romanick@intel.com>
2016-09-23 16:40:40 -07:00
Timothy Arceri f5a6aab403 glsl: move xfb BufferStride into gl_transform_feedback_info
It makes more sense to have this here where we store the other values
from xfb qualifiers. The struct it was previously part of is now only
used to store values that come from the api.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-09-24 09:18:29 +10:00
Dylan Baker 85e9bbc14d Revert "mapi: export all GLES 3.2 functions in libGLESv2.so"
This reverts commit e66a2b879b.

Which breaks the scons build in an interesting way, particularly when
BlendBarrier and PrimitiveBoundingBox are added to static_data.py's
functions list. This seems to be related to the fact that the unsuffixed
names are only in GLES3.2, but Desktop GL only has suffixed versions.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-09-23 12:13:13 -07:00
Adam Jackson 8ce2afe776 i965: Enable EGL_KHR_gl_texture_3D_image
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-23 06:53:21 -04:00
Adam Jackson 5981366b9f i915: Enable EGL_KHR_gl_texture_3D_image
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-09-23 06:53:17 -04:00
Nicolas Koch f17948a30a anv: Check for VK_WHOLE_SIZE in anv_CmdFillBuffer
From the Vulkan spec:

   Size is the number of bytes to fill, and must be either a multiple of 4,
   or VK_WHOLE_SIZE to fill the range from offset to the end of the buffer.
   If VK_WHOLE_SIZE is used and the remaining size of the buffer is not a
   multiple of 4, then the nearest smaller multiple is used.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-09-23 00:20:16 -07:00
Lionel Landwerlin 6b21728c4a anv: get rid of duplicated values from gen_device_info
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-23 10:12:06 +03:00
Lionel Landwerlin 94d0e7dc08 i965: get rid of duplicated values from gen_device_info
Now that we have gen_device_info mutable, we can update its values and drop
all copies we had in brw_context.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-23 10:12:06 +03:00
Lionel Landwerlin bc24590f0c intel/i965: make gen_device_info mutable
Make gen_device_info a mutable structure so we can update the fields that
can be refined by querying the kernel (like subslices and EU numbers).

This patch does not make any functional change, it just makes
gen_get_device_info() fill a structure rather than returning a const
pointer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-23 10:11:59 +03:00
Timothy Arceri e60928f4c4 gallium: remove unused PIPE_CC_GCC_VERSION
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-09-23 16:18:21 +10:00
Timothy Arceri 4eb0e90c6b util: remove Sun C Compiler support
Support for this compiler was dropped in 51564f04b7

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-09-23 16:17:16 +10:00
Ilia Mirkin c0a7e931e3 st/mesa: turn on OES_viewport_array when dependencies are met
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-22 20:42:30 -04:00
Ilia Mirkin 0f01aa8033 mesa: add implementations for new float depth functions
This just up-converts them to doubles. Not great, but this is what all
the other variants also do.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-09-22 20:42:30 -04:00
Ilia Mirkin 381b15dc20 mesa: move ARB_viewport_array params to a GLES 3.1-accessible section
This is needed for GL_OES_viewport_array.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-09-22 20:42:30 -04:00
Ilia Mirkin 5644a90801 mesa: add GL_OES_viewport_array to the extension string
The expectation is that drivers will set this based on
OES_geometry_shader and ARB_viewport_array support. This is a separate
enable on the same reasoning as for OES_texture_cube_map_array.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-09-22 20:42:30 -04:00
Ilia Mirkin 70aef97f9e glsl: add OES_viewport_array enables and use them to expose gl_ViewportIndex
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-09-22 20:42:30 -04:00
Ilia Mirkin 411a72d4a2 mesa: add new entrypoints for GL_OES_viewport_array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-09-22 20:42:30 -04:00