summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* vulkan: Update texture shader to do AABenjamin Otte2023-05-172-20/+13
|
* vulkan: Split generic code offBenjamin Otte2023-05-173-14/+39
| | | | No need to duplicate code in shaders when it can be shared.
* vulkan: Use rounded rect APIs to improve clipsBenjamin Otte2023-05-171-34/+34
| | | | | There are a bunch of intersection APIs available these days. Let's use them.
* gsk: Add (private) gsk_rounded_rect_intersection()Benjamin Otte2023-05-173-0/+289
| | | | | | | | | The idea is that for a rectangle intersection, each corner of the result is either entirely part of one original rectangle or it is an intersection point. By detecting those 2 cases and treating them differently, we can simplify the code to compare rounded rectangles.
* vulkan: Set the initial clip rectBenjamin Otte2023-05-173-1/+27
| | | | | Instead of rendering unclipped, set the clip region to the extents of the current clip region.
* vulkan: Only draw one rectBenjamin Otte2023-05-171-32/+27
| | | | | | | | | | | Instead of emitting the render commands once per rectangle of the clip region, just emit them once with the region's extents. This is generally faster because it emits fewer commands to the GPU, even though it may touch significantly more pixels. For a proper method, we'd need to record the commands per clip rectangle instead of emitting all of them all the time.
* xxx debug-printfBenjamin Otte2023-05-172-1/+3
| | | | Doesn't work yet, booo!
* vulkan: Use CLAMP_TO_EDGE in samplerBenjamin Otte2023-05-171-2/+2
| | | | | We don't want to clamp to the border, that causes fade-outs at the edges.
* vulkan: Rewrite AA shaders to respect scaleBenjamin Otte2023-05-177-20/+42
| | | | | | | | | The border and color shaders - the ones that do AA - now multiply their coordinates by the scale factor, which gives them better rounding capabilities. This in particular improves the case where they are used in fractional scaling situations, where the scale is defined at the root element.
* vulkan: Don't allocate no descriptor setsBenjamin Otte2023-05-171-0/+3
| | | | | | | If we don't need them, exit early. Shuts up the validation layers when running simple denos without textures.
* vulkan: Only use a single pipeline layoutBenjamin Otte2023-05-175-67/+47
| | | | There's no need to use 3 different ones when they are compatible.
* vulkan: Don't call verticesBenjamin Otte2023-05-171-1/+1
| | | | | We end up with the backside, when we scale(-1) and we still want it to be visible, just flipped.
* Add gsk vulkan testsMatthias Clasen2023-05-171-2/+4
| | | | | | | | | | | | | | | | | | | | Add a testsuite called gsk-compare-vulkan to run the gsk renderer tests with the Vulkan renderer. The current stats: Ok: 184 Expected Fail: 0 Fail: 204 Unexpected Pass: 0 Skipped: 2 Timeout: 0 For now, we mark all the tests as failing to avoid ci breakage. To run the tests locally, you can do: meson test -C_build --suite gsk-compare-vulkan
* vulkan: Use scale factor for offscreens and fallbacksBenjamin Otte2023-05-171-6/+18
| | | | | | | | Previously, we just used the defaultscale factor, but now that we're having it available in push constants, we can read it back for creating offscreens and rendering fallbacks. So do that.
* vulkan: Split scale from matrixBenjamin Otte2023-05-1714-42/+85
| | | | | Now, the scale is no longer part of the matrix. This allows shaders to transform points by the scale which increases accuracy for antialiasing.
* vulkan: Keep the modelview as a GskTransformBenjamin Otte2023-05-171-23/+33
| | | | This allows doing more optimized math on it.
* vulkan: Split modelview and projectionBenjamin Otte2023-05-171-9/+11
| | | | | This is adding extra work, but the benefits should become visible in future commits.
* vulkan: Add scale to push constantsBenjamin Otte2023-05-174-1/+10
| | | | This way, it can be pushed to the shaders
* vulkan: Move scale into the state objectBenjamin Otte2023-05-171-6/+6
|
* vulkan: Move offset into the state objectBenjamin Otte2023-05-171-29/+26
|
* vulkan: Add a new GskVulkanParseStateBenjamin Otte2023-05-173-275/+208
| | | | | | | | It's a 1:1 replacement for GskVulkanPushConstants, just without the indirection through a different file. GskVulkanPushConstants as a struct is gone now. The file still exists to handle the push_constants operation.
* vulkan: Don't store push constants in RenderOpBenjamin Otte2023-05-171-5/+7
| | | | Instead, only store the values that are needed.
* vulkan: Split out gsk_vulkan_render_pass_append_push_constants()Benjamin Otte2023-05-171-37/+35
| | | | Simplifies the code and makes future refactoring easier
* vulkan: Pass values to push directlyBenjamin Otte2023-05-173-14/+19
| | | | Don't require a GskVulkanPushConstants there.
* vulkan: Add a static assertBenjamin Otte2023-05-171-0/+6
| | | | | | | We don't want to make the push constants larger than what the spec guarantees. And that is 128 bytes, see value for maxPushConstantsSize in table 55 of https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax
* vulkan: Handle clip properly for offscreensBenjamin Otte2023-05-171-13/+20
| | | | This was broken in the last commit.
* vulkan: Track offset in the renderpassBenjamin Otte2023-05-1725-86/+182
| | | | | | This avoids emitting lots of push constant updates as most of the transforms we have are simple translations to adjust drawing for the next widget.
* vulkan: Pass scale to offscreensBenjamin Otte2023-05-171-5/+10
| | | | | | | Create offscreens with enough pixels for the given scale and ensure the scale is passed on. This improves text rendering on offscreens quite a bit.
* vulkan: Clean up scale handlingBenjamin Otte2023-05-173-42/+44
| | | | | | | | | 1. Use a graphene_vec2_t 2. Ensure it's always positive 3. Don't break with fallback The scale value is nothing more than an indication of how many pixels to assume per unit of a node.
* vulkan: Fix typoBenjamin Otte2023-05-171-1/+1
|
* vulkan: Don't store unused matricesBenjamin Otte2023-05-171-18/+9
| | | | We can compute it when needed, so do that.
* vulkan: Remove unneeded argumentBenjamin Otte2023-05-173-11/+1
| | | | | The initial matrix can be computed as needed, so we don't need to precompute it.
* vulkan: Don't explode without vertex dataBenjamin Otte2023-05-171-0/+3
| | | | | If no buffer has any vertex data (read: if nothing gets drawn), don't try to allocate a 0 bytes buffer.
* vulkan: Handle empty child bounds in repeat nodeBenjamin Otte2023-05-175-0/+30
| | | | Also add test to the testsuite for it.
* vulkan: Fix repeat nodesBenjamin Otte2023-05-171-7/+36
|
* vulkan: Don't transform the viewport rectBenjamin Otte2023-05-171-4/+1
| | | | | | | | We don't want to render the offscreen trnsformed, we want to render it as-is. We lose the correct scale factor, but that requires some separate work, so for now it gets a bit blurry on hidpi.
* vulkan: Make quarks global variablesBenjamin Otte2023-05-171-8/+13
| | | | | I don't want to ensure there's a RenderPass available everywhere and recreate the quarks in each, I just want to use them.
* vulkan: Split out a functionBenjamin Otte2023-05-171-47/+69
| | | | We can now create offscreens explicitly.
* vulkan: offscreens are used as color attachmentsBenjamin Otte2023-05-173-8/+8
| | | | | | | ... so set the corresponding flag. Also name the function "new_for_offscreen()" because thats what this function is about, "texture" is ambiguous.
* vulkan: compute new modelview directlyBenjamin Otte2023-05-171-3/+3
| | | | no need to go through a GskTransform
* vulkan: Make border shader handle fractional widthsBenjamin Otte2023-05-174-20/+41
| | | | We were rounding widths properly, make sure we always round up.
* vulkan: Don't round corners when growing rounded rectBenjamin Otte2023-05-171-2/+2
| | | | If the corner is set to 0, keep it there.
* vulkan: Rewrite rounded rectangle to use SDF distanceBenjamin Otte2023-05-175-43/+85
| | | | | We can use this to properly compute distance in scaled situations. We also now compute coverage with (imperfect) antialiasing.
* vulkan: Start rework on shaders to allow antialiased drawingBenjamin Otte2023-05-177-7/+111
| | | | | | | | | | This introduces the rect object and adds a rect_distance() and rect_coverage() function. _distance() returns the signed distance tp the rectangle. _coverage() returns the coverage of a pixel centered at that position. Note that the pixel size is computed using dFdx/dFdy.
* vulkan: Render whole textureBenjamin Otte2023-05-171-3/+8
| | | | | | | When the node bounds were a non-integer size, the texture would get ceil()ed pixels, but various viewport or scissor computations might floor() instead, leaving the right/bottom row of pixels untouched. Make sure those functions ceil(), too.
* node-editor: Add initial comparison UIBenjamin Otte2023-05-175-25/+587
| | | | And yes, I'm aware of the icon I'm using.
* node-editor: Add some form of undo stackBenjamin Otte2023-05-172-60/+144
| | | | | | | | I have no idea about the UI for this yet, but there's a list of nodes now that you can click on to get previous ones back. Ultimately I want to have some way to compare nodes or do transitions, but so far, this is an experiment.
* Merge branch 'wip/otte/ci-emergency' into 'main'Benjamin Otte2023-05-175-1091/+1
|\ | | | | | | | | CI: Actually build our code See merge request GNOME/gtk!5980
| * glrenderer: Remove unused functionBenjamin Otte2023-05-171-30/+0
| | | | | | | | | | | | Thanks, macos CI. (We should have a Fedora clang build.)
| * tests: Remove some testsBenjamin Otte2023-05-173-1060/+0
| | | | | | | | | | They are failing to build because they use deprecated functions and nobody thinks they're worth fixing.