Commit Graph

91830 Commits

Author SHA1 Message Date
Dave Airlie
ff47866107 radv/meta: split out core part of resolve shader
I want to reuse the same code for the fragment shader
version of the resolve shaders.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-07 23:41:38 +01:00
Dave Airlie
588185eb6b radv/meta: add srgb conversion to end of resolve shader.
If we are resolving into an srgb dest, we need to convert
to linear so the store does the conversion back.

This should fix some wierdness seen when we subresolves
hit the compute path.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-07 23:41:38 +01:00
Jose Fonseca
dab6a2dfd9 nir: Fix missing snprintf symbol on Windows.
Copy nir_print.c's snprintf definition for now, to unbreak Windows
builds.

We can and should cleanup all snprintf definitions in a follow up
change, but I rather not leave Windows build broken any further.

Trivial.
2017-05-07 19:23:07 +01:00
Pierre Moreau
27ad060c6e nv50/ir: Replace NV50_PROGRAM_IR_* by PIPE_SHADER_IR_*
Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-05-07 10:26:37 -04:00
Pierre Moreau
8fe5949b08 nv50/ir: Remove unused translation methods
This code was merged commented out, and has stayed that way ever since.

Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-05-07 10:26:36 -04:00
Pierre Moreau
dd7ab4dcb4 nv50/ir: Free target if we failed to create a program
Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-05-07 10:26:36 -04:00
Pierre Moreau
b490ca9a38 nv50/ir: Fail if encountering unknown shader type
Signed-off-by: Pierre Moreau <pierre.morrow@free.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-05-07 10:26:36 -04:00
Dave Airlie
c297e68828 radv: set PERF_MOD in sample state like radeonsi.
This just aligns the code with radeonsi.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-07 11:19:01 +01:00
Dave Airlie
2add79a732 radv: apply the tess+GS hang workaround to Polaris12 as well
As I pointed out for radeonsi, and AMD confirmed, so fix this
in radv as well.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-07 11:17:48 +01:00
Timothy Arceri
ccf9669cc1 mesa: small texture targetIndex tidy up
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:34 +10:00
Timothy Arceri
68cd0e2000 mesa: fix broken indentation
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:34 +10:00
Timothy Arceri
084fec0e77 mesa: some C99 tidy ups
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
f9e6820652 mesa: add KHR_no_error support to copy buffer subdata functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
5e86bfaee3 mesa: remove _mesa from static function
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
2a305fee1b st/mesa: stop calling _mesa_init_buffer_object_functions()
After calling this we were then overriding all the functions with
st versions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
123b113f95 mesa: make _mesa_buffer_storage() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
681647eca8 mesa: make _mesa_copy_buffer_sub_data() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
f9c28b9f87 mesa: make _mesa_clear_buffer_sub_data() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
426e4765d2 mesa: add KHR_no_error support for flush mapped buffer functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
30d8dea602 mesa: make _mesa_flush_mapped_buffer_range() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
bbae62c714 mesa: add KHR_no_error support for unmap buffer functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
0b2e4da80a mesa: split unmap_buffer() in two
This will allow us to implement KHR_no_error support for unmap
functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
6c3768692e mesa: make _mesa_unmap_buffer() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
9d010f57db mesa: add KHR_no_error support for some map buffer functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
e83b0a4103 mesa: split out validation from map_buffer_range()
This will allow us to add KHR_no_error support for *BufferRange
functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Timothy Arceri
8a1c36015b mesa: make map_buffer_range() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-07 15:29:33 +10:00
Kenneth Graunke
1151349c2a i965: Drop BRW_NEW_BLORP from 3DSTATE_VF atom.
BLORP doesn't program 3DSTATE_VF, since it doesn't use index buffers,
making the setting irrelevant.  So there's no need to re-emit it after
a BLORP operation - the old setting will still be in place.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-05-06 15:43:43 -07:00
Kenneth Graunke
6e2c39f562 i965: Port 3DSTATE_VF to genxml and simplify the implementation.
The whole "it might be used for non-indexed draws" thing is no longer
true - it turns out this was a mistake, and removed in OpenGL 4.5.
(See Marek's commit 96cbc1ca29e0b1f4f4d6c868b8449999aecb9080.)  So
we can simplify this and just program 0 for non-indexed draws.

We can also use #if blocks to remove the atom on Ivybridge/Baytrail,
now that they have a separate atom list from Haswell.  No more runtime
checks.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-05-06 15:43:43 -07:00
Kenneth Graunke
8c5a938171 mesa: Simplify _mesa_primitive_restart_index().
We can use a simple shift equation rather than a switch statement.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-05-06 15:43:43 -07:00
Marek Olšák
314657dc11 Revert "radeonsi: constify a bunch of the perfcounter structs."
This reverts commit 7088b655e8.

It breaks performance counters. If you use them with this commit, they hang
the machine hard. Sysrq and ssh don't work.
2017-05-06 21:17:52 +02:00
Marek Olšák
b0d01bd303 Revert "radeonsi: fix build with GCC 4.8"
This reverts commit 485ece83ac.

It's needed to revert 7088b655e8.
2017-05-06 21:17:52 +02:00
Rob Clark
6050d5bf3d freedreno/a3xx: fix hang w/ large render targets and small gmem
Possibly other gen's have a similar limit.  Fixes glmark2 -b shadow
with larger resolutions on devices with small gmem (for example,
fullscreen 1080p on 8x16/db410c).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-05-06 14:16:33 -04:00
Rob Clark
4fadfbf176 freedreno/ir3: add macro to declare variable length arrays
We have enough of these, that we should stop open coding this.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-05-06 14:15:42 -04:00
Nicolai Hähnle
b738fae4b9 glsl: skip tree grafting for sampler and image types
v2: - use is_sampler()/is_image() instead (Samuel Pitoiset)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
d04b0f31d3 glsl: teach lower_ubo_reference about samplers inside structures
In a situation like:

(tex vec4 (record_ref (var_ref f)  tex)  (constant vec2 (0.000000 0.000000))  0 1 () )

The sampler needs to be lowered, otherwise this ends up with
"ir_dereference_variable @ 0x229a100 specifies undeclared variable
`ubo_load_temp' @ 0x2290440"

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
d550024a7e glsl: link bindless layout qualifiers
From section 4.4.6 of the ARB_bindless_texture spec:

   "If both bindless_sampler and bound_sampler, or bindless_image
    and bound_image, are declared at global scope in any
    compilation unit, a link- time error will be generated."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
d6810ea286 glsl: do not count bindless samplers/images when linking uniforms
From section 2.14.8 of the ARB_bindless_texture spec:

    "(modify second paragraph, p. 126) ... against the
     MAX_COMBINED_TEXTURE_IMAGE_UNITS limit.  Samplers accessed
     using texture handles (section 3.9.X) are not counted against
     this limit."

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
8b4c48673a glsl: lower bindless sampler/image packed varyings
v3: - rebase (and remove (sampler) ? 1 : vector_elements)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
3cdcc5f02f glsl: implement ARB_bindless_texture conversions
From section 5.4.1 of the ARB_bindless_texture spec:

   "In the following four constructors, the low 32 bits of the
    sampler type correspond to the .x component of the uvec2 and
    the high 32 bits correspond to the .y component."

    uvec2(any sampler type)     // Converts a sampler type to a
                                //   pair of 32-bit unsigned integers
    any sampler type(uvec2)     // Converts a pair of 32-bit unsigned integers to
                                //   a sampler type
    uvec2(any image type)       // Converts an image type to a
                                //   pair of 32-bit unsigned integers
    any image type(uvec2)       // Converts a pair of 32-bit unsigned integers to
                                //   an image type

v4: - fix up comment style
v3: - rebase (and remove (sampler) ? 1 : vector_elements)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
95c83aba71 glsl: allow bindless samplers/images to be used with constructors
For the explicit conversions.

From section 4.1.7 of the ARB_bindless_texture spec:

   "Samplers are represented using 64-bit integer handles, and
    may be converted to and from 64-bit integers using constructors."

From section 4.1.X of the ARB_bindless_texture spec:

   "Images are represented using 64-bit integer handles, and
    may be converted to and from 64-bit integers using constructors."

v3: - add spec comment
    - update the glsl error message

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (v2)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
b98542588c glsl: add is_valid_constructor() helper function
This will help for the explicit conversions for sampler and
image types as specified by ARB_bindless_texture.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
1eff26f02d glsl: add ARB_bindless_texture operations
For the explicit pack/unpack conversions.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
35c8e727a5 glsl: allow bindless samplers/images to be initialized
From section 4.1.7 of the ARB_bindless_texture spec:

   "Samplers may be declared as shader inputs and outputs, as uniform
    variables, as temporary variables, and as function parameters."

From section 4.1.X of the ARB_bindless_texture spec:

   "Images may be declared as shader inputs and outputs, as uniform
    variables, as temporary variables, and as function parameters."

v3: - add spec comment
    - update the glsl error message

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
efb668fb29 glsl: allow bindless samplers/images to be l-values
From section 4.1.7 of the ARB_bindless_texture spec:

   "Samplers can be used as l-values, so can be assigned into and
   used as "out" and "inout" function parameters."

From section 4.1.X of the ARB_bindless_texture spec:

   "Images can be used as l-values, so can be assigned into and
    used as "out" and "inout" function parameters."

v4: - invert the logic
v3: - update spec comment formatting
    - keep the read_only check

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
fa4ebf6b8d glsl: add _mesa_glsl_parse_state object to is_lvalue()
Yes, this is a bit hacky but we don't really have the choice.
Plain GLSL doesn't accept bindless samplers/images as l-values
while it's allowed when ARB_bindless_texture is enabled.

The default NULL parameter is because we can't access the
_mesa_glsl_parse_state object in few places in the compiler.
One is_lvalue(NULL) call is for IR validation but other checks
happen elsewhere, should be safe.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
42a2fe25f4 glsl: relax bindless sampler arrays indexing
From section 4.1.7 of the ARB_bindless_texture spec:

   "Samplers aggregated into arrays within a shader (using square
    brackets []) can be indexed with arbitrary integer expressions."

v3: - update spec comment formatting

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
ece1c04e8e glsl: reject bindless samplers/images frag inputs without 'flat'
From section 4.3.4 of the ARB_bindless_texture spec

   "(modify last paragraph, p. 35, allowing samplers and images as
    fragment shader inputs) ... Fragment inputs can only be signed
    and unsigned integers and integer vectors, floating point scalars,
    floating-point vectors, matrices, sampler and image types, or
    arrays or structures of these.  Fragment shader inputs that are
    signed or unsigned integers, integer vectors, or any
    double-precision floating- point type, or any sampler or image
    type must be qualified with the interpolation qualifier "flat"."

v3: - update spec comment formatting

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
8834c74fef glsl: allow bindless samplers/images as vertex shader inputs
From section 4.3.4 of the ARB_bindless_texture spec:

   "(modify third paragraph of the section to allow sampler and
    image types) ...  Vertex shader inputs can only be float,
    single-precision floating-point scalars, single-precision
    floating-point vectors, matrices, signed and unsigned integers
    and integer vectors, sampler and image types."

v3: - update spec comment formatting

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
015c0b4a34 glsl: allow bindless samplers/images as varying variables
From section 4.3.4 of the ARB_bindless_texture spec:

   "(modify third paragraph of the section to allow sampler and image
    types) ...  Vertex shader inputs can only be float,
    single-precision floating-point scalars, single-precision
    floating-point vectors, matrices, signed and unsigned integers
    and integer vectors, sampler and image types."

From section 4.3.6 of the ARB_bindless_texture spec:

   "Output variables can only be floating-point scalars,
    floating-point vectors, matrices, signed or unsigned integers or
    integer vectors, sampler or image types, or arrays or structures
    of any these."

v3: - add spec comment

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00
Samuel Pitoiset
89e37f9703 glsl: allow input memory qualifiers for images
ARB_bindless_texture spec allows images to be declared as
shader inputs.

v2: - put the */ on the following line (Timothy Arceri)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-06 16:40:19 +02:00