Commit Graph

77 Commits

Author SHA1 Message Date
Lephenixnoir 18b42e4e77
libnum: fix strToBuffer ignoring the integer part on calc targets 2024-03-12 09:38:01 +01:00
Lephenixnoir f13096dd6e
gl: switch to bind-attribute style + option for debug output 2023-10-29 12:14:06 +01:00
Lephenixnoir a755c28113
gl: cache attribute locations in ShaderProgram 2023-10-28 21:16:08 +02:00
Lephenixnoir caff84753a
azur: use flexible C++ functions for main loop 2023-10-28 19:58:13 +02:00
Lephenixnoir 1cd3702dfa
gl: simpler interface to specifying vertex attribute layouts 2023-10-28 17:25:44 +02:00
Lephenixnoir a61e07bd54
gl: WIP shader abstraction 2023-10-28 13:38:13 +02:00
Lephenixnoir 17e50fc79e
libnum: num abs() and comparison with double 2023-10-28 13:38:13 +02:00
Lephenixnoir 7f104395e0
libnum: generic vec mixin + more vector space operators 2023-10-28 13:38:13 +02:00
Lephenixnoir 7e64004de2
libnum: mark floor/ceil/etc functions as const 2023-10-28 13:38:13 +02:00
Lephenixnoir ea6cfa2eb0
libnum: add .dot() method to vec objects 2023-10-28 13:38:13 +02:00
Lephenixnoir 3bdd356ed6
gl: fix lax use of pointer conversion no longer allowed by emscripten 2023-10-19 18:22:07 +02:00
Lephenixnoir e26a96364c
azrp: fix a cmdgen bug causing crashes when buffer is full
Command finalization could refuse to finalize commands that were
allocated, because its rounding method added 4 extra bytes to commands
whose size is a multiple of 4. Such commands would still be instantiated
but without commands_length advancing, causing the underlying memory to
be reallocated later, leading to overlapping commands.
2023-07-17 23:02:55 +02:00
Lephenixnoir 99c89e5628
azrp: fix triangle shader not rendering when w=1 or h=1 2023-07-17 22:58:14 +02:00
Lephenixnoir b7abc2f846
azrp: treat NULL font as current font in all text functions 2023-06-15 20:20:54 +02:00
Lephenixnoir 44f20d9b5c
azrp: add azrp_print() and azrp_print_opt() shader functions 2023-06-15 15:41:57 +02:00
Lephenixnoir a33b82f283
azrp: precompute list of glyphs in text shader
This was planned for later but kind of required to avoid having
commands that reference random strings whose lifetime is very much
questionable.
2023-06-15 15:09:59 +02:00
Lephenixnoir f3a1e90788
azrp: in-place command generation + variadic commands
This commit changes the command generation mechanism. Instead of
creating a command on the stack then calling azrp_queue_command() which
does a needless copy, the new function azrp_new_command() allocates
directly inside the command buffer, avoiding the copy.

