mesa.git
9 years agofreedreno/ir3: drop unused create_input() arg
Rob Clark [Fri, 24 Jul 2015 20:42:10 +0000 (16:42 -0400)]
freedreno/ir3: drop unused create_input() arg

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: move emit_const to ir3
Rob Clark [Fri, 24 Jul 2015 17:07:33 +0000 (13:07 -0400)]
freedreno/ir3: move emit_const to ir3

Details of the cmdstream packets are different between a3xx and a4xx,
but the logic about the layout of const registers is the same, as that
is dictated by the ir3 shader compiler.  So rather than duplicating
logic that is tightly coupled to ir3 between a3xx and a4xx, move this
into ir3 and use per-generation callbacks for to build the cmdstream
packets.

This should make it easier to pass additional const regs (such as for
transform feedback).  And it also keeps the layout internal to ir3 in
case we want to make the layout more dynamic some day.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: bit of shader API refactoring
Rob Clark [Thu, 23 Jul 2015 19:51:13 +0000 (15:51 -0400)]
freedreno/ir3: bit of shader API refactoring

Since for transform-feedback, we'll need more than just the TGSI
tokens from the state object, just pass the entire state object to
ir3_shader_create().  This also cleans things up a bit for some
day in the future when we could take shader either as TGSI or
directly NIR (for ex, glsl2nir or spirv2nir paths).  In the same
spirit, drop extra args from ir3_compile_shader_nir() (since it
can anyways get what it needs from the ir3_shader_variant).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: updated cat6 encoding
Rob Clark [Thu, 23 Jul 2015 19:31:13 +0000 (15:31 -0400)]
freedreno/ir3: updated cat6 encoding

Sync updated cat6 encoding from freedreno.git, needed to properly encode
store instructions.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agoglsl: enable conservative depth, ssbo based on GLSL version
Ilia Mirkin [Sat, 25 Jul 2015 05:06:20 +0000 (01:06 -0400)]
glsl: enable conservative depth, ssbo based on GLSL version

Add in missed version checks in the GLSL parser

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
9 years agodocs: add news item and link release notes for mesa 10.6.3
Emil Velikov [Sun, 26 Jul 2015 14:20:31 +0000 (15:20 +0100)]
docs: add news item and link release notes for mesa 10.6.3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add checksums for mesa 10.6.3 tarballs
Emil Velikov [Sun, 26 Jul 2015 14:18:24 +0000 (15:18 +0100)]
docs: Add checksums for mesa 10.6.3 tarballs

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ccef8901de421eae5dcc8affa14218d46cc06593)

9 years agoAdd release notes for 10.6.3
Emil Velikov [Sun, 26 Jul 2015 13:38:58 +0000 (14:38 +0100)]
Add release notes for 10.6.3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ddc976368fef367e464472ebcc2ac4fd89eb9fd8)

9 years agoradeonsi: add fine derivate control (v2.1)
Dave Airlie [Fri, 17 Jul 2015 04:35:30 +0000 (05:35 +0100)]
radeonsi: add fine derivate control (v2.1)

This adds support for fine derivatives and enables
ARB_derivative_control on radeonsi.

(just fell out of my working out interpolation)

v2: cleanup some bits, write a comment
v2.1: take Michel's comment from the mailing list

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: fix GLSL textureGrad(samplerCube*) functions
Marek Olšák [Thu, 23 Jul 2015 22:54:08 +0000 (00:54 +0200)]
radeonsi: fix GLSL textureGrad(samplerCube*) functions

+4 piglits

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agost/mesa: don't ignore texture buffer state changes
Marek Olšák [Fri, 24 Jul 2015 17:47:06 +0000 (19:47 +0200)]
st/mesa: don't ignore texture buffer state changes

Fixes piglit:
  spec@arb_texture_buffer_range@ranges-2

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agonvc0: fix geometry program revalidation of clipping params
Ilia Mirkin [Sat, 11 Jul 2015 16:47:03 +0000 (12:47 -0400)]
nvc0: fix geometry program revalidation of clipping params

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agoradeonsi: ubo indexing support (v2)
Dave Airlie [Mon, 13 Jul 2015 08:12:18 +0000 (09:12 +0100)]
radeonsi: ubo indexing support (v2)

This is required as part of ARB_gpu_shader5.

no backend changes are required for this, or if
any are, it's the same ones as for samplers.

