summaryrefslogtreecommitdiff
path: root/src/compiler
AgeCommit message (Collapse)AuthorFilesLines
2017-05-11Android: amd/common: fix dependency on libmesa_nirRob Herring1-0/+1
Building libmesa_amd_common fails with: external/mesa/src/amd/common/ac_shader_info.c:23:10: fatal error: 'nir/nir.h' file not found ^ external/mesa/src/compiler/nir/nir.h:48:10: fatal error: 'nir_opcodes.h' file not found ^ libmesa_amd_common now depends on libmesa_nir, so add it as a dependency and export the necessary directories. Fixes: 224cf29 "radv/ac: add initial pre-pass for shader info gathering" Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-09nir: Embed the shader_info in the nir_shader againJason Ekstrand14-96/+89
Commit e1af20f18a86f52a9640faf2d4ff8a71b0a4fa9b changed the shader_info from being embedded into being just a pointer. The idea was that sharing the shader_info between NIR and GLSL would be easier if it were a pointer pointing to the same shader_info struct. This, however, has caused a few problems: 1) There are many things which generate NIR without GLSL. This means we have to support both NIR shaders which come from GLSL and ones that don't and need to have an info elsewhere. 2) The solution to (1) raises all sorts of ownership issues which have to be resolved with ralloc_parent checks. 3) Ever since 00620782c92100d77c660f9783504c6d80fa1d58, we've been using nir_gather_info to fill out the final shader_info. Thanks to cloning and the above ownership issues, the nir_shader::info may not point back to the gl_shader anymore and so we have to do a copy of the shader_info from NIR back to GLSL anyway. All of these issues go away if we just embed the shader_info in the nir_shader. There's a little downside of having to copy it back after calling nir_gather_info but, as explained above, we have to do that anyway. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-05-08glsl: Don't allow redefining builtin functions on GLSL 1.00.Eric Anholt1-2/+13
The spec text cited above says you can't, but only the GLSL 3.00 (redefine or overload) case was implemented. Fixes dEQP scoping.invalid.redefine_builtin_fragment/vertex. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Matt Turner <mattst88@gmail.com>
2017-05-08glsl: Restrict func redeclarations (not just redefinitions) on GLSL 1.00.Eric Anholt1-0/+10
Fixes DEQP's scoping.invalid.redeclare_function_fragment/vertex. v2: Fix accidental rejection of prototype+decl. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v1) Tested-by: Matt Turner <mattst88@gmail.com>
2017-05-08glsl: Ban #undefining __LINE__ and friends on GLES2.Eric Anholt1-5/+2
Fixes deqp_gles2 undefine_invalid_object_* failures. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Matt Turner <mattst88@gmail.com>
2017-05-08glsl: Restrict functions to not return arrays or SOAs in GLSL 1.00.Eric Anholt3-0/+31
From the spec, Arrays are allowed as arguments, but not as the return type. [...] The return type can also be a structure if the structure does not contain an array. Fixes DEQP shaders.functions.invalid.return_array_in_struct_fragment. v2: Spec cite wording change Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Matt Turner <mattst88@gmail.com>
2017-05-08nir: fix (hopefully) windows buildRob Clark2-4/+4
Fixes: 53aa109b ("nir: add pass to lower atomic counters to SSBO") Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-05-08glsl: apply the image format for members of structuresSamuel Pitoiset1-8/+29
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-08glsl: store the image format in glsl_struct_fieldSamuel Pitoiset3-1/+11
ARB_bindless_texture allows to declare image types inside structures, which means we need to keep track of the format. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-08glsl: destroy function and subroutine hash tablesGrazvydas Ignotas1-0/+10
Just like other type hash tables are destroyed in _mesa_glsl_release_types(), also destroy the ones for function and subroutine types. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-05-07nir: Fix missing snprintf symbol on Windows.Jose Fonseca1-0/+4
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-06glsl: skip tree grafting for sampler and image typesNicolai Hähnle1-0/+11
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-06glsl: teach lower_ubo_reference about samplers inside structuresSamuel Pitoiset1-0/+15
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-06glsl: link bindless layout qualifiersSamuel Pitoiset1-0/+44
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-06glsl: do not count bindless samplers/images when linking uniformsSamuel Pitoiset1-2/+2
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-06glsl: lower bindless sampler/image packed varyingsSamuel Pitoiset1-0/+14
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-06glsl: implement ARB_bindless_texture conversionsSamuel Pitoiset3-10/+84
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-06glsl: allow bindless samplers/images to be used with constructorsSamuel Pitoiset1-2/+14
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-06glsl: add is_valid_constructor() helper functionSamuel Pitoiset1-2/+8
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-06glsl: add ARB_bindless_texture operationsSamuel Pitoiset2-0/+26
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-06glsl: allow bindless samplers/images to be initializedSamuel Pitoiset1-3/+14
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-06glsl: allow bindless samplers/images to be l-valuesSamuel Pitoiset1-0/+14
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-06glsl: add _mesa_glsl_parse_state object to is_lvalue()Samuel Pitoiset4-7/+9
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-06glsl: relax bindless sampler arrays indexingSamuel Pitoiset1-1/+7
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-06glsl: reject bindless samplers/images frag inputs without 'flat'Samuel Pitoiset1-0/+20
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-06glsl: allow bindless samplers/images as vertex shader inputsSamuel Pitoiset1-0/+14
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-06glsl: allow bindless samplers/images as varying variablesSamuel Pitoiset1-0/+20
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-06glsl: allow input memory qualifiers for imagesSamuel Pitoiset1-0/+10
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-06glsl: allow image qualifiers inside structuresSamuel Pitoiset1-4/+23
ARB_bindless_texture allows to declare images inside structures which means that qualifiers like writeonly should be allowed. I have a got a confirmation from Jeff Bolz (one author of the spec), because the spec doesn't clearly explain this. 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-06glsl: allow bindless images to be declared inside structuresSamuel Pitoiset1-1/+1
The spec doesn't clearly state this, but I have got clarification from the spec authors. 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-06glsl: allow bindless samplers/images inside interface blocksSamuel Pitoiset1-2/+12
From section 4.3.7 of the ARB_bindless_texture spec: "(remove the following bullet from the last list on p. 39, thereby permitting sampler types in interface blocks; image types are also permitted in blocks by this extension)" * sampler types are not allowed v3: - update the 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-06glsl: allow bindless samplers/images as function returnSamuel Pitoiset1-3/+8
The ARB_bindless_texture spec doesn't clearly state this, but as it says "Replace Section 4.1.7 (Samplers), p. 25" and, "Replace Section 4.1.X, (Images)", this should be allowed. 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-06glsl: allow bindless samplers/images as out and inout parametersSamuel Pitoiset1-2/+14
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." 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-06glsl: allow to declare bindless samplers/images as non-uniformSamuel Pitoiset1-17/+66
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 validate_storage_for_sampler_image_types() - update 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-06glsl: process bindless/bound layout qualifiersSamuel Pitoiset9-3/+188
This adds bindless_sampler and bound_sampler (and respectively bindless_image and bound_image) to the parser. v3: - add an extra space in apply_bindless_qualifier_to_variable() - fix indentation in merge_qualifier() 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-06glsl: do not make sampler/image types readonly variablesSamuel Pitoiset2-4/+0
In plain GLSL, sampler and image types can only be declared uniform-qualified global variables or 'in' function parameters. Setting the read_only flag seems quite useless because other checks will prevent sampler/image variables to be assigned and also because the flag is not set for atomic_uint types which are opaque types. This will also help for ARB_bindless_texture because samplers and images can be assigned when they are considered bindless. 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-06glsl: make sampler/image scalar typesSamuel Pitoiset1-1/+1
As a side effect, this will magically fix std140/std430 interfaces for bindless samplers/images and will help for implementing the explicit conversions with constructors. 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-06glsl: make count_attribute_slots() returns 1 for samplers/imagesSamuel Pitoiset1-2/+2
For packed varyings. 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-06glsl: make component_slots() returns 2 for samplers/imagesSamuel Pitoiset2-2/+8
Bindless samplers/images are 64-bit unsigned integers, which means they consume two components as specified by ARB_bindless_texture. It looks like we are not wasting uniform storage by changing this because default-block uniforms are not packed. So, if we use N uint uniforms, they occupy N * 16 bytes in the constant buffer. This is something that could be improved. Though, count_uniform_size needs to be adjusted to not count a sampler (or image) twice. As a side effect, this will probably break the cache if you have one because it will consider sampler/image types as two components. v3: - update the comments 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-06glsl: make sampler/image types as 64-bitSamuel Pitoiset1-1/+3
The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles." and, "Images are represented using 64-bit integer handles." It seems simpler to always consider sampler and image types as 64-bit unsigned integer. This introduces a temporary workaround in _mesa_get_uniform() because at this point no flag are used to distinguish between bound and bindless samplers. This is going to be removed in a separate series. This avoids breaking arb_shader_image_load_store-state. v3: - update the comment slightly 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-06glsl: add ARB_bindless_texture enableSamuel Pitoiset3-0/+9
This also adds the extension to the standalone GLSL compiler. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-04nir: add pass to lower atomic counters to SSBORob Clark3-0/+220
This is equivalent to what mesa/st does in glsl_to_tgsi. For most hw there isn't a particularly good reason to treat these differently. Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2017-05-04nir: add a C wrapper for glsl_type::get_interface_instance()Rob Clark2-0/+16
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-05-04glsl: reject memory qualifiers with uniform blocksSamuel Pitoiset1-2/+10
The spec allows memory qualifiers to be used with image variables, buffers variables and shader storage blocks. This patch also fixes validate_memory_qualifier_for_type(). Fixes the following ARB_uniform_buffer_object test: uniform-block-memory-qualifier.frag Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-04glsl: reject format qualifiers with non-image types everywhereSamuel Pitoiset1-0/+2
Including structures, interfaces and uniform blocks. Fixes the following ARB_shader_image_load_store test: format-layout-with-non-image-type.frag Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-04glsl: rework validate_image_qualifier_for_type()Samuel Pitoiset1-9/+27
It makes more sense to have two separate validate functions, mainly because memory qualifiers are allowed with members of shader storage blocks. validate_memory_qualifier_for_type() will be fixed in a separate patch. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-04glsl: rename image_* qualifiers to memory_*Samuel Pitoiset11-100/+100
It doesn't make sense to prefix them with 'image' because they are called "Memory Qualifiers" and they can be applied to members of storage buffer blocks. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Andres Gomez <agomez@igalia.com>
2017-05-03nir/lower_tex: Fix minor error in YUV color conversion matrixJohnson Lin1-3/+3
The matrix used for YCbCr to RGB is listed in: https://en.wikipedia.org/wiki/YCbCr There was an error in converting the offsets from integers to unorm values: 0.0625=16/256 should be 16.0/255,and 0.5=128.0/256 should be 128.0/255. With this fix, the CSC result is bit aligned with wikipedia's conversion result and FFMPeg's result. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100854 Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2017-05-03glsl: Corrected some typos and error messagesAndres Gomez1-4/+5
v2: left code style/formatting corrections out. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-03spirv: Add support for SPV_KHR_multiviewJason Ekstrand3-0/+9
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>