This concept is pushed further with the introduction of finer-grained
functions azrp_alloc_command(), azrp_finalize_command() and
azrp_instantiate_command(), which split this process in three steps.
This allows generating commands of variadic size in-place in the
command buffer as well as using non-interval fragment sets.
2023-06-15 15:08:45 +02:00
Lephenixnoir 0cd9acc12f
azur: configure azrp resolution based on azur_init() in gint 2023-06-12 20:39:44 +02:00
Lephenixnoir 2f185a36d7
azrp: first version of text shader (slow!), based on topti-cg 2023-06-12 20:39:43 +02:00
Lephenixnoir 2e7c076e60
azrp: add rectangle shader (azrp_rect): flat, invert, darken, whiten
Flat is optimized but invert, darken and whiten are not.
2023-05-31 23:29:26 +02:00
Lephenixnoir fe4b339327
azrp: configure shaders automatically 2023-05-29 12:49:29 +02:00
Lephenixnoir be4e4308cb
libnum: generalize scalar product/division to all num types 2023-05-29 09:56:32 +02:00
Lephenixnoir f3bd29fb32
azrp: allow any point order in triangle shader 2023-05-29 09:50:06 +02:00
Lephenixnoir 6eeef0fce9
libnum: add optimized num16 division for SH4AL-DSP 2023-04-29 12:14:09 +02:00
Lephenixnoir a7529430dd
libnum: some additional functions 2023-04-23 23:03:28 +02:00
Lephenixnoir 36a21e3261
libnum: make comparisons with int const 2023-04-22 19:55:47 +02:00
Lephenixnoir 0e1ec15a6d
azur: add main loop support in gint 2023-04-22 16:51:20 +02:00
Lephenixnoir 5325e27821 Merge pull request 'Corrected on small typo' (#1) from Slyvtt/Azur:main into main
Reviewed-on: https://gitea.planet-casio.com/Lephenixnoir/Azur/pulls/1
2023-01-21 09:22:48 +01:00
Sylvain PILLOT 2fb3d98e5a Corrected on small typo 2023-01-21 08:06:34 +01:00
Lephenixnoir 81b1cc1083
azur: double buffer space for command data
Now that it's in the main RAM we don't have to limit it as much.
2023-01-20 22:39:06 +01:00
Lephenixnoir e86a95f6d6
azrp: update image shader to use dwindow settings 2022-11-19 17:47:21 +01:00
Lephenixnoir ec74a983b3
libnum: add unary vector operators 2022-08-30 13:14:21 +02:00
Lephenixnoir cd95fad8d0
libnum: add basic vector types 2022-08-20 22:23:56 +02:00
Lephenixnoir b62e026fa5
azrp: clean up the prototype triangle shader in C 2022-08-20 20:57:46 +02:00
Lephenixnoir 4ee1537084
azrp: improve the triangle shader (speedup x1.2)
It's quite optimized now.
2022-08-20 20:56:48 +02:00
Lephenixnoir 8448467cd4
azrp: bump command limit to 1024
It used to be 256 due to XYRAM limits but it's easy to hit.
2022-08-20 20:54:52 +02:00
Lephenixnoir cc66d3a520
azrp: faster triangle shader in assembler (speedup ≈ ×2) 2022-08-20 14:59:48 +02:00
Lephenixnoir 8badb9f9cc
azrp: add very basic triangle shader 2022-08-20 11:49:21 +02:00
Lephenixnoir 5ccd674795
meta: build system for fxSDK 2.9 with sysroot 2022-08-20 11:48:42 +02:00
Lephenixnoir 1d8851cbf5
libnum: add experimental string representation
Currently only has hand-picked tests and very rough code, but it's a
start. In the future, I want to have better tests, more
options like printf's %e/%f/%g, and more versatile methods.
2022-08-07 11:32:57 +02:00
Lephenixnoir ec1593d4f8
libnum: add floor/ceil/frac functions, and int limits 2022-08-04 10:18:28 +01:00
Lephenixnoir 10cf9951a0
libnum: rename the namespace [num] -> [libnum]
The first name would make `num` on its own ambiguous when using the
namespace.
2022-08-01 23:01:35 +01:00
Lephenixnoir 4238d5853f
libnum: add performance tests for num32 2022-07-24 00:21:56 +01:00
Lephenixnoir 708ba1b017
libnum: unit tests, perf tests for num16, double limits
* Add a unit testing framework in libnum/test/. Assertions are checked
  against sparse sets of input values (a couple thousands for each
  type), distributed fractally.
* Add performance tests for num16.
* Fix an overly ambitious substitution of /256 by >>8 in num16::mul,
  which would give some incorrect results for negative results.
* Also fix an incorrect sign extension in the num16->num32 conversion.
* Express comparison-with-int operators in terms of the integer even
  though some versions are faster when expressed in terms of the fixed-
  point value. This is because the integer is frequently known at
  compile-time.
* Add minDouble and maxDouble static members to each num type to
  programmatically supply the bounds of the type.
2022-07-24 00:05:41 +01:00
Lephenixnoir 967eb034f4
libnum: num8 optimizations 2022-07-20 00:50:58 +01:00
Lephenixnoir e90abaaabc
libnum: add tests for how optimized compiled assembly code is
This change adds tests for libnum (run with `make -C build-x tests`)
that compile example programs with g++ and evaluate how optimized the
assembly code is. This is done by checking user-provided specifications
of what instructions should and shouldn't be used against the compiled
assembler.
2022-07-19 23:18:01 +01:00
Lephenixnoir d77c7fef78
libnum: add num8/num16 comparisons with integers and some tests 2022-07-19 23:12:23 +01:00
Lephenixnoir d75ef1b2e9
libnum: use C++20 concepts 2022-07-19 23:11:29 +01:00
Lephenixnoir 7de30b80e7
azur: update r61524_start_frame() to match gint 2.8.1 2022-07-18 23:10:43 +01:00
Lephenixnoir c74e8fcf13
azur: restructure to adhere to a more consistent C++ style 2022-07-18 23:02:13 +01:00