Commit graph

44652 commits

Author SHA1 Message Date
Stephan Unverwerth c25359df47 LibSoftGPU: Delegate shader creation to new class ShaderCompiler 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 5bab17596d LibGLSL: Fill LinkedShaders with dummy IR code 2022-12-17 22:39:09 -07:00
Stephan Unverwerth c88bc74afd LibGPU: Add inputs and outputs to GPU shader IR 2022-12-17 22:39:09 -07:00
Stephan Unverwerth b18bf702ea LibSoftGPU: Implement shader processor for SoftGPU ISA
This adds a shader processor that executes our ISA when a fragment
shader is currently bound to the device.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 1e548a84d6 LibSoftGPU: Define a simple shader instruction set
This adds a simple instruction set with basic operations and adds an
instruction list to the shader class.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth bb28492af0 LibSoftGPU: Make output in PixelQuad generic
Same as with inputs, we define outputs as a generic array of floats.
This can later be expanded to accomodate multiple render targets or
vertex attributes in the case of a vertex shader.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth c008b6ce18 LibSoftGPU: Make input in PixelQuad generic
Previously we would store vertex color and texture coordinates in
separate fields in PixelQuad. To make them accessible from shaders we
need to store them as a completely generic array of floats.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 49139d5f4e LibSoftGPU: Allow binding a fragment shader 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 93ab2db80f LibGL+LibSoftGPU: Add GPU side shader infrastructure
This adds a shader class to LibSoftGPU and makes use of it when linking
GLSL program in LibGL. Also adds actual rendering code to the shader
tests.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 4ad41e6680 LibGL: Use LibGLSL to compile shaders 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 67b2f8d68d LibGLSL: Add LibGLSL
This adds a new library, LibGLSL for parsing and compiling GLSL programs
to LibGPU IR. Currently the compiler consists only of stubs.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 5f0eb812ac LibGPU: Add basic shader IR
This adds a header to LibGPU with a basic IR for vertex and fragment
shaders.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 1b7b6e6c91 LibGL: Implement glGetProgramiv 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 424e0a2792 LibGL: Implement glGetShaderiv 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 69171e7a05 LibGL: Implement glUseProgram 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 1812a169b8 Tests: Add tests for LibGL shader subsystem 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 848f1d2689 LibGL: Make shader compilation and program linking always succeed
This will help with testing until the actual compilation infrastructure
is in place.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth fdd76639d8 LibGL: Implement glLinkProgram 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 7f062e35a4 LibGL: Implement glAttachShader 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 42ef5c9e12 LibGL: Implement glCompileShader 2022-12-17 22:39:09 -07:00
Stephan Unverwerth d5277ecdfe LibGL: Implement glShaderSource 2022-12-17 22:39:09 -07:00
Stephan Unverwerth 962d088e4e LibGL: Implement glCreateProgram and glDeleteProgram 2022-12-17 22:39:09 -07:00
Stephan Unverwerth a0adbfbf81 LibGL: Implement glCreateShader and glDeleteShader 2022-12-17 22:39:09 -07:00
Stephan Unverwerth b975569a40 LibGL: Add Shader and Program class stubs 2022-12-17 22:39:09 -07:00
Stephan Unverwerth cd7d2c3446 LibGL: Remove Texture note leftovers from the NameAllocator class
The NameAllocator class is not only about Textures, so let's change a
comment being related to it.
2022-12-17 22:39:09 -07:00
Stephan Unverwerth 4568dcbb55 LibGL: Add stubs for shader and program related functions 2022-12-17 22:39:09 -07:00
Andrew Kaster 75495a5d65 Documentation: Explain CMake 3.25.x requirement 2022-12-17 22:21:43 -07:00
Andrew Kaster 75f7a164a6 Documentation: Clarify that clang can be used as a host compiler 2022-12-17 22:21:43 -07:00
Andrew Kaster 37517ba8bb Meta: Prefer clang as a host compiler to gcc 2022-12-17 22:21:43 -07:00
Andrew Kaster d2e4565f72 Meta: Allow building with Apple clang 14.x
We previously disregarded Apple clang entirely, since no released
version was able to succesfully build Lagom. Xcode 14 seems to have
all the features we need, as we haven't added any code that needs
trunk clang features in quite a while.
2022-12-17 22:21:43 -07:00
EWouters 74927ac76d Meta: Fix mke2fs on MacOS
Use `Meta/.shell_include.sh` to find the `mke2fs` executable.
2022-12-17 16:12:48 -07:00
Lenny Maiorani f2336d0144 AK+Everywhere: Move custom deleter capability to OwnPtr
`OwnPtrWithCustomDeleter` was a decorator which provided the ability
to add a custom deleter to `OwnPtr` by wrapping and taking the deleter
as a run-time argument to the constructor. This solution means that no
additional space is needed for the `OwnPtr` because it doesn't need to
store a pointer to the deleter, but comes at the cost of having an
extra type that stores a pointer for every instance.

