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
Some libraries expect GL and GLU to be separate.
Move our existing glu.c code to libGLU.a to keep them happy.
Note that some of the GLU code still exists in matrix.c, but that should
be fine as GLU has a dependency on GL anyway.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
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>
Note that I dropped quite a few things related to CFLAGS:
- the -mfsrra / -mfsca discovery was clean cmake and could have stayed;
but kos-cc already passes those flags, so -ffast-math is enough to
enable the FSRRA / FSCA instructions.
- -fomit-frame-pointer is also a default option of KOS.
- -fexpensive-optimizations, -finline-functions and -fstrict-aliasing
were redundant as they are enabled by the optimization level
specified.
- -ffp-contract=fast is the default when using GNU C, which we are here.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
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.
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.