Commit Graph

2741 Commits

Author SHA1 Message Date
Daniel van Vugt
cc19547b8c cogl: Set LOD bias to -0.5 for single mipmap modes
So that whenever forced to choose between two levels of detail (two mipmaps)
we will land on the sharpest looking one (highest resolution). That's the
mipmap level equal to the floor of the current level of detail requested.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5920
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2644>
2022-11-04 19:29:25 +00:00
Jonas Ådahl
5767d2f129 cogl/trace: Don't enable/disable in idle callback if thread matches
This makes it possible to start profiling immediately on startup, during
context/backend/display setup, as well as flush during tear down.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2678>
2022-11-01 21:04:21 +00:00
Jonas Ådahl
9117419940 cogl/texture: Type check introspected calls
CoglTexture can be used by e.g. Javascript, and the convention is to be
more forgiving regarding passed input so that invalid Javascript calls
doesn't cause actual SIGSEGV/SIGABRT. As elsewhere, do this by
sprinkeling g_return(_val)_if_fail() on introspected functions.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2124322
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2616>
2022-09-20 13:38:41 +00:00
Daniel van Vugt
dc5130ac01 cogl: Don't check glGetError for functions that don't return errors
This will at least make debug builds a tiny bit faster.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2615>
2022-09-19 14:24:39 +00:00
Daniel van Vugt
f1d7ccfa79 cogl: Add a quirk on Mali to glFlush before glGenerateMipmap
But only when the texture in question has associated framebuffers that
actually need flushing.

Workaround for: https://github.com/Xilinx/mali-userspace-binaries/issues/3
Related to: https://gitlab.gnome.org/GNOME/mutter/-/issues/2354

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2614>
2022-09-19 13:57:05 +00:00
Jonas Ådahl
efaf5a25b3 cogl: Remove the now unused test framework
All tests have been moved into src/tests/, so no need for it anymore.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
30daad4da5 cogl/pipeline/vertend/glsl: Move out unit test to its own file
Fix a memory leak while at it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
04bbe31287 cogl/pipeline/glsl: Distinguish between pipeline state types
Both the fragend and vertend shader state was called
"CoglPipelineShaderState", which was rather annoying, especially when
the type needs to be exposed outside of the .c file as part of moving
out unit tests. Make the types unique. This also avoids confusing what
type one is looking at.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
07f8edde22 cogl/pipeline/opengl: Move out unit test to separate file
Also rename the suffix to "-glsl" to not confuse OpenGL with GLES2
since this test covers both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
16a7f77701 cogl/pipeline-state: Move out working unit test to separate file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
ae0f6c549f cogl/pipeline-state: Move out failing test to its own file
This test is a known failure, so mark it as such. It's stored in its own
file since keeping it in the same as the passing test isn't markable
using meson.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
4905a55f64 cogl/pipeline-cache: Move unit test to its own file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
d0861c8ae2 cogl: Move out bitmask unit test to separate file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
9a9e7e471c tests/cogl: Add unit test framework
It consists of only a macro and build description logic.

Adds a macro for simpler tests that doesn't require a context; unit
tests requiring a context should use the same framework as conform
tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
4ebaa433ee cogl: Remove now empty conform test suite
All working tests have already migrated to the test suite using mutter;
move the old unported tests over too, and remove the conform test
framework, as it is no longer used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:13 +00:00
Jonas Ådahl
5d40a5eeea tests/cogl: Migrate fence test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
2b43ff5963 tests/cogl: Migrate texture rg test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
e7f535a21d tests/cogl: Migrate pipeline shader state test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
94744061de tests/cogl: Migrate texture no allocate test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
d066fb5380 tests/cogl: Migrate pipeline cache unrefs texture test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
68dcde0bdb tests/cogl: Migrate copy/replace texture test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
20111fa8ca tests/cogl: Migrate primitive and journal test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
3750ed6a26 tests/cogl: Migrate framebuffer bits test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
09990f8bcc tests/cogl: Migrate texture get/set data test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
85ad013b2d tests/cogl: Migrate alpha texture test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
629c23b229 tests/cogl: Migrate npot texture test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
33c582d33a tests/cogl: Migrate map buffer range test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
0a841ce846 tests/cogl: Migrate alpha test test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
5b0fa9cff4 tests/cogl: Migrate layer remove test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
7a91c30149 cogl: Remove version
The cogl version was unused, and not relevant, as the version and API is
tied to the mutter API version, not the old pre fork cogl version.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
c0746a04f9 tests/cogl: Migrate no-gl header test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
590290cd6d tests/cogl: Migrate point sprite tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
41e5ee63d3 tests/cogl: Migrate point size attribute tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
2746861c6a tests/cogl: Migrate point size test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
ae9b4a1bcf tests/cogl: Migrate write texture formats test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
ddb982ba6e tests/cogl: Migrate read texture formats test
This test fails on gl and gl3, but not on gles2; mark is at such.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
400cc89364 tests/cogl: Migrate sparse pipeline test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
8dc0489b33 tests/cogl: Migrate primitive tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
559c9c8795 tests/cogl: Migrate journal test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
0c6eb86698 tests/cogl: Migrate offscreen test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
fd99884063 tests/cogl: Migrate custom attributes test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
6ac0c196cb tests/cogl: Migrate sub-texture test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
18dd64dd45 tests/cogl: Migrate wrap modes test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
a8f9466978 tests/cogl: Migrate snippets test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
a53fdfb733 tests/cogl: Migrate premult test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
6c8b12c4de tests/cogl: Migrate pixel buffer tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
9305f8d9d8 tests/cogl: Migrate pipeline uniforms test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
63af78d049 tests/cogl: Migrate pipeline user matrix test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
a3b21188c9 tests/cogl: Migrate just-vertex-shader
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00
Jonas Ådahl
f3a821b4cd tests/cogl: Migrate backface-culling test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
2022-08-08 21:59:12 +00:00