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
The romdisk is automatically initialized when linked, and does not have
to be initialized in any way in C code. Doing so results in multiple
inclusions of the romdisk file.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
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.
Add a Dreamcast GLdc sample that loads a .dt texture from romdisk.
This adds a new nehe06_dt sample based on the existing NeHe cube demo, but loading a Dreamcast .dt texture directly from romdisk instead of the older texture formats.
Changes:
- add samples/nehe06_dt/main.c
- add samples/nehe06_dt/romdisk/NeHe.dt
- register the sample in CMakeLists.txt
The sample is useful for checking GLdc texture loading with Dreamcast-native .dt assets and for comparing the output against the source artwork on hardware.
- Redid fog.c OpenGL fog back-end implementation
* only reconfigure fog values when changed
* properly clamp between 0.0f and 1.0f colors
* error out on negative densities
* separate fog statics became single struct
- Added Nehe16 example (adapted from KGL)
* Made spinning much faster (so you can see it better)
* fixed a few issues with KGL code (invalid GL enums, lol)
* swapped to new controller API
* added #ifdef for non-DC file paths
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)
- A button toggles between glDrawElements and glDrawArrays
- B button toggles glBlend
- Start quits the sample
- Every 10 seconds a log with stats will be sent to the terminal