This logic is moved directly into `OwnPtr` by adding a template
argument that is defaulted to the default deleter for the type. This
means that the type itself stores the pointer to the deleter instead
of every instance and adds some type safety by encoding the deleter in
the type itself instead of taking a run-time argument.
2022-12-17 16:00:08 -05:00
Tim Ledbetter 53133b4359 PixelPaint: Debounce ImageEditor on_modified_change event
This limits the frequency of updates performed by the histogram and
vectorscope widgets.
2022-12-17 19:52:11 +00:00
Tim Ledbetter 7e020154a5 PixelPaint: Improve guide tool performance for large images
This commit ensures that the vectorscope and histogram widgets are not
updated while moving a guide with the guide tool. This significantly
improves performance for large images.
2022-12-17 19:52:11 +00:00
Keir Davis 4a0af3dc77 SystemMonitor: Propagate errors when trying to load an icon 2022-12-17 19:20:21 +00:00
Rodrigo Tobar d116b9a8c6 PDFViewer: Move to page when outline item is selected 2022-12-17 19:40:52 +01:00
Rodrigo Tobar d739877807 PDFViewer: Inform about selections on Outline view
Selecting an Outline Item from the Outline view informs via callback the
corresponding Destination that has been selected. This will be used to
move the application to the corresponding page/section/etc.
2022-12-17 19:40:52 +01:00
Rodrigo Tobar aaa210e6db PDFViewer: Show page numbers in Outline TreeView
This is a nice addition to the outline view, which previously simply
displayed the titles of each section. Pages are shown in the first
column, but the tree is expanded via the second column, where the title
is.
2022-12-17 19:40:52 +01:00
Rodrigo Tobar c76564b533 PDFViewer: Fix parent_index() implementation in OutlineModel
The previous implementation had some repeated code, and wasn't really
working (because the OutlineItem.parent member was never populated). In
fact, when navigating with the up/down arrows in the associted TreeView
one could experience some funky behavior.

Now that we store OutlineItem's parents, we are fixing the
implementation for parent_index(), which was comparing the parent
siblings against the item's outline item instead of to its parent.
2022-12-17 19:40:52 +01:00
Rodrigo Tobar 6df9aa8f2c LibPDF: Store page number, not Value, in OutlineItem
The Value previously stored corresponded to a Reference to a Page object
in the PDF document. This isn't useful information, since what we want
to display at the end of the day is the page an outline item refers to.

This commit changes the page member on OutlineItem to be a Optional<u32>
(some destinations don't necessarily refer to a Page), which we resolve
while building OutlineItems.
2022-12-17 19:40:52 +01:00
Rodrigo Tobar 3db6af6360 LibPDF: Keep track of OutlineItem parents
While OutlineItem had a parent field, it was never populated nor used.
This commit populates it when possible (no parent means the OutlineItem
is a top-level item).
2022-12-17 19:40:52 +01:00
Rodrigo Tobar 2ea8d2547e PDFViewer: Propagate errors from OutlineModel construction
This follows the same idea that Andreas was doing in this latest videos,
where construction-time TRY()s were not present but should have been.
Like Andreas did, moving the initialisation of such fields to the
factory function, which then returns ErrorOr solves the issue.
2022-12-17 19:40:52 +01:00
Rodrigo Tobar cb2cf6de99 PDFViewer: Perform standard error handling when opening files
The previous implementation of open_file had a lambda that was used to
inspect the call of ErrorOr-returning calls. This was a non-standard way
of doing this though, as the more usual and clearer way is to have an
inner function that returns ErrorOr, then handle any incoming errors on
the top level function.

This commit adds a try_open_file function, where all the logic occurs,
and all the failure-producing steps are simplied TRY'ed. The top level
open_file function takes that result and does what the lambda previously
did: showing a message box with the actual error.
2022-12-17 19:40:52 +01:00
Karol Kosek 5049b103c0 PixelPaint: Encode layers in PixelPaint project files as PNG
Previously layers weren't compressed at all and the file size could go
up really fast in a project with multiple layers.  By switching to PNG,
the situation is slightly better now.

Interestingly enough, this change won't break compatibility with old
files, as PixelPaint loads layers using ImageDecoder which will try
every codec possible. :^)
2022-12-17 18:37:04 +01:00
Karol Kosek 11377bf0f8 PixelPaint: Propagate more errors when saving a project file 2022-12-17 18:37:04 +01:00
Quentin Ligier 588994bb00 LibWeb: Improve variable name in HTMLTableElement
The variables 'child_to_append_after' are used to specify the child
before which new elements will be inserted, its name is misleading.
These variables are always passed as 'child' to pre_insert.
2022-12-17 18:35:32 +01:00
Baitinq 0f2ca95b5e Kernel: Propagate errors in E1000NetworkAdapter
We now move the ErrorOr returning functions in the constructor to the
try_to_initialize() factory,  which allows us to handle the errors and
removes two FIXME's :))
2022-12-17 18:34:57 +01:00
Lenny Maiorani 5875e66531 Tests: ASCII-betical-ize CMakeLists AK tests 2022-12-17 18:32:26 +01:00
Alexander Narsudinov 45525d4f85 LibWeb: Add NamedNodeMap::setNamedItemNS() method
This patch adds implementation of the missing `setNamedItemNS()` method.
2022-12-17 18:27:57 +01:00
Alexander Narsudinov 530d5adc62 LibWeb: Add NamedNodeMap::removeNamedItemNS() method
This patch adds implementation of the missing `removeNamedItemNS()`
method.
2022-12-17 18:27:57 +01:00