gpu_neon: unbreak tests
authornotaz <notasas@gmail.com>
Tue, 24 Dec 2024 17:57:57 +0000 (19:57 +0200)
committernotaz <notasas@gmail.com>
Tue, 24 Dec 2024 18:30:46 +0000 (20:30 +0200)
plugins/gpu_neon/psx_gpu/psx_gpu.c
plugins/gpu_neon/psx_gpu/psx_gpu_main.c
plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
plugins/gpu_neon/psx_gpu/tests/Makefile

index 19f1c19..b37c277 100644 (file)
@@ -5067,6 +5067,7 @@ void initialize_psx_gpu(psx_gpu_struct *psx_gpu, u16 *vram)
   psx_gpu->dither_table[1] = dither_table_row(2, -2, 3, -1);
   psx_gpu->dither_table[2] = dither_table_row(-3, 1, -4, 0);
   psx_gpu->dither_table[3] = dither_table_row(3, -1, 2, -2);
+  psx_gpu->allow_dithering = 1;
 
   psx_gpu->primitive_type = PRIMITIVE_TYPE_UNKNOWN;
 
index 5f1f383..30ec48c 100644 (file)
 #include "SDL.h"
 #include "common.h"
 
+#include "../../gpulib/gpu.h"
+#include "psx_gpu.c"
+#include "psx_gpu_parse.c"
+
+#pragma GCC diagnostic ignored "-Wunused-result"
+
 extern u32 span_pixels;
 extern u32 span_pixel_blocks;
 extern u32 spans;
index 03d055d..95f3012 100644 (file)
@@ -346,7 +346,8 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
       {
         u32 i, simplified_count;
         set_texture(psx_gpu, list[4] >> 16);
-        if ((simplified_count = prim_try_simplify_quad_t(siplified_prim, list)))
+        if (!(psx_gpu->render_state_base & RENDER_STATE_DITHER) &&
+            (simplified_count = prim_try_simplify_quad_t(siplified_prim, list)))
         {
           for (i = 0; i < simplified_count; i++) {
             const u32 *list_ = &siplified_prim[i * 4];
@@ -412,7 +413,8 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
       {
         u32 i, simplified_count;
         set_texture(psx_gpu, list[5] >> 16);
-        if ((simplified_count = prim_try_simplify_quad_gt(siplified_prim, list)))
+        if (!(psx_gpu->render_state_base & RENDER_STATE_DITHER) &&
+            (simplified_count = prim_try_simplify_quad_gt(siplified_prim, list)))
         {
           for (i = 0; i < simplified_count; i++) {
             const u32 *list_ = &siplified_prim[i * 4];
@@ -1292,7 +1294,8 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
       {
         u32 i, simplified_count;
         set_texture(psx_gpu, list[4] >> 16);
-        if ((simplified_count = prim_try_simplify_quad_t(siplified_prim, list)))
+        if (!(psx_gpu->render_state_base & RENDER_STATE_DITHER) &&
+            (simplified_count = prim_try_simplify_quad_t(siplified_prim, list)))
         {
           for (i = 0; i < simplified_count; i++) {
             const u32 *list_ = &siplified_prim[i * 4];
@@ -1356,7 +1359,8 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
       {
         u32 i, simplified_count;
         set_texture(psx_gpu, list[5] >> 16);
-        if ((simplified_count = prim_try_simplify_quad_gt(siplified_prim, list)))
+        if (!(psx_gpu->render_state_base & RENDER_STATE_DITHER) &&
+            (simplified_count = prim_try_simplify_quad_gt(siplified_prim, list)))
         {
           for (i = 0; i < simplified_count; i++) {
             const u32 *list_ = &siplified_prim[i * 4];
index 21d6155..465dbb4 100644 (file)
@@ -1,30 +1,29 @@
 CC = $(CROSS_COMPILE)gcc
-CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
+CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP -DGPU_NEON
 CFLAGS += -Wall -ggdb
 CFLAGS += -fno-strict-aliasing
 
 CFLAGS += `sdl-config --cflags`
 LDLIBS += `sdl-config --libs`
 
-VPATH += ..
-
 ifdef NEON
 CFLAGS += -mcpu=cortex-a8 -mfpu=neon -DNEON_BUILD
 ASFLAGS = $(CFLAGS)
-OBJ += psx_gpu_arm_neon.o
+OBJ += ../psx_gpu_arm_neon.o
 else
 CFLAGS += -DNEON_BUILD -DSIMD_BUILD
-OBJ += psx_gpu_simd.o
+OBJ += ../psx_gpu_simd.o
 endif
 ifndef DEBUG
 CFLAGS += -O2 -DNDEBUG
 endif
 
-OBJ += psx_gpu.o psx_gpu_parse.o psx_gpu_main.o
+OBJ += ../psx_gpu_main.o ../../../gpulib/prim.o
 
 all: psx_gpu
 
 psx_gpu: $(OBJ)
+       $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
 
 clean:
        $(RM) psx_gpu $(OBJ)