Commit Graph

106 Commits

Author SHA1 Message Date
GPF
f11f7c966a texture: fix Dreamcast hardware texture and scissor regressions
Fix several Dreamcast hardware regressions found while testing real PVR behavior.

- Upload the default white texture through the platform texture loader instead of memcpy directly into PVR texture memory.
- Add GPUTextureLoad so SH4 uses pvr_txr_load while the software backend keeps memcpy behavior.
- Track scissor/userclip application per polygon list and invalidate scissor state at buffer swap.
- Submit queued geometry before USERCLIP/header transitions in the SH4 submit path.
- Remove the stale packed 4bpp source-size double-halving in glTexImage2D.
- Add texture regression coverage for packed 4bpp, unpack row length, compressed palette4 forwarding, and 8bpp-to-4bpp packing.
- Update the scissor sample and add polygon_compare as a small hardware comparison sample.

Verified:
- make -C dcbuild gldc_tests scissor polygon_compare
- scissor sample on Dreamcast hardware
- polygon_compare sample on Dreamcast hardware
- existing strided texture sample on Dreamcast hardware
2026-07-03 09:37:12 -07:00
GPF
862bcf70d1 Use release-compatible PVR texture stride setup 2026-07-01 20:48:06 -07:00
GPF
8aa9a0ec43 Add GL_KOS_texture_stride support 2026-06-20 00:45:11 -07:00
Luke Benstead
57ab4b60a6 Avoid copies when converting textures 2026-05-03 18:47:58 +01:00
Luke Benstead
ce67e37c5d Switch to m4-single 2026-04-23 20:00:48 +01:00
Luke Benstead
8743b0a5b9 Add tests 2026-04-20 22:23:31 +01:00
Luke Benstead
f0eefc4125 Get non textured polys working 2026-03-01 08:13:04 +00:00
Luke Benstead
13a7de3633 Fix software build 2026-02-28 22:04:08 +00:00
Luke Benstead
bf45f36e82 More float color work 2026-02-28 14:26:22 +00:00
Luke Benstead
cb3153d763 Start refactoring everything 2026-02-23 21:41:00 +00:00
darc
67f2671618 Allow for proper shutdown/deinitialization 2025-09-15 16:50:02 -05:00
Falco Girgis
88e7130e98 Changed fabs() to fabfs() within glClipEdge(). 2025-09-15 16:50:02 -05:00
UnknownShadow200
cf3a29e097 Fix clipped triangle in THIRD_VISIBLE case producing vertices in wrong direction, which would result in them being culled when face culling was enabled 2025-03-31 21:12:05 +11:00
Falco Girgis
b09e630304 Implemented support for all vertex attribute fmts.
1) GLdouble was incorrectly being treated as GLfloat which is now broken
   with -m4-single as default. Fixed.
2) Implemented all missing double-precision vertex attribute reader
   functions.
3) Implemented all missing vertex reader/extracter functions for
   unsigned/signed ints and unsigned/signed shorts.
4) Added (void) argument lists to every function missing them.
    - Not the same as accepting no arguments in C, as with C++.
5) Added KOS's __restrict to software.h so it can be used in common code.
2025-02-19 08:54:21 -06:00
Luke Benstead
acee4b5c37 Merge branch 'quicker_transform' into 'master'
Quicker vertex transform in non-fast path

