Commit graph

32478 commits

Author SHA1 Message Date
Daniel Bertalan
162606f358 Toolchain+CI: Link LLVM with LLD if available
According to most benchmarks, LLD is faster than GNU ld and the macOS
linker, so let's use it if possible in order to speed up the toolchain
build.
2022-01-10 09:55:45 +03:30
Daniel Bertalan
d21c38a72d CI: Hash only relevant files for the key of the compiler cache
In the last few commits, a second patch was added to the LLVM toolchain,
and it no longer uses our binutils patch. This commit changes the CI
cache keys accordingly, in order to prevent unnecessary rebuilds of both
toolchains when only one is changed.

The Clang toolchain's cache now only takes into account patches that
begin with `llvm`, and the GNU toolchain excludes those from the hash
calculation. We now also hash the two CMake cache files that we use for
building LLVM and its runtime libraries.
2022-01-10 09:55:45 +03:30
Daniel Bertalan
43008267b2 Toolchain: Do not overwrite libraries with stubs when rebuilding LLVM
We erroneously appended ".so" after the base name for the library,
so we ended up checking for the existence of e.g. `libc.so.so`,
which obviously didn't exist, so we overwrote the existing libraries
when we rebuilt the toolchain.
2022-01-10 09:55:45 +03:30
Daniel Bertalan
b3dbf204fc Toolchain: Don't use GNU objcopy in the LLVM toolchain
Our build of LLVM's objcopy now supports the single missing feature
(--update-section) that previously forced us to use the one from GNU
Binutils. This means that there is no reason anymore to build Binutils
alongside LLVM's tools.
2022-01-10 09:55:45 +03:30
Daniel Bertalan
b19cc3cdcb Toolchain: Backport --update-section support to llvm-objcopy
This commit backports the LLVM commit that adds support for the
`--update-section` flag to llvm-objcopy. We use this feature of GNU
objcopy to embed the symbol map in the kernel.

The corresponding LLVM Phabricator Differential Revision can be found
here: https://reviews.llvm.org/D112116

This patch is identical to the upstream commit, except for two hunks
that had to be changed as they didn't apply cleanly.
2022-01-10 09:55:45 +03:30
Rafał Babiarz
3132ce1d36 LibGUI: Show hours and minutes in "unsaved changes" dialogs 2022-01-09 20:25:48 -08:00
Rafał Babiarz
0012c03eb5 AK: Added human_readable_time() method for "unsaved changes" dialogs 2022-01-09 20:25:48 -08:00
Pankaj Raghav
9ae2285675 Kernel: Make enumerate_disk_partitions function not const
The enumerate_disk_partitions function doesn't need to be const. Remove
the constness and use the newly added `add_partition` function.
2022-01-09 20:18:37 -08:00
Pankaj Raghav
2c810332b6 Kernel: Add add_partition function
Until now partitions were added directly by accessing the private member
of the StorageDevice class.

Add a new member function to add partition.
2022-01-09 20:18:37 -08:00
electrikmilk
794e82016e Base: Complete Greek & Coptic, and Cyrillic
Add the rest of the Greek & Coptic, and Cyrillic characters.
2022-01-09 19:17:19 -08:00
electrikmilk
faef6cc82c Base: Fix non fixed-width in Cathode
Fix letters that aren't fixed-width (i, I, l)
2022-01-10 00:32:37 +01:00
Andrew Kaster
da00ccb26a Ports: Add "-ldl" as CMAKE_DL_LIBS in CMake platform patch 2022-01-09 23:32:03 +01:00
Andrew Kaster
d8110e3bac Ports: Add ccache port to make compiling on Serenity more fun :^) 2022-01-09 23:32:03 +01:00
Andrew Kaster
12c352dfc9 Ports: Convert curl port to use CMake, remove two autoconf patches
This removes the shlib hack from the install step, which repackaged the
static library as the shared one. It also has the benefit of making the
port work with the Clang toolchain :^).
2022-01-09 23:32:03 +01:00
electrikmilk
64c546b909 Base: Monospace font
Add default monospace style font for code editing.
2022-01-09 14:23:14 -08:00
Jelle Raaijmakers
1d627f1b2c Ports: Patch out SDL timer lock from ScummVM
This change is backported from upstream master and prevents unnecessary
spam to our debug console about NULL mutexes.
2022-01-09 23:23:01 +01:00
Jelle Raaijmakers
3ce1118af1 Ports: Compile ScummVM with OpenGL support
By default, ScummVM will still run in software rendering mode, but the
options to enable OpenGL will become available.
2022-01-09 23:23:01 +01:00
Jelle Raaijmakers
57b1dcbec9 LibGL: Add stub for glColorMaterial 2022-01-09 23:23:01 +01:00
Jelle Raaijmakers
6e64ad829a Ports: Update ScummVM to version 2.5.1 2022-01-09 23:23:01 +01:00
Jelle Raaijmakers
7ad18e91e2 LibGL: Add capabilities to context parameters
Context parameters are LibGL's way of centrally defining all parameters
that can be retrieved through `glGetBoolean*`, `glGetInteger*`, etc.
The spec describes that capabilities such as `GL_LIGHTING` can also be
retrieved through these methods, but it should not be possible to
retrieve random boolean parameters through `glIsEnabled`. For example,
`GL_UNPACK_LSB_FIRST` can only be retrieved through `glGet*`.