v2: use get_indirect_index (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: add support for indirect samplers (v2)
Dave Airlie [Sun, 12 Jul 2015 23:07:09 +0000 (00:07 +0100)]
radeonsi: add support for indirect samplers (v2)

This adds the frontend support, however the llvm
backend produces the wrong pattern, however
we can conditionalise enabling ARB_gpu_shader5
on whatever version of llvm we fix this in.

v2: drop unneeded sampler_indirect checks (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: split out interpolation input selection
Dave Airlie [Fri, 17 Jul 2015 03:43:09 +0000 (04:43 +0100)]
radeonsi: split out interpolation input selection

This is prep work for using it in the interpolation code
later.

Also add storage for the input interpolation mode so we
can pick it up later.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: separate out load sample position
Dave Airlie [Thu, 16 Jul 2015 03:38:41 +0000 (04:38 +0100)]
radeonsi: separate out load sample position

This is prep work for reusing this in the interpolation
code later.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: recognize ARB_shading_language_420pack to be enabled with 4.20+
Ilia Mirkin [Fri, 24 Jul 2015 21:06:22 +0000 (17:06 -0400)]
glsl: recognize ARB_shading_language_420pack to be enabled with 4.20+

The 420pack extension enables various GLSL rules that need to be applied
to any GLSL 4.20+ shader even if the extension is not explicitly
enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agomesa: fix error checking for getting zero-sized texture images
Ilia Mirkin [Fri, 24 Jul 2015 00:18:57 +0000 (20:18 -0400)]
mesa: fix error checking for getting zero-sized texture images

Commit 17f714836 (mesa: rearrange texture error checking order) moved
the width/height/depth == 0 allowance before checking if the image was
there. This was in part due to depth having to be == 1 for 2D images and
width having to be == 1 for 1D images. Instead relax the height/depth
checks to also accept 0 as valid.

With this change,

  bin/arb_direct_state_access-get-textures

starts passing again.

Fixes: 17f714836 (mesa: rearrange texture error checking order)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Fix typo in a comment
Anuj Phogat [Fri, 26 Jun 2015 22:39:40 +0000 (15:39 -0700)]
mesa: Fix typo in a comment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agometa: Use _mesa_need_rgb_to_luminance_conversion() in decompress_texture_image()
Anuj Phogat [Fri, 12 Jun 2015 21:58:46 +0000 (14:58 -0700)]
meta: Use _mesa_need_rgb_to_luminance_conversion() in decompress_texture_image()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Change the signature of _mesa_need_rgb_to_luminance_conversion()
Anuj Phogat [Fri, 12 Jun 2015 21:42:57 +0000 (14:42 -0700)]
mesa: Change the signature of _mesa_need_rgb_to_luminance_conversion()

This allows us to handle cases when texImage->_BaseFormat doesn't match
_mesa_format_get_base_format(texImage->Format). _BaseFormat is what we
care about in this function.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agometa: Fix reading luminance texture as rgba in _mesa_meta_pbo_GetTexSubImage()
Anuj Phogat [Tue, 12 May 2015 12:46:04 +0000 (05:46 -0700)]
meta: Fix reading luminance texture as rgba in _mesa_meta_pbo_GetTexSubImage()

After recent addition of pbo testing in piglit test getteximage-luminance,
it fails on i965. This patch makes a sub test pass.

This patch adds a clear color operation to meta pbo path, which I think is
better than falling back to software path.

V2: Fix color mask for GL_LUMINANCE_ALPHA

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agometa: Use _mesa_need_luminance_to_rgb_conversion() in decompress_texture_image()
Anuj Phogat [Fri, 12 Jun 2015 00:23:34 +0000 (17:23 -0700)]
meta: Use _mesa_need_luminance_to_rgb_conversion() in decompress_texture_image()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Add a helper function _mesa_need_luminance_to_rgb_conversion()
Anuj Phogat [Thu, 11 Jun 2015 23:48:26 +0000 (16:48 -0700)]
mesa: Add a helper function _mesa_need_luminance_to_rgb_conversion()

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agometa: Use _mesa_unpack_format_to_base_format() to handle integer formats
Anuj Phogat [Fri, 12 Jun 2015 19:11:01 +0000 (12:11 -0700)]
meta: Use _mesa_unpack_format_to_base_format() to handle integer formats

Replace a call to mesa_base_tex_format() that handles only internal
formats with a call to the new _mesa_unpack_format_to_base_format()
function that handles allowed unpack formats and does not care for
internal formats at all.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Add a helper function _mesa_unpack_format_to_base_format()
Anuj Phogat [Fri, 12 Jun 2015 19:09:05 +0000 (12:09 -0700)]
mesa: Add a helper function _mesa_unpack_format_to_base_format()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Set green, blue channels to zero only for formats with these components
Anuj Phogat [Thu, 11 Jun 2015 23:44:45 +0000 (16:44 -0700)]
mesa: Set green, blue channels to zero only for formats with these components

This is an optimization which avoids setting pixel transfer operations
when not required. _mesa_ReadPixels falls back to slower path if
transfer operations are set.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agometa: Don't do fragment color clamping in _mesa_meta_pbo_GetTexSubImage
Anuj Phogat [Wed, 6 May 2015 12:43:08 +0000 (05:43 -0700)]
meta: Don't do fragment color clamping in _mesa_meta_pbo_GetTexSubImage

_mesa_meta_pbo_GetTexSubImage() uses _mesa_meta_BlitFrameBuffer(),
which will do fragment clamping if enabled. But fragment clamping
doesn't affect ReadPixels and GetTexImage.

Without this patch, piglit test arb_color_buffer_float-clear fails,
when forced to use the meta pbo path.

v2: Apply this fix to both glReadPixels and glGetTexImage.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agometa: Abort meta pbo path if readpixels need signed-unsigned conversion
Anuj Phogat [Wed, 20 May 2015 17:22:45 +0000 (10:22 -0700)]
meta: Abort meta pbo path if readpixels need signed-unsigned conversion

Meta pbo path for ReadPixels rely on BlitFramebuffer which doesn't support
signed to unsigned integer conversions and vice versa.

Without this patch, piglit test fbo_integer_readpixels_sint_uint fails, when
forced to use the meta pbo path.

v2: Make need_signed_unsigned_int_conversion() a static function. (Iago)
    Bump up the comment and the commit message. (Jason)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Iago Toral <itoral@igalia.com>
9 years agometa: Fix transfer operations check in meta pbo path for readpixels
Anuj Phogat [Wed, 20 May 2015 17:21:39 +0000 (10:21 -0700)]
meta: Fix transfer operations check in meta pbo path for readpixels

Currently used ctx->_ImageTransferState check is not sufficient
because it doesn't include the read color clamping enabled with
GL_CLAMP_READ_COLOR. So, use the helper function
_mesa_get_readpixels_transfer_ops().

Also, transfer operations don't affect glGetTexImage(). So, do
the check only for glReadPixles.

Without this patch, arb_color_buffer_float-readpixels test fails, when
forced to use meta pbo path.

V2: Add a comment and bump up the commit message.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Turn get_readpixels_transfer_ops() in to a global function
Anuj Phogat [Wed, 20 May 2015 00:44:52 +0000 (17:44 -0700)]
mesa: Turn get_readpixels_transfer_ops() in to a global function

This utility function is utilized in a later patch.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoi965: Use updated kernel interface for accurate TIMESTAMP reads
Chris Wilson [Tue, 21 Jul 2015 10:12:57 +0000 (11:12 +0100)]
i965: Use updated kernel interface for accurate TIMESTAMP reads

I was mistaken, I thought we already had fixed this in the kernel a
couple of years ago. We had not, and the broken read (the hardware
shifts the register output on 64bit kernels, but not on 32bit kernels) is
now enshrined into the ABI. I also had the buggy architecture reversed,
believing it to be 32bit that had the shifted results. On the basis of
those mistakes, I wrote

commit c8d3ebaffc0d7d915c1c19d54dba61fd1e57b338
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Apr 29 13:32:38 2015 +0100

    i965: Query whether we have kernel support for the TIMESTAMP register once

Now that we do have an extended register read interface for always
reporting the full 36bit TIMESTAMP (irrespective of whether the hardware
is buggy or not), make use of it and in the process fix my reversed
detection of the buggy reads for unpatched kernels.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Martin Peres <martin.peres@linux.intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Tested-and-acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
9 years agoglsl/glcpp: fix SIGSEGV when checking error condition for macro redefinition
Samuel Iglesias Gonsalvez [Thu, 23 Jul 2015 08:38:36 +0000 (10:38 +0200)]
glsl/glcpp: fix SIGSEGV when checking error condition for macro redefinition

Commit a6e9cd14c does not take into account than node_{a,b}->next could be NULL
in some circumstances, such as in a shader containing this code:

  #define A 1 /* comment */
  #define A 1 /* comment */

This patch fixes the segmentation fault for cases like that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91290
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
9 years agonvc0/ir: per-patch vars are in a separate address space
Ilia Mirkin [Fri, 24 Jul 2015 04:21:28 +0000 (00:21 -0400)]
nvc0/ir: per-patch vars are in a separate address space

There's no need to attempt to avoid overlapping generic i/o with patch
i/o. By the same token, we can't merge patch and non-patch loads/stores.

This fixes at least the

  tes-both-input-array-*-index-rd

tessellation variable-indexing tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: kepler can't do indirect shader input/output loads directly
Ilia Mirkin [Fri, 24 Jul 2015 03:03:53 +0000 (23:03 -0400)]
nvc0/ir: kepler can't do indirect shader input/output loads directly

There's a special AL2P instruction (called AFETCH in nv50 ir) which
computes a "physical" value to be used with indirect addressing with ALD.

Fixes

  tcs-input-array-*-index-rd
  tcs-output-array-*-index-wr

varying-indexing tessellation tests on Kepler.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoradeon: Silence GCC unused-but-set-variable warnings.
Vinson Lee [Wed, 22 Jul 2015 04:50:29 +0000 (21:50 -0700)]
radeon: Silence GCC unused-but-set-variable warnings.

radeon_fbo.c: In function 'radeon_map_renderbuffer_s8z24':
radeon_fbo.c:162:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     int ret;
         ^
radeon_fbo.c: In function 'radeon_map_renderbuffer_z16':
radeon_fbo.c:200:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     int ret;
         ^
radeon_fbo.c: In function 'radeon_map_renderbuffer':
radeon_fbo.c:242:8: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
    int ret;
        ^
radeon_fbo.c: In function 'radeon_unmap_renderbuffer':
radeon_fbo.c:419:14: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
    GLboolean ok;
              ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agodoxygen: Link GLvector4f struct members properly, avoiding invalid XML/HTML warning
Rhys Kidd [Thu, 23 Jul 2015 04:14:00 +0000 (22:14 -0600)]
doxygen: Link GLvector4f struct members properly, avoiding invalid XML/HTML warning

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agodoxygen: Correct grammatical typo in math/m_vector.h
Rhys Kidd [Thu, 23 Jul 2015 04:14:00 +0000 (22:14 -0600)]
doxygen: Correct grammatical typo in math/m_vector.h

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: minor clean-ups in shaderapi.c
Brian Paul [Thu, 23 Jul 2015 16:04:13 +0000 (10:04 -0600)]
mesa: minor clean-ups in shaderapi.c

80-column wrapping.  Move break statements.  Indentation fixes.

9 years agomesa: fix _mesa_error() compiler warnings in shaderapi.c
Brian Paul [Thu, 23 Jul 2015 13:47:25 +0000 (07:47 -0600)]
mesa: fix _mesa_error() compiler warnings in shaderapi.c

Fix many instances of:
main/shaderapi.c: In function '_mesa_GetSubroutineUniformLocation':
main/shaderapi.c:2176:7: warning: format not a string literal and no format arguments [-Wformat-security]
       _mesa_error(ctx, GL_INVALID_OPERATION, api_name);
       ^

Ideally, many of these error messages should be improved to indicate
which argument is incorrect as we do in other parts of Mesa.

Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
9 years agost/mesa: remove unused 'samp' function parameters
Brian Paul [Thu, 23 Jul 2015 13:43:11 +0000 (07:43 -0600)]
st/mesa: remove unused 'samp' function parameters

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agost/mesa: add comments on a few sampler view functions
Brian Paul [Thu, 23 Jul 2015 13:41:09 +0000 (07:41 -0600)]
st/mesa: add comments on a few sampler view functions

Trivial.

9 years agomesa: do more thorough target checking in compressed_subtexture_target_check()
Brian Paul [Wed, 22 Jul 2015 13:53:01 +0000 (07:53 -0600)]
mesa: do more thorough target checking in compressed_subtexture_target_check()

When we're error-checking the target, we also need to check if the
corresponding extension is supported.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: another target fix in compressed_subtexture_target_check()
Brian Paul [Wed, 22 Jul 2015 13:42:12 +0000 (07:42 -0600)]
mesa: another target fix in compressed_subtexture_target_check()

The previous fix added GL_TEXTURE_CUBE_MAP_ARRAY but we also need
to support GL_TEXTURE_CUBE_MAP (via DSA).

So in the end, GL_TEXTURE_3D is the only (legal) target for
glCompressedTex*SubImage3D() which needs additional compression
format checking.  GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY
and GL_TEXTURE_CUBE_MAP are basically 2D images which support all
compressed formats.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: simplify format check in compressed_subtexture_target_check()
Brian Paul [Wed, 22 Jul 2015 13:32:36 +0000 (07:32 -0600)]
mesa: simplify format check in compressed_subtexture_target_check()

Lose the invalidformat local variable.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: initialize variables to silence compiler warnings
Brian Paul [Wed, 22 Jul 2015 00:42:41 +0000 (18:42 -0600)]
mesa: initialize variables to silence compiler warnings

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoapiexec: remove leading gl from shader subroutine interfaces
Dave Airlie [Fri, 24 Jul 2015 02:02:57 +0000 (12:02 +1000)]
apiexec: remove leading gl from shader subroutine interfaces

Remove the gl at the start, stared at this for a while
yesterday, totally missed it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91441
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodocs: remove expanded ARB_dsa notes
Ilia Mirkin [Thu, 23 Jul 2015 20:57:25 +0000 (16:57 -0400)]
docs: remove expanded ARB_dsa notes

This doesn't provide much value since it's all done. The qbo interaction
is fairly trivial.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agonvc0/ir: tess factors are now sysvals, adapt codegen to expect that
Ilia Mirkin [Fri, 24 Jul 2015 01:41:38 +0000 (21:41 -0400)]
nvc0/ir: tess factors are now sysvals, adapt codegen to expect that

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs/GL3.txt: ARB_shader_precision
Dave Airlie [Thu, 23 Jul 2015 01:19:15 +0000 (11:19 +1000)]
docs/GL3.txt: ARB_shader_precision

This extension is about setting expectation on GL4.1 implementations
rather than actually enforcing things. So once you support GLSL 410
then you support this in theory.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoi965: add support for ARB_shader_subroutine
Dave Airlie [Tue, 21 Jul 2015 04:22:11 +0000 (14:22 +1000)]
i965: add support for ARB_shader_subroutine

This just adds some missing pieces to nir/i965,
it is lightly tested on my Haswell.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: rearrange texture error checking order
Ilia Mirkin [Wed, 22 Jul 2015 16:59:46 +0000 (12:59 -0400)]
mesa: rearrange texture error checking order

This moves the width/height/depth == 0 check to the front and avoids
doing any other checking when that is the case.

Also moves the dimensions check after the format/type checks so that we
don't bail out with success on a width/height/depth == 0 request when
the format/type don't match.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91425
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: adjust error message when there's a missing teximage
Ilia Mirkin [Wed, 22 Jul 2015 16:39:47 +0000 (12:39 -0400)]
mesa: adjust error message when there's a missing teximage

The current message makes it seem like the zoffset is invalid.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoRevert "Match swrast modes more loosely."
Marek Olšák [Thu, 23 Jul 2015 19:51:48 +0000 (21:51 +0200)]
Revert "Match swrast modes more loosely."

This reverts commit f3728a16c9c6a02fc1f44b8069b0060e2358f22e.

It broke glxgears on radeonsi. The window was just black.

9 years agogallivm: Fix profile build.
Jose Fonseca [Thu, 23 Jul 2015 15:54:02 +0000 (16:54 +0100)]
gallivm: Fix profile build.

9 years agogallium/util: Stop bundling our snprintf implementation.
Jose Fonseca [Wed, 22 Jul 2015 12:21:24 +0000 (13:21 +0100)]
gallium/util: Stop bundling our snprintf implementation.

Use MSVCRT functions instead.  Their semantics are slightly
different but they can be made to work as expected.

Also, use the same code paths for both MSVCRT and MinGW.

https://bugs.freedesktop.org/show_bug.cgi?id=91418

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoMatch swrast modes more loosely.
Tom Hughes [Tue, 2 Jun 2015 12:40:37 +0000 (13:40 +0100)]
Match swrast modes more loosely.

https://bugs.freedesktop.org/show_bug.cgi?id=90817

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agomesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls
Eduardo Lima Mitev [Thu, 23 Jul 2015 14:25:21 +0000 (16:25 +0200)]
mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls

Basically, two different target error checks are chained consecutively, and the
second one is executed regardless the result of the first one. This produces an
incorrect error if the first check fails but is overrided by the second.

This patch conditions the execution of the second check to a successful pass of
the first one.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agogallivm: Add ifdefs so raw_debug_stream is only defined when used
Tom Stellard [Mon, 20 Jul 2015 15:24:13 +0000 (11:24 -0400)]
gallivm: Add ifdefs so raw_debug_stream is only defined when used

Its only use is to implement a custom version of LLVMDumpValue
on some Windows and embedded platforms.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: Don't use raw_debug_ostream for dissasembling
Tom Stellard [Mon, 20 Jul 2015 13:49:05 +0000 (06:49 -0700)]
gallivm: Don't use raw_debug_ostream for dissasembling

All LLVM API calls that require an ostream object have been removed from
the disassemble() function, so we don't need to use this class to wrap
_debug_printf() we can just call this function directly.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodocs: mark off tess for nvc0
Ilia Mirkin [Thu, 23 Jul 2015 07:39:13 +0000 (03:39 -0400)]
docs: mark off tess for nvc0

9 years agogk110/ir: fake BAR support
Ilia Mirkin [Thu, 23 Jul 2015 00:34:30 +0000 (20:34 -0400)]
gk110/ir: fake BAR support

Makes things sorta work until we figure out the real way to do this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: cleanup private enums that have graduated to gallium
Ilia Mirkin [Sun, 17 May 2015 04:45:12 +0000 (00:45 -0400)]
nvc0/ir: cleanup private enums that have graduated to gallium

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: allow tess eval output loads to be CSE'd
Ilia Mirkin [Thu, 30 Apr 2015 06:00:20 +0000 (02:00 -0400)]
nvc0/ir: allow tess eval output loads to be CSE'd

These only happen for gl_TessCoord which are constant.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: add hazard for 2nd dim of vfetch/load indirect argument
Ilia Mirkin [Thu, 23 Jul 2015 06:27:04 +0000 (02:27 -0400)]
nvc0/ir: add hazard for 2nd dim of vfetch/load indirect argument

Apparently a multi-word load can potentially overwrite the indirect
sources, so make sure that RA picks different registers for those.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: patch vertex count is stored in the upper bits
Ilia Mirkin [Sat, 21 Feb 2015 08:12:54 +0000 (03:12 -0500)]
nvc0/ir: patch vertex count is stored in the upper bits

9 years agonvc0/ir: add support for reading outputs in tess control shaders
Ilia Mirkin [Sun, 20 Jul 2014 20:23:16 +0000 (16:23 -0400)]
nvc0/ir: add support for reading outputs in tess control shaders

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: set perPatch flag on load/stores to per-patch varyings
Ilia Mirkin [Sun, 20 Jul 2014 17:36:37 +0000 (13:36 -0400)]
nvc0/ir: set perPatch flag on load/stores to per-patch varyings

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: populate info structure based on new tess properties
Ilia Mirkin [Sun, 20 Jul 2014 17:12:38 +0000 (13:12 -0400)]
nvc0/ir: populate info structure based on new tess properties

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0/ir: mark varyings as per-patch based on semantic name
Ilia Mirkin [Sun, 20 Jul 2014 16:17:46 +0000 (12:17 -0400)]
nvc0/ir: mark varyings as per-patch based on semantic name

Also add proper handling for PATCH semantics

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: TESSCOORD comes in as a sysval, not an input
Ilia Mirkin [Sun, 13 Jul 2014 02:08:44 +0000 (22:08 -0400)]
nvc0: TESSCOORD comes in as a sysval, not an input

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: add handling for set_tess_state callback
Ilia Mirkin [Sun, 20 Jul 2014 19:50:43 +0000 (15:50 -0400)]
nvc0: add handling for set_tess_state callback

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: add support for setting patch vertices at draw time
Ilia Mirkin [Sun, 17 May 2015 04:40:20 +0000 (00:40 -0400)]
nvc0: add support for setting patch vertices at draw time

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: support MAX_SHADER_PATCH_VARYINGS
Ilia Mirkin [Sun, 21 Jun 2015 17:35:53 +0000 (13:35 -0400)]
nvc0: support MAX_SHADER_PATCH_VARYINGS

9 years agonvc0: preliminary tess support
Ilia Mirkin [Sat, 12 Jul 2014 19:40:14 +0000 (15:40 -0400)]
nvc0: preliminary tess support

Uncomment the various functionality that was already there and add in
obvious missing bits that parallel vp/gp/fp functionality.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs/GL3.txt: update ARB_shader_subroutine status.
Dave Airlie [Wed, 22 Jul 2015 01:04:52 +0000 (11:04 +1000)]
docs/GL3.txt: update ARB_shader_subroutine status.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: enable shader subroutine
Dave Airlie [Mon, 20 Apr 2015 00:30:53 +0000 (10:30 +1000)]
st/mesa: enable shader subroutine

since this touches drivers, only enable it on gallium
for now for drivers reporting GLSL 1.30 or above.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: add subroutine bits (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:29:42 +0000 (10:29 +1000)]
st/mesa: add subroutine bits (v1.1)

Just add support for the subroutine type to the
glsl->tgsi convertor.

v1.1: add subroutine to int support.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: fill out the ARB_shader_subroutine APIs
Dave Airlie [Mon, 20 Apr 2015 00:29:12 +0000 (10:29 +1000)]
mesa: fill out the ARB_shader_subroutine APIs

This fleshes out the APIs, using the program resource
APIs where they should match.

It also sets the default values to valid subroutines.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram: add subroutine uniform support (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:28:40 +0000 (10:28 +1000)]
program: add subroutine uniform support (v1.1)

Add support for the subroutine uniform type ir->mesa.cpp

v1.1: add subroutine to int to switch

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram_resource: add subroutine support (v3.1)
Dave Airlie [Mon, 20 Apr 2015 00:27:58 +0000 (10:27 +1000)]
program_resource: add subroutine support (v3.1)

This fleshes out the ARB_program_query support for the
APIs that ARB_shader_subroutine introduces, leaving
some TODOs for later addition.

v2: reworked for lots of the ARB_program_interface_query
entry points and tests
v3: use common function to test for subroutine support
v3.1: add tess, fix missing breaks

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add uniform and program resource support (v2)
Dave Airlie [Mon, 20 Apr 2015 00:27:36 +0000 (10:27 +1000)]
glsl: add uniform and program resource support (v2)

This adds linker support for subroutine uniforms, they
have some subtle differences from real uniforms, we also hide
them and they are given internal uniform names.

This also adds the subroutine locations and subroutine uniforms
to the program resource tracking for later use.

v1.1: drop is_subroutine_def

v2: handle explicit location properly, ARB_explicit_location
has a lot of language for subroutine shaders.
Calculate a link time the number of compatible subroutines
for a uniform, to make program resource easier later.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)
Dave Airlie [Tue, 21 Jul 2015 04:59:01 +0000 (14:59 +1000)]
mesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)

