summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* freedreno/a5xx: fix missing restore stateRob Clark2017-10-021-0/+3
| | | | | | | | RB_CLEAR_CNTL seems to be in a funny state after boot (at least on 8x96/a530). Cc: 17.2 <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* radv: make radv_dynamic_state_copy() staticSamuel Pitoiset2017-10-022-5/+1
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* wayland-egl: rework and simplify wl_egl_window initializationEmil Velikov2017-10-021-10/+16
| | | | | | | | | | | | | | | Use calloc instead of malloc + explicitly zeroing the different fields. We need special handling for the version field which is of type const intptr_t. As we're here document why keeping the constness is a good idea. The wl_egl_window_resize() call is replaced with an explicit set of the width/height. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: move WL_EGL_EXPORT declaration to where it's usedEmil Velikov2017-10-022-7/+7
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: use C99 commentsEmil Velikov2017-10-021-3/+3
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: remove no longer needed wayland-client dependencyEmil Velikov2017-10-023-4/+1
| | | | | | | | | Was required for wl_surface, which is opaque and forward declared with earlier patch. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: add stdint.h include for intptr_tEmil Velikov2017-10-021-0/+1
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: forward declare struct wl_surfaceEmil Velikov2017-10-021-0/+2
| | | | | | | | | It makes the header self-contained and with later commit we'll remove the unnecessary wayland-client.h include. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* wayland-egl: rename wayland-egl-{priv,backend}.hEmil Velikov2017-10-025-5/+5
| | | | | | | | In preparation to lifting the whole thing out as a separate library. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Miguel A. Vico <[email protected]>
* egl/dri: link directly to libglapi.soEmil Velikov2017-10-025-40/+10
| | | | | | | | | | | | | | | | | | | | | | | Shared glapi (libglapi.so) has been a requirement for years, in order to build EGL. Remove the no longer necessary dlopen/dlsym dance and link to the library directly. This allows us to remove a handful of platform specific workarounds, due to the different name of the library. v2: - Android: export the include dir (RobH) - Drop unused local variable (Eric) Cc: Jonathan Gray <[email protected]> Cc: Jon Turney <[email protected]> Cc: Julien Isorce <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1) Tested-by: Tomasz Figa <[email protected]> (v1) Tested-by: Rob Herring <[email protected]>
* swr/rast: do not crash on NULL strings returned by getenvEmil Velikov2017-10-021-1/+2
| | | | | | | | | | | | | | | | | | | | The current convenience function GetEnv feeds the results of getenv directly into std::string(). That is a bad idea, since the variable may be unset, thus we feed NULL into the C++ construct. The latter of which is not allowed and leads to a crash. v2: Better variable name, implicit char* -> std::string conversion (Eric) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101832 Fixes: a25093de718 ("swr/rast: Implement JIT shader caching to disk") Cc: Tim Rowley <[email protected]> Cc: Laurent Carlier <[email protected]> Cc: Bernhard Rosenkraenzer <[email protected]> [Emil Velikov: make an actual commit from the misc diff] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Laurent Carlier <[email protected]> (v1)
* freedreno/a5xx: align height to GMEMRob Clark2017-10-021-1/+5
| | | | | | | | | | | | | | | | | Similar to the way width/pitch alignment works, it seems like we need to do similar for height. Otherwise the BLIT from system memory to GMEM can over-fetch beyond the end of the buffer, triggering a fault. I'm not sure if there is a better solution yet. Possibly we could fall back to pre-a5xx style DRAW packets for cases where BLIT might over- fetch. (We in theory have that problem already with rendering to higher mipmap levels, although fortunately those tend to use GMEM bypass.) This fixes issues reported with glamor. Reported-by: [email protected] Cc: 17.2 <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* radeonsi: adjust clip discard based on line width / point sizeNicolai Hähnle2017-10-023-11/+27
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: remove si_context::{scissor_enabled,clip_halfz}Nicolai Hähnle2017-10-023-26/+24
| | | | | | They are just copies of the rasterizer state. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: simplify the signature of si_update_vs_writes_viewport_indexNicolai Hähnle2017-10-023-7/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: move current_rast_prim into si_contextNicolai Hähnle2017-10-026-15/+11
| | | | | | v2: rebase fixes Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: move and rename scissor and viewport state and functionsNicolai Hähnle2017-10-0210-182/+184
| | | | | | v2: change GET_MAX_SCISSOR to SI_MAX_SCISSOR Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: remove si_apply_scissor_bug_workaroundNicolai Hähnle2017-10-022-19/+0
| | | | | | It only affects pre-SI chips. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: move r600_viewport.c to si_viewport.cNicolai Hähnle2017-10-023-2/+2
| | | | | | | This is purely a file-move + #include fixup + build system changes. Other cleanups will follow in subsequent commits. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: fix maximum advertised point size / line widthNicolai Hähnle2017-10-022-8/+3
| | | | | | | | | | The hardware registers store the half-size/width in 12.4 fixed point format, so 8192 is the maximum. Fixes dEQP-GLES3.functional.rasterization.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: deduce rast_prim correctly for tessellation point modeNicolai Hähnle2017-10-021-3/+6
| | | | | | | | Together with the previous patches, this fixes dEQP-GLES31.functional.primitive_bounding_box.wide_points.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: don't discard points and linesNicolai Hähnle2017-10-022-2/+26
| | | | | | | | | This is a bit conservative, but a more precise solution requires access to the rasterizer state. This is something to tackle after the fork between r600 and radeonsi. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: move current_rast_prim to r600_common_contextNicolai Hähnle2017-10-025-9/+13
| | | | | | | | | | We'll use it in the scissors / clip / guardband state. v2: avoid a performance regression on r600 when applied to (pre-fork) stable branches Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: use R10G10B10X2 format where applicableNicolai Hähnle2017-10-021-3/+8
| | | | | | | | This is the last step of fixing dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev for radeonsi. Reviewed-by: Marek Olšák <[email protected]>
* gallium: add PIPE_FORMAT_R10G10B10X2_UNORMNicolai Hähnle2017-10-024-0/+10
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: R10G10B10_(A2) formats are not color renderable in ESNicolai Hähnle2017-10-021-2/+5
| | | | | | | | | | | | | The EXT_texture_type_2_10_10_10_REV (ES only) states the following issue: "1. Should textures specified with this type be renderable? UNRESOLVED: No. A separate extension could provide this functionality." This partially fixes dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.{rgb,rgba}_unsigned_int_2_10_10_10_rev Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: select the R10G10B10X2_UNORM internal format based on data typeNicolai Hähnle2017-10-021-1/+3
| | | | | | | ES requires it. This is a partial fix for dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev Reviewed-by: Marek Olšák <[email protected]>
* glsl: do not set the 'smooth' qualifier by default on ES shadersNicolai Hähnle2017-10-023-13/+23
| | | | | | | | | | | | 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]>
* freedreno: fix PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVERob Clark2017-10-022-4/+5
| | | | | | | | Fixes an assert in fd_acc_query_register_provider() about query provider not already registered. Fixes: 3f6b3d9d ("gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE") Signed-off-by: Rob Clark <[email protected]>
* egl/wayland: simplify LIBGL_ALWAYS_SOFTWARE logicEric Engestrom2017-10-021-8/+4
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radeonsi: fix a regression in integer cube map handlingNicolai Hähnle2017-10-021-8/+26
| | | | | | | | | | | | A recent commit fixed the case of 8888 integer cube maps, which need the workaround of replacing the data format with USCALED/SSCALED. However, this broke the case of non-8888 integer cube maps; those still need the fix of shifting the texture coordinates. Fixes KHR-GL45.texture_gather.plain-gather-int-cube-array and similar. Fixes: 6fb0c1013b35 ("radeonsi: workaround for gather4 on integer cube maps") Reviewed-by: Marek Olšák <[email protected]>
* amd/common: move ac_build_phi from radeonsiNicolai Hähnle2017-10-023-17/+22
| | | | Reviewed-by: Marek Olšák <[email protected]>
* radv: remove unused radv_meta_state::btoi::render_pass handleSamuel Pitoiset2017-10-021-1/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: do not check the number of levels when doing fast htileSamuel Pitoiset2017-10-021-3/+0
| | | | | | | | We shouldn't reach this point because HTILE is only enabled when the number of levels is 1. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: cleanup radv_device_finish_meta_XXX() helpersSamuel Pitoiset2017-10-028-219/+136
| | | | | | | Unnecessary to double check that handles are not NULL. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: select the pipeline outside of emit_fast_clear_flush()Samuel Pitoiset2017-10-021-12/+11
| | | | | | | It can't change during the decompression pass. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>