This moves reading of capabilities to `::get_context_parameter` and
implements its use in `::gl_is_enabled`.
2022-01-09 23:21:03 +01:00
Linus Groh
09a11fa6ea LibJS: Implement proper Iterator records
Instead of using plain objects as Iterator records, causes confusion
about the object itself actually being its [[Iterator]] slot, and
requires non-standard type conversion shenanigans fpr the [[NextValue]]
and [[Done]] internal slots,  implement a proper Iterator record struct
and use it throughout.

Also annotate the remaining Iterator AOs with spec comments while we're
here.
2022-01-09 22:02:43 +01:00
Linus Groh
e141f1e976 LibJS: Use Optional<Value> for potentially missing value in Iterator AOs
Given we're already moving away from using the empty Value elsewhere,
and I'm about to update most of this code, let's do this small tweak
now.
2022-01-09 22:02:43 +01:00
Stephan Unverwerth
f9c5c120f6 AK/SIMD: Suppress psabi warnings and add explanatory comment 2022-01-09 21:03:08 +01:00
Daniel Bertalan
4a428ba252 Meta: Do not allow undefined symbols in executables and shared objects
The `--allow-shlib-undefined` option is a bit of a misnomer. It actually
controls whether we should be allowed to have undefined references after
symbols from all dependencies have been resolved, so it applies both to
shared libraries and executables.

LLD defaults to allowing undefined references in shared libraries, but
not in executables. Previously, we had to disable this check for
executables too, as it caused a build failure due to the
LibC-LibPthread-libc++ and the LibCore-LibCrypto circular dependencies.

Now that those have been resolved, we can enable this warning, in the
hopes that it will prevent us from introducing circular libraries and
missing dependencies that might cause unexpected breakage.
2022-01-09 20:40:22 +01:00
Daniel Bertalan
e1eefe2b52 LibCrypto: Link against LibCore
The ASN1 parser calls `LibCore::DateTime::create` and
`LibCore::DateTime::now`.
2022-01-09 20:40:22 +01:00
Glenford Williams
f5ff011c1b Spreadsheet: Properly pass parent window to Workbook
Change the parent of the WizardDialog to that of the Spreadsheet window.
Previously the WizardDialog was using the open file dialog as the
parent resulting in the csv import dialog
2022-01-09 20:38:55 +01:00
Marcus Nilsson
876424923a PixelPaint: Verify that we have an ImageEditor instead of returning
We should never be in a state where an action requiring an ImageEditor
is enabled if all tabs are closed.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
ae958d97b2 PixelPaint: Disable actions when no ImageEditor is open
Disable all actions when the last tab is closed and enable them when a
new ImageEditor is created.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
708ec90bba LibGUI: Add Menu::set_children_actions_enabled() helper
This adds a helper function to Menu that allows us to set all the
children enabled/disabled.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
18e6da6d4d PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidget
Using a WeakPtr to keep a reference to the active layer caused it to
be destroyed when the last tab was closed, which made the
m_layer == layer check in set_layer() return early since it was
already null. Because of this the LayerPropertiesWidget was never
disabled.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
7ca4d045bd PixelPaint: Make PaletteWidget::set_image_editor take a ImageEditor*
After closing the last open ImageEditor, selecting a color would try to
dereference it causing a crash. Instead make set_image_editor() take a
pointer to it and set it to nullptr when closing the last tab like we
do with LayerListWidget and LayerPropertiesWidget.
2022-01-09 20:24:02 +01:00
Jelle Raaijmakers
29bbf56286 LibGL+LibSoftGPU: Implement viewport support
This implements the `glViewport` API call, the coordinate
transformation and the `GL_VIEWPORT` context parameter.
2022-01-09 20:22:32 +01:00
Jelle Raaijmakers
d236b0ed12 LibSoftGPU: Rename window coordinate transformation function
The name `scissor_box_to_window_coordinates` was wildy inaccurate since
we are actually transforming window coordinates into whatever the
coordinate space of the backing bitmap is.
2022-01-09 20:22:32 +01:00
sholm
d54a3f4520 Help: Scroll to the top of page when opening a new link
Previously the scroll position would not reset when loading a new
page. This caused various problems such as opening the page at the
previous pages scroll position and in some instances not even
showing the new page at all.
2022-01-09 20:21:02 +01:00
Jelle Raaijmakers
864f842dfe Kernel: Page-align AC'97 audio buffer descriptor list
This was broken in commit 0a1b34c753 / PR #11687 since the buffer
descriptor list size was not page-aligned, and the new
`MM.allocate_dma_buffer_pages` expects a page-aligned size.
2022-01-09 19:11:29 +02:00
Daniel Bertalan
20e29c403e Toolchain: Fix macOS build failure due to a malformed patch
Discord user aesophor pointed out that the GCC toolchain fails to build
on macOS, and traced the issue back to 41ea37f2, which is the latest
change to `gcc.patch`. Similarly, when I tried to run BuildIt.sh in the
`--dev` mode, `git apply` complained about the patch being malformed.