This adds the necessary storage for subroutine info to gl_shader.

v2: add comments, rename one member
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: add subroutine lowering pass (v2.3)
Dave Airlie [Thu, 23 Apr 2015 03:34:14 +0000 (13:34 +1000)]
glsl/ir: add subroutine lowering pass (v2.3)

This lowers the enhanced ir_call using the lookaside table
of subroutines into an if ladder. This initially was done
at the AST level but it caused some ordering issues so a separate
pass was required.

v2: clone return value derefs.
v2.1: update for subroutine->int convert.
v2.2: add a clone for the array index

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add ast/parser support for subroutine parsing storage (v3.2)
Dave Airlie [Mon, 1 Jun 2015 00:55:47 +0000 (10:55 +1000)]
glsl: add ast/parser support for subroutine parsing storage (v3.2)

This is the guts of the GLSL parser and AST support for
shader subroutines.

The code creates a subroutine type in the parser, and
uses that there to validate the identifiers. The parser
also distinguishes between subroutine types/function prototypes
/uniforms and subroutine defintions for functions.

Then in the AST conversion it recreates the types, and
stores the subroutine definition info or subroutine info
into the ir_function along with a side lookup table in
the parser state. It also converts subroutine calls into
the enhanced ir_call.

v2: move to handling method calls in
function handling not in field selection.
v3: merge Chris's previous parser patches in here, to
make it clearer what's changed in one place.
v3.1: add more documentation, drop unused include
v3.2: drop is_subroutine_def

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: allow ir_call to handle subroutine calling
Dave Airlie [Fri, 24 Apr 2015 00:47:03 +0000 (10:47 +1000)]
glsl/ir: allow ir_call to handle subroutine calling