See merge request simulant/GLdc!144
2025-02-02 08:34:36 +00:00
UnknownShadow200
a566bba082 Call TransformVertex directly instead of using TransformVertices 2025-02-02 15:58:19 +11:00
UnknownShadow200
3b2e549934 Optimise vertex transform in non-fast path to avoid storing xyz to memory and then loading it again 2025-02-02 14:36:40 +11:00
UnknownShadow200
e2c3ff0ed6 Fix not building for desktop 2025-02-01 20:12:23 +11:00
UnknownShadow200
3b4b1b6975 Fix compile error 2025-02-01 14:00:49 +11:00
UnknownShadow200
71d0094ac4 Prefer relying on built in codegen rather than relying on sh4_math.h 2025-02-01 13:06:37 +11:00
Falco Girgis
9653bf8c12 Got rid of a memset4() call from KOS. 2025-01-23 21:27:34 -06:00
Falco Girgis
6407353121 Removed opb_count hack for older KOS versions 2024-10-09 22:20:32 -05:00
UnknownShadow200
ea56577ca9 Use direct render APIs instead of manually locking/unlocking store queues
This ensures that GLdc works in both 2.1.0 and latest matter
2024-10-04 19:51:33 +10:00
Falco Girgis
b6995edc66 Merge branch 'master' of https://gitlab.com/simulant/GLdc 2024-08-11 09:19:59 -05:00
Falco Girgis
0f3be24cec Merge branch 'master' of https://gitlab.com/simulant/GLdc into pvr_direct 2024-08-11 01:21:06 -05:00
Luke Benstead
ba76d67154 Merge branch 'ViewportTransform' into 'master'
Refactor viewport transform

See merge request simulant/GLdc!120
2024-08-04 20:18:41 +00:00
UnknownShadow200
2f26574a44 Combine projection transform and viewport transform together 2024-08-03 15:52:56 +10:00
Falco Girgis
b920855b57 Micro optimizations and clean-up. 2024-07-31 23:08:37 -05:00
Falco Girgis
873372995a More cleanup. 2024-07-31 22:59:43 -05:00
Falco Girgis
a68c4bf6ac Merge branch GLdc:master into master 2024-07-31 19:10:27 +00:00
UnknownShadow200
6722e14b93 Simplify RGBA interpolation by avoiding a multiply and division by 255 2024-06-07 21:36:59 +10:00
Falco Girgis
5fd6e51028 Readded prefetching. 2024-04-10 01:09:29 -05:00
Falco Girgis
54e46822bd Merge remote-tracking branch 'origin/master' into HEAD 2024-04-10 00:40:37 -05:00
Luke Benstead
572fa01b03 Fix edge case 2024-04-06 21:13:17 +01:00
Luke Benstead
6a6d229e4c Fix bug with multiple strips 2024-04-04 06:30:37 +01:00
Luke Benstead
77f4b59aea Fix off-by-one 2024-04-03 22:30:41 +01:00
Luke Benstead
5299badf58 Only submit trailing vertices if the previous triangle was visible 2024-04-03 22:09:35 +01:00
Luke Benstead
f8d1fa3439 Fix some issues with clipping 2024-04-03 21:19:36 +01:00
Luke Benstead
a8f3d86705 Start cleaning up the zclip code 2024-04-02 22:28:36 +01:00
Luke Benstead
d4f6a9636b Fix more freezes and clipping issues 2024-03-19 20:14:01 +00:00
Luke Benstead
d6ac295d18 Fix more potential freezes 2024-03-19 08:14:38 +00:00
Luke Benstead
b353151dca Fix freeze due to bad clipping 2024-03-18 20:56:15 +00:00
Luke Benstead
cf4a557489 Fix CLIP_DEBUG 2024-03-18 20:18:58 +00:00
Luke Benstead
c85aed2d28 Set the opb counter 2024-03-11 19:11:35 +00:00
T_chan
bd17c995ea Naomi: don't call flashrom_get_region, as KOS Naomi does not include flashrom functions 2024-02-03 11:42:39 +00:00
T_chan
58f5f52eac avoid reading the flashrom if we know we are in VGA mode 2024-02-02 20:08:04 +00:00
Falco Girgis
04c2fcceae Getting rid of prefetching. 2024-01-31 14:59:58 -06:00
Falco Girgis
d4a83ff235 Fixed a double promotion, put back prefetching. 2024-01-31 14:46:49 -06:00
Falco Girgis
8d1ce547f5 Screwed up prefetch macro. 2024-01-31 02:51:51 -06:00
Falco Girgis
313341f93d Trying without prefetching. 2024-01-31 02:50:01 -06:00