Commit Graph

29 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
35b3946cc4 Fix POT repeat wrap test to upload POT texture first
The test could inherit a previously uploaded NPOT/strided texture from an earlier test, causing GL_REPEAT to be rejected before the POT upload occurred. Upload the POT texture before setting repeat wrap so the test verifies that POT textures still allow repeat wrapping.
2026-06-23 10:10:58 -07:00
Luke Benstead
9ee62ded90 Restore set_clamp_wrap 2026-06-23 05:32:40 +00:00
Luke Benstead
cbc83deee0 Merge branch 'master' into 'feature/kos-texture-stride'
# Conflicts:
#   tests/test_glteximage2d.h
2026-06-23 05:25:48 +00:00
Luke Benstead
9f83169b7a Fix failing test 2026-06-23 06:23:52 +01:00
Luke Benstead
c3a7776f30 Add more extensive test suite 2026-06-22 09:05:44 +01:00
GPF
7b48abc040 Updated the MR based on the feedback:
Replaced GL_KOS_texture_stride with GL_KOS_texture_non_power_of_two
Removed the explicit texture parameter and made supported NPOT GL_TEXTURE_2D textures automatically use the PVR strided backend
Added clamp-only validation and retained the existing restrictions around mipmaps, wrapping, and unsupported formats

The underlying PVR strided implementation remains the same. GL_NV_texture_rectangle can be considered as a future follow-up.
2026-06-20 14:34:27 -07:00
GPF
8aa9a0ec43 Add GL_KOS_texture_stride support 2026-06-20 00:45:11 -07:00
Luke Benstead
f56bf397de Fix failing tests 2026-05-04 10:35:21 +01:00
Luke Benstead
8743b0a5b9 Add tests 2026-04-20 22:23:31 +01:00
T_chan
ca8ebf7fc0 Change all ifdefs to support both DC & Naomi 2025-02-22 14:42:00 +01:00
Luke Benstead
55a912b621 Fix continuous free count 2024-12-07 19:54:16 +00:00
Falco Girgis
49f2f0917b Nehe20 Build Fix + Warnings cleanup for GCC14.1.0.
Newest toolchain is bitchier, so I wanted to go ahead and clear up all
of the warnings from building GLdc and the various examples...

1) Set CMake CXX standard to 14 instead of 11, since CXXFLAGS were
  enforcing that language standard anyway.
2) Fixed a bunch of strict aliasing violations in immediate.c: glVertex3f.
3) Removed or commented out lots of unused variables.
4) Fixed some "suggested inner braces on initializer" crap.
5) Fixed a bunch of signed vs unsigned pointer assignments.
6) Fixed several printf() warnings from using %d with int32_t (needs to
   be %ld for long int).
7) Fixed build issue with Nehe20 from not including kos.h for the
   KOS_ROMDISK macro.
8) Fixed some signed vs unsigned comparison mismatches in C++ template
   instantiations within clipping tests.
9)
2024-07-31 20:35:34 -05:00
Luke Benstead
5c762b969e Build out to libGL.a instead of libGLdc.a 2023-11-29 11:25:52 +00:00
Luke Benstead
3308a57e59 Implement defragmenting the memory 2023-09-08 17:49:46 +01:00
Luke Benstead
db9e1cd424 Fall back to unaligned if there's no more aligned spaced 2023-09-08 09:13:33 +01:00
Luke Benstead
6eb079228e Fix infinite loop 2023-09-06 21:01:37 +01:00
Luke Benstead
7ce01ad93f Fix up paletted textures 2023-09-06 08:01:01 +01:00
Luke Benstead
9cedc81850 Fix broken merge 2023-09-01 20:29:24 +01:00
Luke Benstead
3248499d5a Switch to the new allocator 2023-08-31 21:21:14 +01:00
Luke Benstead
f278777c0e WIP: Start implementing new allocator 2023-08-31 08:47:00 +01:00
Luke Benstead
34173d926c Drastically refactor glTexImage2D 2023-08-31 08:47:00 +01:00
Luke Benstead
77531ca347 Drastically refactor glTexImage2D 2023-08-26 20:34:11 +01:00
Luke Benstead
a5891056db Many bug fixes and optimisations 2023-05-16 13:31:44 +01:00
Luke Benstead
2ec7055547 Optimisations 2023-04-23 07:44:09 +01:00
Luke Benstead
095ebf2790 Fix final bug 2023-04-22 11:37:42 +01:00
Luke Benstead
baa275b41b Fix a bunch of issues with clipping (almost working) 2023-04-21 20:38:21 +01:00
Luke Benstead
e54494e995 More clipping work 2023-04-20 20:45:59 +01:00
Luke Benstead
c5ce81a38d WIP: Restructure clipping to be much MUCH faster in the visible case
This currently only works with triangles, anything more and it crashes
due to me not queuing subsequent vertices in the strip correctly
2023-04-19 20:57:44 +01:00