This adds a ir_variable which contains the subroutine uniform
and an array rvalue for the deref of that uniform, these
are stored in the ir_call and lowered later.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/ir: add subroutine information storage to ir_function (v1.1)
Dave Airlie [Mon, 20 Apr 2015 00:22:57 +0000 (10:22 +1000)]
glsl/ir: add subroutine information storage to ir_function (v1.1)

We need to store two sets of info into the ir_function,
if this is a function definition with a subroutine list
(subroutine_def) or if it a subroutine prototype.

v1.1: add some more documentation.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: add function to check if shader subroutines are enabled.
Dave Airlie [Thu, 23 Jul 2015 00:23:36 +0000 (10:23 +1000)]
mesa: add function to check if shader subroutines are enabled.

This checks if core profile and shader subroutine extension
is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: add inline conversion functions for ARB_shader_subroutine (v2)
Dave Airlie [Mon, 20 Apr 2015 00:20:06 +0000 (10:20 +1000)]
mesa: add inline conversion functions for ARB_shader_subroutine (v2)

This handles converting the shader stages to the internal
prefix along with the program resource interfaces.

v2: add tess support

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: don't eliminate subroutine types.
Dave Airlie [Tue, 21 Jul 2015 04:52:40 +0000 (14:52 +1000)]
glsl: don't eliminate subroutine types.

