summaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: Use the new bare sampler typeKristian Høgsberg Kristensen2016-02-281-5/+1
|
* Merge remote-tracking branch 'origin/master' into vulkanKristian Høgsberg Kristensen2016-02-2427-257/+369
|\
| * glsl: Implement the required built-in functions when OES_shader_image_atomic ↵Francisco Jerez2016-02-221-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is enabled. This is basically just the same atomic functions exposed by ARB_shader_image_load_store, with one exception: "highp float imageAtomicExchange( coherent IMAGE_PARAMS, float data);" There's no float atomic exchange overload in the original ARB_shader_image_load_store or GL 4.2, so this seems like new functionality that requires specific back-end support and a separate availability condition in the built-in function generator. v2: Move image availability predicate logic into a separate static function for clarity. Had to pull out the image_function_flags enum from the builtin_builder class for that to be possible. Reviewed-by: Ilia Mirkin <[email protected]>
| * glsl: Add usual extension boilerplate for OES_shader_image_atomic.Francisco Jerez2016-02-223-0/+6
| | | | | | | | | | | | v2: No need for extension enable bits (Ilia). Reviewed-by: Ilia Mirkin <[email protected]>
| * glsl: fix emit_inline_matrix_constructor for doublesIago Toral Quiroga2016-02-191-6/+13
| | | | | | | | | | | | | | Specifically, for the case where we initialize a dmat with a source matrix that has fewer columns/rows. Reviewed-by: Kenneth Graunke <[email protected]>
| * glsl: Mark float constants as suchIago Toral Quiroga2016-02-191-5/+5
| | | | | | | | | | | | So we don't generate double to float conversion code Reviewed-by: Kenneth Graunke <[email protected]>
| * glsl: fix indentation in emit_inline_matrix_constructorIago Toral Quiroga2016-02-191-75/+75
| | | | | | | | Reviewed-by: Kenneth Graunke <[email protected]>
| * glsl: fix standalone compilerRob Clark2016-02-191-0/+12
| | | | | | | | | | | | | | | | | | Need to set some non-zero limits for MaxCombinedUniformComponents, otherwise we hit an "Too many <type> shader uniform components" error in the linker. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
| * glsl: fix new gcc6 warningsRob Clark2016-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | src/compiler/glsl/lower_discard_flow.cpp:79:1: warning: ‘ir_visitor_status {anonymous}::lower_discard_flow_visitor::visit_enter(ir_loop_jump*)’ defined but not used [-Wunused-function] lower_discard_flow_visitor::visit_enter(ir_loop_jump *ir) ^~~~~~~~~~~~~~~~~~~~~~~~~~ The base class method that was intended to be overridden was 'visit(ir_loop_jump *ir)', not visit_enter(). Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * glsl: fix new gcc6 warningsRob Clark2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/compiler/glsl/ast_to_hir.cpp: In function ‘unsigned int ast_process_struct_or_iface_block_members(exec_list*, _mesa_glsl_parse_state*, exec_list*, glsl_struct_field**, bool, glsl_matrix_layout, bool, ir_variable_mode, ast_type_qualifier*, unsigned int, unsigned int)’: src/compiler/glsl/ast_to_hir.cpp:6339:52: warning: ‘first_member_has_explicit_location’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (!layout->flags.q.explicit_location && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ ((first_member_has_explicit_location && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !qual->flags.q.explicit_location) || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (!first_member_has_explicit_location && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qual->flags.q.explicit_location))) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * glcpp: Disallow "defined" as a macro name.Kenneth Graunke2016-02-181-0/+3
| | | | | | | | | | | | | | | | | | | | Both GCC and Clang disallow this, and glslang has recently started disallowing it as well. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94188 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * compiler/glsl: Fix uniform location counting.Plamena Manolova2016-02-183-35/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the calculation of current uniforms to link_uniforms, which makes use of UniformRemapTable which stores all the reserved uniform locations. Location assignment for implicit uniforms now tries to use any gaps left in the table after the location assignment for explicit uniforms. This gives us more space to store more uniforms. Patch is based on earlier patch with following changes/additions: 1: Move the counting of explicit locations to check_explicit_uniform_locations and then pass the number to link_assign_uniform_locations. 2: Count the number of empty slots in UniformRemapTable and store them in a list_head. 3: Try to find an empty slot for implicit locations from the list, if that fails resize UniformRemapTable. Fixes following CTS tests: ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max ES31-CTS.explicit_uniform_location.uniform-loc-mix-with-implicit-max-array Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93696
| * glsl: remove duplicate interpolation_string() functionTimothy Arceri2016-02-173-30/+2
| | | | | | | | | | | | | | We already have one in the IR code that can be used everywhere its needed in the AST code so remove the one from the AST. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
| * glsl: remove unused helperTimothy Arceri2016-02-172-26/+0
| | | | | | | | | | | | Seems to have become unused when i965 moved to NIR. Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: set user defined varyings to smooth by default in ESTimothy Arceri2016-02-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is usually handled by the backends in order to handle the various interactions with the gl_*Color built-ins. The problem is this means linking will fail if one side on the interface adds the smooth qualifier to the varying and the other side just uses the default even though they match. This fixes various deqp tests. The spec is not clear what to for desktop GL so leave it as is for now. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92743
| * glsl: warn in GL as well as ES when varying not writtenTimothy Arceri2016-02-161-16/+7
| | | | | | | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93339
| * glsl: Fix overflow of ImageAccess[] array.Kenneth Graunke2016-02-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ImageAccess array is statically sized to MAX_IMAGE_UNIFORMS: GLenum ImageAccess[MAX_IMAGE_UNIFORMS]; There was no bounds checking ensuring we don't overflow. Passing in a shader with too many uniforms would cause writes to extend into other fields, such as sh->NumImages. Later linker checks already handle reporting an error when there are too many images, so just avoid corrupting structures here. This rearranges the logic a bit to look more like the sampler case. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Tested-by: Jordan Justen <[email protected]>
| * nir/types: Add more type constructor functionsJason Ekstrand2016-02-132-0/+58
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * nir/types: Add a few more glsl_type_is_ functionsJason Ekstrand2016-02-132-0/+21
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * nir/types: Add helpers for working with sampler and image typesJason Ekstrand2016-02-132-0/+75
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * nir/types: Add helpers for function typesJason Ekstrand2016-02-132-0/+28
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * glsl/types: Expose glsl_struct_field and glsl_function_param to CJason Ekstrand2016-02-131-4/+6
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * glsl/types: Add a helper for getting image typesJason Ekstrand2016-02-132-0/+89
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * glsl/types: Add support for function typesJason Ekstrand2016-02-136-1/+134
| | | | | | | | | | | | | | | | SPIR-V has a concept of a function type that's used fairly heavily. We could special-case function types in SPIR-V -> NIR but it's easier if we just add support to glsl_types. Reviewed-by: Jordan Justen <[email protected]>
| * glsl/types: Add a bare "sampler" typeJason Ekstrand2016-02-131-0/+1
| | | | | | | | | | | | | | | | | | This is to be used by SPIR-V for representing a sampler that isn't attached to any particular image. In SPIR-V, all of the interesting bits such as dimensionality, sampled type, etc. come from the image, the bare "sampler" type simply uses a sampled type of VOID and 0 values for the rest. Reviewed-by: Jordan Justen <[email protected]>
| * glsl/types: Rename sampler_type to sampled_typeJason Ekstrand2016-02-136-13/+13
| | | | | | | | | | | | | | | | It's a bit more descriptive since it is the base type that you get when you sample from it. Also, the next commit adds a bare "sampler" type and we need glsl_type::sampler_type available for a public static member. Reviewed-by: Jordan Justen <[email protected]>
| * mesa: do not use a constant for MAX_COMPUTE_SHARED_SIZESamuel Pitoiset2016-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | This will allow to query the underlying drivers for the maximum total storage size of all variables declared as <shared> with PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
| * mesa: make compute maximums reflect driver-provided valuesIlia Mirkin2016-02-134-5/+26
| | | | | | | | | | | | | | | | Looks like the various max's were never plumbed through. Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
| * glsl: replace _strtoui64() with strtoull() for MSVCTimothy Arceri2016-02-131-4/+0
| | | | | | | | | | | | Now that MSVC 2013 is required we can remove this. Reviewed-by: Jose Fonseca <[email protected]>
| * glsl: Allow invariant qualifer in block members in desktop OpenGL.Samuel Iglesias Gonsálvez2016-02-121-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Feedback from Khronos is that 'invariant' should be allowed on block members for desktop OpenGL. Fix piglit regression added by fe1e89a0: invariant-qualifier-in-out-block-01.vert v2: - Allow it for in/out blocks in OpenGL ES too, so when OES_shader_io_blocks is supported we don't need to do any change (Timothy) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89330 Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* | nir/spirv: Allow but warn for a few capabilitiesJason Ekstrand2016-02-231-1/+5
| | | | | | | | | | | | Unfortunately, glslang gives us cull/clip distance and GS streams even if the shader doesn't use it whenever a shader is declared as version 450. This is a glslang bug, but we can easily enough ignore it for now.
* | nir/spirv: Add more capabilitiesJason Ekstrand2016-02-231-0/+9
| |
* | nir/spirv: Add support for multisampled texturesJason Ekstrand2016-02-211-12/+19
| |
* | nir/gather_info: Count textures and imagesJason Ekstrand2016-02-181-0/+17
| |
* | nir/spirv: Add some more capabilitiesJason Ekstrand2016-02-171-2/+9
| |
* | nir: Add a helper for getting the one function from a shaderJason Ekstrand2016-02-171-0/+9
| |
* | nir: Add a nir_foreach_variable_safe helperJason Ekstrand2016-02-171-0/+3
| |
* | spirv: Fix SpvOpFwidth, SpvOpFwidthFine and SpvOpFwidthCoarseKristian Høgsberg Kristensen2016-02-171-3/+3
| | | | | | | | | | | | | | "Result is the same as computing the sum of the absolute values of OpDPdx and OpDPdy on P." We were doing sum of absolute values of OpDPdx of P and OpDPdx of NULL.
* | nir: Get rid of the C++ NIR_SRC/DEST_INIT macrosJason Ekstrand2016-02-121-10/+2
| | | | | | | | | | | | These were originally added to reduce compiler warnings but aren't really needed. Getting rid of them reduces the diff between the Vulkan branch and master, so we might as well.
* | nir/spirv/glsl: Clean up the row-skipping swizzle logic a bitJason Ekstrand2016-02-121-10/+4
| |
* | nir/spirv: Allow the clip distance capability.Jason Ekstrand2016-02-111-0/+1
| |
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2016-02-114-75/+42
|\|
| * glsl: don't validate interface blocks twiceTimothy Arceri2016-02-121-23/+21
| | | | | | | | | | | | | | We already check for opaque types so don't recheck for atomics and images. Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: remove duplicate embedded struct validationTimothy Arceri2016-02-123-51/+17
| | | | | | | | | | | | | | | | | | | | | | Commit c98deb18d5836f in 2010 disallowed embedded struct definitions in ES. Then in 2013 d9bb8b7b56ce65b disallowed it for everything but GLSL 1.10. Commit c98deb18d5836f seemed the cleanest way to do the check so its been extended to cover GL and the other version has been removed. Reviewed-by: Iago Toral Quiroga <[email protected]>
| * mesa: call build_program_resource_list inside Driver.LinkShaderMarek Olšák2016-02-111-1/+4
| | | | | | | | | | | | to allow LinkShader to free the GLSL IR. Reviewed-by: Ian Romanick <[email protected]>
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2016-02-107-46/+10
|\| | | | | | | | | This also reverts commit 1d65abfa582a371558113f699ffbf16d60b64c90 because now NIR handles texture offsets in a much more sane way.
| * nir: Remove the const_offset from nir_tex_instrJason Ekstrand2016-02-105-32/+5
| | | | | | | | | | | | | | | | | | | | | | When NIR was originally drafted, there was no easy way to determine if something was constant or not. The result was that we had lots of special-casing for constant values such as this. Now that load_const instructions are SSA-only, it's really easy to find constants and this isn't really needed anymore. Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
| * nir/lower_vec_to_movs: Better report channels handled by insert_movJason Ekstrand2016-02-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues. First, we had a use-after-free in the case where the instruction got deleted and we tried to return mov->dest.write_mask. Second, in the case where we are doing a self-mov of a register, we delete those channels that are moved to themselves from the write-mask. This means that those channels aren't reported as being handled even though they are. We now stash off the write-mask before remove unneeded channels so that they still get reported as handled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94073 Reviewed-by: Matt Turner <[email protected]> Cc: "11.0 11.1" <[email protected]>
* | nir: Fix out-of-tree build for spirv2nirKristian Høgsberg Kristensen2016-02-101-0/+5
| | | | | | | | This needs to be able to find the generated nir_opcodes.h header.
* | nir/spirv: Fix handling of OpGroupMemberDecorateJason Ekstrand2016-02-101-1/+1
| | | | | | | | We were pulling the member index from the wrong dword