summaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* meson: convert gtest to an internal dependencyDylan Baker2017-10-031-2/+2
| | | | | | | | | | | | In truth gtest is an external dependency that upstream expects you to "vendor" into your own tree. As such, it makes sense to treat it more like a dependency than an internal library, and collect it's requirements together in a dependency object. v2: - include with -isystem instead of setting compiler args (Eric) Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Remove spurious assertionsIan Romanick2017-10-021-2/+0
| | | | | | | | It's inside an if-statement that already checks that the variables are not NULL. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl: Move 'foo = foo;' optimization to opt_dead_code_localIan Romanick2017-10-022-12/+18
| | | | | | | | | | | | The optimization as done in opt_copy_propagation would have to be removed in the next patch. If we just eliminate that optimization altogether, shader-db results, even on platforms that use NIR, are hurt quite substantially. I have not investigated why NIR isn't picking up the slack here. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Cc: Jason Ekstrand <[email protected]>
* glsl/ast: Use logical-or instead of conditional assignment to set fallthru_varIan Romanick2017-10-021-4/+4
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl/ast: Generate a more compact expression to disable execution of default ↵Ian Romanick2017-10-021-21/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | case Instead of generating a sequence like: run_default = true; if (i == 3) // some label that appears after default run_default = false; if (i == 4) // some label that appears after default run_default = false; ... if (run_default) { ... } generate something like: run_default = !((i == 3) || (i == 4) || ...); if (run_default) { ... } This eliminates one use of conditional assignment, and it enables the elimination of another. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl/ast: Explicitly track the set of case labels that occur after defaultIan Romanick2017-10-021-22/+49
| | | | | | | | | | | | Previously the instruction stream was walked looking for comparisons with case-label values. This should generate nearly identical code. For at least fs-default-notlast-fallthrough.shader_test, the code is identical. This change will make later changes possible. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl/ast: Convert ast_case_label::hir to ir_builderIan Romanick2017-10-021-24/+11
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl/ast: Use ir_binop_equal instead of ir_binop_all_equalIan Romanick2017-10-021-15/+24
| | | | | | | | | | | | | | | The values being compared are scalars, so these are the same. While I'm here, simplify the run_default condition to just deref the flag (instead of comparing a scalar bool with true). There is a bit of extra change in this patch. When constructing an ir_binop_equal ir_expression, there is an assertion that the types are the same. There is no such assertion for ir_binop_all_equal, so passing glsl_type::uint_type with glsl_type::int_type was previously fine. A bunch of the code motion is to deal with that. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl/ast: Stop processing a switch-statement after an error in the ↵Ian Romanick2017-10-021-0/+1
| | | | | | | | | | | | | | | init-expression This happens to work now because ir_binop_all_equal is used. This causes vector typed init-expressions to produce scalar Boolean values after comparison. The next commit changes ir_binop_all_equal to ir_binop_equal. Vector typed init-expressions will then produce vector Boolean values, and, in debug builds, the ir_assignment constructor will fail an assertion. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl: Don't pass NULL to ir_assignment constructor when not necessaryIan Romanick2017-10-028-35/+27
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl: Convert lower_variable_index_to_cond_assign to ir_builderIan Romanick2017-10-023-105/+65
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* glsl: Fix coding standards issues in lower_variable_index_to_cond_assignIan Romanick2017-10-021-78/+76
| | | | | | | | Mostly tabs-before-spaces, but there was some other trivium too. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* glsl: Convert lower_vec_index_to_cond_assign to using ir_builderIan Romanick2017-10-021-39/+17
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* glsl: Return ir_variable from compare_index_blockIan Romanick2017-10-023-16/+20
| | | | | | | | | This is basically a wash now, but it simplifies later patches that convert to using ir_builder. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* glsl: Fix coding standards issues in lower_vec_index_to_cond_assignIan Romanick2017-10-021-16/+12
| | | | | | | | Mostly tabs-before-spaces, but there was some other trivium too. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* glsl: Fix coding standards issues in lower_if_to_cond_assignIan Romanick2017-10-021-48/+47
| | | | | | | | Mostly tabs-before-spaces issues. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Thomas Helland <[email protected]>
* nir/spirv: Allow loop breaks in a switch body.Bas Nieuwenhuizen2017-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | Per the SPIR-V spec 2.11 Structured Control Flow: "The only blocks in a construct that can branch outside the construct are ... - a break block for the innermost loop it is inside of. ..." With "Break block: A block containing a branch to the Merge Block of a loop header's merge instruction." Note that it puts no restriction on not being in an if or switch within the innermost loop. This passes the loop_break block to the switch body so it can properly detect loop breaks. CC: <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: do not set the 'smooth' qualifier by default on ES shadersNicolai Hähnle2017-10-022-12/+16
| | | | | | | | | | | | It leads to surprising states with integer inputs and outputs on vertex processing stages (e.g. geometry stages). Instead, rely on the driver to choose smooth interpolation by default. We still allow varyings to match when one stage declares it as smooth and the other declares it without interpolation qualifiers. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* glsl/lower_instruction: handle denorms and overflow in ldexp correctlyNicolai Hähnle2017-09-291-64/+107
| | | | | | | | | | | | | GLSL ES requires both, and while GLSL explicitly doesn't require correct overflow handling, it does appear to require handling input inf/denorms correctly. Fixes dEQP-GLES31.functional.shaders.builtin_functions.precision.ldexp.* Cc: [email protected] Acked-by: Matt Turner <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* meson: Add build Intel "anv" vulkan driverDylan Baker2017-09-273-0/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows building and installing the Intel "anv" Vulkan driver using meson and ninja, the driver has been tested against the CTS and has seems to pass the same series of tests (they both segfault when the CTS tries to run wayland wsi tests). There are still a mess of TODO, XXX, and FIXME comments in here. Those are mostly for meson bugs I'm trying to fix, or for additional things to implement for other drivers/features. I have configured all intermediate libraries and optional tools to not build by default, meaning they will only be built if they're pulled in as a dependency of a target that will actually be installed) this allows us to avoid massive if chains, while ensuring that only the bits that need to be built are. v2: - enable anv, x11, and wayland by default - add configure option to disable valgrind v3: - fix typo in meson_options (Nicholas) v4: - Remove dead code (Eric) - Remove change to generator that was from v0 (Eric) - replace if chain with loop (Eric) - Fix typos (Eric) - define HAVE_DLOPEN for both libdl and builtin dl cases (Eric) v5: - rebase on util string buffer implementation Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (v4)
* glcpp: Avoid unnecessary call to strlenThomas Helland2017-09-262-9/+39
| | | | | | | | | | | | | | | | | | Length of the token was already calculated by flex and stored in yyleng, no need to implicitly call strlen() via linear_strdup(). Signed-off-by: Thomas Helland <[email protected]> Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com> V2: Also convert this pattern in glsl_lexer.ll V3: Remove a misplaced comment V4: Use a temporary char to avoid type change Remove bogus +1 on length check of identifier
* glcpp: Use string_buffer for line continuation removalThomas Helland2017-09-261-7/+18
| | | | | | | | | | | | | Migrate removal of line continuations to string_buffer. Before this it used ralloc_strncat() to append strings, which internally each time calculates strlen() of its argument. Its argument is entire shader, so it multiple time scans the whole shader text. Signed-off-by: Vladislav Egorov <[email protected]> Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com> V2: Adapt to different API of string buffer (Thomas Helland)
* glsl: Change the parser to use the string bufferThomas Helland2017-09-263-164/+78
| | | | | | | | | | | | | | | Signed-off-by: Thomas Helland <[email protected]> Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de> Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com> V2: Pointed out by Timothy - Fix pp.c reralloc size issue and comment V3 - Use vprintf instead of printf where we should - Fixes failing make-check tests V4 - Use buffer_append_char in a couple places - Use append_char in even more places
* nir: add some helpers for doing linkingTimothy Arceri2017-09-263-0/+151
| | | | | | | | | | | | | The initial helpers add support for removing unused varyings between stages. V2: - Moved the io mask helper function into this file rather than nir.h so it's not used elsewhere considering it doesn't handle all corner cases. - Use bitmask rather than hash table to handle tcs outputs (Ken) Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: mark xfb varyings as always activeTimothy Arceri2017-09-261-0/+3
| | | | | | | | This will be used by the nir linking pass so that we don't remove otherwise unused varyings. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* nir: add always_active_io to nir variableTimothy Arceri2017-09-262-0/+11
| | | | | | | | Will be used in nir link pass to decided if we can remove a varying or not. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* glsl: silence signed/unsigned comparison warningBrian Paul2017-09-211-1/+1
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl/linker: properly fix output variable overlap checkNicolai Hähnle2017-09-211-6/+12
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102904 Fixes: 15cae12804e ("glsl/linker: fix output variable overlap check") Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: merge loop_controls.cpp with loop_unroll.cppTimothy Arceri2017-09-215-128/+34
| | | | | | | Having this separate just makes the code harder to follow, and requires an extra walk of the IR. Reviewed-by: Thomas Helland <[email protected]>
* glsl: move loop analysis helpers to loop_analysis.cppTimothy Arceri2017-09-213-146/+139
| | | | Reviewed-by: Thomas Helland <[email protected]>
* spirv: Flip the tessellation winding orderJason Ekstrand2017-09-201-7/+2
| | | | | | | | It's not SPIR-V that's backwards from GLSL, it's Vulkan that's backwards from GL. Let's make NIR consistent with the source language and do the flipping inside the Vulkan driver instead. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl/linker: fix output variable overlap checkNicolai Hähnle2017-09-201-6/+11
| | | | | | | | | | | | | | | | | Prevent an overflow caused by too many output variables. To limit the scope of the issue, write to the assigned array only for the non-ES fragment shader path, which is the only place where it's needed. Since the function will bail with an error when output variables with overlapping components are found, (max # of FS outputs) * 4 is an upper limit to the space we need. Found by address sanitizer. Fixes dEQP-GLES3.functional.attribute_location.bind_aliasing.* Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Unify ir_constant::const_elements and ::componentsIan Romanick2017-09-196-113/+24
| | | | | | | | | | There was no reason to treat array types and record types differently. Unifying them saves a bunch of code and saves a few bytes in every ir_constant. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* glsl: Rename ir_constant::array_elements to ::const_elementsIan Romanick2017-09-196-22/+22
| | | | | | | | | | | The next patch will unify ::array_elements and ::components, so the name ::array_elements wouldn't be appropriate. A lot of things use the names array_elements and components, so grepping for either is pretty useless. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* glsl: Silence unused parameter warningsIan Romanick2017-09-196-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glsl/ast_type.cpp: In function ‘void merge_bindless_qualifier(YYLTYPE*, _mesa_glsl_parse_state*, const ast_type_qualifier&, const ast_type_qualifier&)’: glsl/ast_type.cpp:189:35: warning: unused parameter ‘loc’ [-Wunused-parameter] merge_bindless_qualifier(YYLTYPE *loc, ^~~ glsl/ast_type.cpp:191:52: warning: unused parameter ‘qualifier’ [-Wunused-parameter] const ast_type_qualifier &qualifier, ^~~~~~~~~ glsl/ast_type.cpp:192:52: warning: unused parameter ‘new_qualifier’ [-Wunused-parameter] const ast_type_qualifier &new_qualifier) ^~~~~~~~~~~~~ glsl/ir_constant_expression.cpp: In member function ‘virtual ir_constant* ir_rvalue::constant_expression_value(void*, hash_table*)’: glsl/ir_constant_expression.cpp:512:44: warning: unused parameter ‘mem_ctx’ [-Wunused-parameter] ir_rvalue::constant_expression_value(void *mem_ctx, struct hash_table *) ^~~~~~~ glsl/ir_constant_expression.cpp: In member function ‘virtual ir_constant* ir_texture::constant_expression_value(void*, hash_table*)’: glsl/ir_constant_expression.cpp:705:45: warning: unused parameter ‘mem_ctx’ [-Wunused-parameter] ir_texture::constant_expression_value(void *mem_ctx, struct hash_table *) ^~~~~~~ glsl/ir_constant_expression.cpp: In member function ‘virtual ir_constant* ir_assignment::constant_expression_value(void*, hash_table*)’: glsl/ir_constant_expression.cpp:851:48: warning: unused parameter ‘mem_ctx’ [-Wunused-parameter] ir_assignment::constant_expression_value(void *mem_ctx, struct hash_table *) ^~~~~~~ glsl/ir_constant_expression.cpp: In member function ‘virtual ir_constant* ir_constant::constant_expression_value(void*, hash_table*)’: glsl/ir_constant_expression.cpp:859:46: warning: unused parameter ‘mem_ctx’ [-Wunused-parameter] ir_constant::constant_expression_value(void *mem_ctx, struct hash_table *) ^~~~~~~ glsl/linker.cpp: In function ‘void link_xfb_stride_layout_qualifiers(gl_context*, gl_shader_program*, gl_linked_shader*, gl_shader**, unsigned int)’: glsl/linker.cpp:1655:60: warning: unused parameter ‘linked_shader’ [-Wunused-parameter] struct gl_linked_shader *linked_shader, ^~~~~~~~~~~~~ glsl/linker.cpp: In function ‘void link_bindless_layout_qualifiers(gl_shader_program*, gl_program*, gl_shader**, unsigned int)’: glsl/linker.cpp:1693:52: warning: unused parameter ‘gl_prog’ [-Wunused-parameter] struct gl_program *gl_prog, ^~~~~~~ glsl/lower_distance.cpp: In member function ‘virtual void {anonymous}::lower_distance_visitor_counter::handle_rvalue(ir_rvalue**)’: glsl/lower_distance.cpp:652:59: warning: unused parameter ‘rv’ [-Wunused-parameter] lower_distance_visitor_counter::handle_rvalue(ir_rvalue **rv) ^~ glsl/opt_array_splitting.cpp: In member function ‘virtual ir_visitor_status {anonymous}::ir_array_reference_visitor::visit_leave(ir_assignment*)’: glsl/opt_array_splitting.cpp:198:56: warning: unused parameter ‘ir’ [-Wunused-parameter] ir_array_reference_visitor::visit_leave(ir_assignment *ir) ^~ glsl/glsl_parser_extras.cpp: In function ‘void assign_subroutine_indexes(gl_shader*, _mesa_glsl_parse_state*)’: glsl/glsl_parser_extras.cpp:1869:45: warning: unused parameter ‘sh’ [-Wunused-parameter] assign_subroutine_indexes(struct gl_shader *sh, ^~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Elie Tournier <[email protected]>
* glsl: buffer variables can be readonly and writeonlyJuan A. Suarez Romero2017-09-191-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | In GLSL ES 3.10 session 4.9 [Memory Access Qualifiers], it has the following description: "A variable could be qualified as both readonly and writeonly, disallowing both read and write, but still be passed to imageSize() to have the size queried.". This is for image variable, but not for buffer variables. According to https://github.com/KhronosGroup/OpenGL-API/issues/7 Khronos intent is to allow both readonly and writeonly in buffer variables, and as such it will update the GLSL specification. This commit address this issue, and fixes: KHR-GL{43,44,45}.shader_storage_buffer_object.basic-readonly-writeonly KHR-GLES31.core.shader_storage_buffer_object.basic-readonly-writeonly v2: set correctly fields[i] memory flags (Samuel Pitoiset). Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: replace conditional compilation with MAYBE_UNUSEDEric Engestrom2017-09-191-3/+2
| | | | | | Suggested-by: Nicolai Hähnle <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: avoid accessing invalid memory after get_variable_being_redeclared()Iago Toral Quiroga2017-09-141-20/+19
| | | | | | | | | | | | | | After get_variable_being_redeclared() has been called, it is no longer safe to access the original variable pointer, since its memory might have been freed. Since callers of this function should only be accessing the variable pointer returned by the function, avoid potential bugs by re-assigning the original variable pointer to the result of the function call, making it impossible for the remaining code to access an invalid variable pointer. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: make the redeclared variable NULL if it is deletedIago Toral Quiroga2017-09-141-3/+6
| | | | | | | | | | | | | | get_variable_being_redeclared() can delete the original variable in a specific scenario. The code sets it to NULL after this so other code in that same function doesn't try to access trashed memory after the fact, however, the copy of that variable in the caller code won't see any of this making it very easy to overlook. Make the function a bit safer by taking a pointer to the original variable so we can also make NULL the caller's pointer to the variable if this function deletes it. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: use 'declared_var' instead of 'var' after checking redeclarationsIago Toral Quiroga2017-09-141-2/+2
| | | | | | | | | Since the original 'var' might have been deleted from this point forward. Bugzila: https://bugs.freedesktop.org/show_bug.cgi?id=102685 Fixes: 51bf007d2c27fba (glsl: Disallow unsized array of atomic_uint) Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: compile unused function outEric Engestrom2017-09-131-0/+2
| | | | | | | | | The function is only called from one place, which is hidden behind the same `#ifdef DEBUG`. Fixes: ca73c3358c91434e68ab "glsl: Mark functions static" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* util/disk_cache: turn MESA_GLSL_CACHE_DISABLE into a booleanEric Engestrom2017-09-121-2/+2
| | | | | | | | | | Instead of setting based on set/unset, allow users to use boolean values. In the docs and tests, use `DISABLE=true` instead of `DISABLE=1` as it's clearer IMO. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glsl: Disallow unsized array of atomic_uintIago Toral Quiroga2017-09-121-0/+11
| | | | | | | | | | This was a bugfix to the spec addressed in OpenGL 4.5 (revision 7 of the spec) and there is a CTS test to check this. Fixes: KHR-GL45.shader_atomic_counters.negative-unsized-array Reviewed-by: Kenneth Graunke <[email protected]>
* nir/spirv: handle if's with same label in both branchesJuan A. Suarez Romero2017-09-121-2/+10
| | | | | | | | | | | | | | When a conditional branch has the same labels in the "if" part and in the "else" part, then we have the same cfg block, and it must be handled once. v2: handle it the same way as OpBranch (Jason). Fixes: dEQP-VK.spirv_assembly.instruction.compute.conditional_branch.same_labels* dEQP-VK.spirv_assembly.instruction.graphics.conditional_branch.same_labels* Reviewed-by: Jason Ekstrand <[email protected]>
* nir/spirv: fix chain access with different index bit sizesSamuel Iglesias Gonsálvez2017-09-111-3/+8
| | | | | | | | | | | | Currently we support 32-bit indexes/offsets all over the driver, so we convert them to that bit size. Fixes dEQP-VK.spirv_assembly.instruction.*.indexing.* v2: Use u2u32 instead (Jason). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: put compact into bitfields in nir_variable_dataDave Airlie2017-09-071-1/+1
| | | | | | | | | | This being declared bool means it won't get merged with the previous bitfields, this seems like an oversight rather than deliberate. Noticed when running pahole. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* spirv: Add support for the HelperInvocation builtinJason Ekstrand2017-09-051-1/+4
| | | | | | | | I have no idea how this got missed but it's been missing since forever. Cc: [email protected] Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: define YY_NO_INPUT to prevent unused symbol warningsMatt Turner2017-08-291-0/+1
| | | | | | | | | | | | Otherwise clang warns: glsl/glsl_lexer.cpp:3507:16: warning: function 'yyinput' is not needed and will not be emitted [-Wunneeded-internal-declaration] static int yyinput (yyscan_t yyscanner) ^ Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* nir: Remove series of unnecessary conversionsMatt Turner2017-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | Clang warns: warning: absolute value function 'fabsf' given an argument of type 'const float64_t' (aka 'const double') but has parameter of type 'float' which may cause truncation of value [-Wabsolute-value] float64_t dst = bit_size == 64 ? fabs(src0) : fabsf(src0); The type of the ternary expression will be the common type of fabs() and fabsf(): double. So fabsf(src0) will be implicitly converted to double. We may as well just convert src0 to double before a call to fabs() and remove the needless complexity, à la float64_t dst = fabs(src0); Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* nir/spirv: Use unreachable("...") rather than assert(!"...")Matt Turner2017-08-292-13/+13
| | | | | | | | Quiets a number of uninitialized variable warnings in clang. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>