I regenerated the patch by manually applying the changes of 41ea37f2 on
top of a known good GCC source tree, and I sent the new file to them.
They reported that this fixed the build issue they were having.
2022-01-09 14:15:24 +01:00
Stephan Unverwerth
d45931b423 LibSoftGPU: Take sample from pixel center
This adds a half pixel offset to the edge value calculation in order to
sample the triangle at pixel centers. This is in line with actual OpenGL
rasterization rules and generates correctly interpolated vertex
attributes including texture coordinates.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
5028b53b49 LibSoftGPU: Make divide-by-zero guard more explicit in stats overlay
This previously assigned 1 to any divisor that was 0 which was a bit
confusing
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
57215d0e1f LibSoftGPU: Allow arbitrary render target sizes
With the RASTERIZER_BLOCK_SIZE gone we can now render to any size, even
odd ones. We have to be careful to not generate out of bounds accesses
when calculating the render target and depth buffer pointers. Thus we
check the coverage mask and generate nullptrs for pixels that will not
be updated. This also masks out pixels that would touch the triangle but
are outside the render target/scissor rect bounds.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
21cad22535 LibSoftGPU: Also interpolate normal during triangle clipping 2022-01-09 16:21:13 +03:30
Stephan Unverwerth
941e9d9922 LibSoftGPU: Move alpha test into separate function 2022-01-09 16:21:13 +03:30
Stephan Unverwerth
68a1727547 LibSoftGPU: Move alpha blend factor setup out of triangle rasterization
Since the alpha blend configuration should not change between most calls
of draw_primitives it makes no sense to reinitialize the blend factors
for every rasterized triangle.
The alpha blend factors are now set up whenever the device config
changes. The blend factors are stored in struct AlphaBlendFactors.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
b4a18eaaf0 LibSoftGPU: Make rasterization and shading member functions of Device
This adds member functions Device::rasterize_triangle() and
Device::shade_fragments(). They were free standing functions/lambdas
previously which led to a lot of parameters being passed around.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
d89c515609 LibSoftGPU: Vectorize color conversion from/to framebuffer
Functions to_rgba32 and to_vec4 now process 4 color values at the same
time.

Co-authored-by: Jesse Buhagiar <jooster669@gmail.com>
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
66cf2ea240 LibSoftGPU: Only interpolate fog values if fog is enabled 2022-01-09 16:21:13 +03:30
Stephan Unverwerth
f510a3cd8f LibSoftGPU: Add SIMD utilization counter to debug overlay
This adds a counter to the debug overlay that displays the average
percentage of SIMD lane utilization.

This number represents the number of pixels that were output for each
quad. A utilization of 100% means that all 4 SIMD lanes were used and
no pixels were masked out before being written to the color buffer.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
b8e06ca757 LibSoftGPU: Vectorize the rest of the rasterizer pipeline 2022-01-09 16:21:13 +03:30
Stephan Unverwerth
6f261d0362 LibSoftGPU: Use bitwise and instead of modulus operator for POT textures
Where possible the sampler will wrap texture coordinates using a bitwise
and instead of a modulus. This speeds up the calculation quite a bit.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth
034dc480d2 LibSoftGPU: Vectorize texture sampling and shading 2022-01-09 16:21:13 +03:30
Stephan Unverwerth
444a15bad3 AK: Add SIMDMath.h with vectorized version of math functions 2022-01-09 16:21:13 +03:30