Commit graph

32460 commits

Author SHA1 Message Date
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
Stephan Unverwerth 178a57bbf7 LibSoftGPU: Add PixelQuad struct that holds data for each rendered quad 2022-01-09 16:21:13 +03:30
Stephan Unverwerth b07bb85700 LibGfx: Allow Vector{2,3,4} operators to accept different argument types
This is needed to e.g. multiply a Vector4<f32x4> by a float.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth 486d2d099c LibSoftGPU: Add SIMD.h with SoftGPU specific SIMD functions
Adds functions to expand Vector{2,3,4} to their SIMD equivalent.
2022-01-09 16:21:13 +03:30
Stephan Unverwerth 7adcdecc7b AK: Add SIMDExtras.h with SIMD related functions
Adds a header to AK with helper functions for writing vectorized code.

Co-authored-by: Hendiadyoin <leon2002.la@gmail.com>
2022-01-09 16:21:13 +03:30
anarchyrucks 75e31a4749 Base: Add uniq(1) manpage 2022-01-09 04:27:26 -08:00
Federico Guerinoni 9aa556fdf0 Userland: Port wasm to LibMain 2022-01-09 04:26:16 -08:00
Federico Guerinoni 05f0f70b00 Userland: Port tac to LibMain 2022-01-09 04:26:16 -08:00
Mustafa Quraish 0e6576b376 PixelPaint: Move out common logic from Filters into base class
Now, each new filter only has to describe how to actually change
the bitmaps, and the common logic of pulling out the bitmap from the
layer, and marking the action as done, etc is all handled in the
`Filter` base class.

This also makes it possible to apply filters to external bitmaps,
which are not embedded in a `Layer` (which we can use to preview
filters in the future!)
2022-01-09 12:26:07 +01:00
Ali Mohammad Pur 5c0c126122 Shell: Add a "noop" builtin aliased to ":"
POSIX comes up with such silly names sometimes...
This builtin does nothing. at all.
2022-01-09 12:25:36 +01:00
Ali Mohammad Pur 6a245de911 Shell: Refresh PATH cache after 'unset PATH'
Note that `execvp` has a default value for PATH (both on Serenity and on
Linux) and so this does not 'fix' #11608.
2022-01-09 12:25:36 +01:00
Ali Mohammad Pur 310a18da1e Shell: Don't reset 'last_return_code' before running commands
Some variables depend on its value to function correctly.
Fixes the following issue:
    $ false; echo $?
    1
    $ false
    $ echo $?
    128
2022-01-09 12:25:36 +01:00
serenityosrocks 689fe7ddff Meta: Make "Meta/serenity.sh run aarch64" work on macOS 2022-01-09 12:25:23 +01:00
Brian Gianforcaro ccbc3f8975 Kernel: Harden Socket::pseudo_path(..) implementations against OOM
Use the try variants of AK::StringBuilder append APIs to harden these
functions against OOM.
2022-01-09 12:22:52 +01:00
Ali Mohammad Pur ea66750640 Shell: Make interrupts kill the whole chain and not just the current job
This makes interrupting `sleep 10; echo hi` not print `hi` anymore,
which is the expected behaviour anyway.
Also fixes the problem with fast-running loops "eating" interrupts and
not quitting.
2022-01-09 11:16:17 +03:30
Junior Rantila abaee3a325 beep: Port to LibMain :^) 2022-01-09 11:16:00 +03:30
Junior Rantila 7801e38af1 LibCore: Add beep wrapper 2022-01-09 11:16:00 +03:30
Brian Gianforcaro c6f745de27 LibPthread: Validate the clock argument in pthread_condattr_setclock 2022-01-09 11:15:06 +03:30
Brian Gianforcaro 84962fcc9b LibPthread: Implement pthread_condattr_getclock
I noticed this was missing while adding spec comments a bit ago.
It's small and easy enough to implement, might as well make us
more POSIX compliant.
2022-01-09 11:15:06 +03:30