This stops dead code from removing subroutines types,
we need these for the queries to work properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/types: add new subroutine type (v3.2)
Dave Airlie [Mon, 20 Apr 2015 00:16:55 +0000 (10:16 +1000)]
glsl/types: add new subroutine type (v3.2)

This type will be used to store the name of subroutine types

as in subroutine void myfunc(void);
will store myfunc into a subroutine type.

This is required to the parser can identify a subroutine
type in a uniform decleration as a valid type, and also for
looking up the type later.

Also add contains_subroutine method.

v2: handle subroutine to int comparisons, needed
for lowering pass.
v3: do subroutine to int with it's own IR
operation to avoid hacking on asserts (Kayden)
v3.1: fix warnings in this patch, fix nir,
fix tgsi
v3.2: fixup tests

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
tests: fix warnings

9 years agoglsl: Make `subroutine` a reserved keyword
Chris Forbes [Sun, 10 Aug 2014 09:38:23 +0000 (21:38 +1200)]
glsl: Make `subroutine` a reserved keyword

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodispatch_sanity: add shader subroutine to fix make check
Dave Airlie [Thu, 23 Jul 2015 00:49:12 +0000 (10:49 +1000)]
dispatch_sanity: add shader subroutine to fix make check

Add the shader subroutine to the core only API list,
and fixup dispatch_sanity to suit.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: Add extension plumbing and define for ARB_shader_subroutine
Chris Forbes [Sun, 10 Aug 2014 09:31:06 +0000 (21:31 +1200)]
glsl: Add extension plumbing and define for ARB_shader_subroutine

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add glGet support for ARB_shader_subroutine implementation limits
Chris Forbes [Sun, 10 Aug 2014 09:07:33 +0000 (21:07 +1200)]
mesa: Add glGet support for ARB_shader_subroutine implementation limits

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add extension tracking for arb_shader_subroutine (v2)
Chris Forbes [Sun, 10 Aug 2014 08:43:45 +0000 (20:43 +1200)]
mesa: Add extension tracking for arb_shader_subroutine (v2)

v2: [airlied]: merge version check update.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglapi: Add ARB_shader_subroutine functions and enums (v2)
Chris Forbes [Sun, 10 Aug 2014 08:38:53 +0000 (20:38 +1200)]
glapi: Add ARB_shader_subroutine functions and enums (v2)

v2: fix output="true" and LENGTH typo

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: Add stubs for ARB_shader_subroutine entrypoints
Chris Forbes [Sun, 10 Aug 2014 09:00:34 +0000 (21:00 +1200)]
mesa: Add stubs for ARB_shader_subroutine entrypoints

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agodispatch_sanity.cpp: remove commented out tess entries
Dave Airlie [Thu, 23 Jul 2015 00:39:47 +0000 (10:39 +1000)]
dispatch_sanity.cpp: remove commented out tess entries

These entries were put in the GL4.0 section, so removed the commented
out ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl/tests: fix varying_test since tess changes.
Dave Airlie [Thu, 23 Jul 2015 01:13:36 +0000 (11:13 +1000)]
glsl/tests: fix varying_test since tess changes.

This fixes make check since the tess changes.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>