notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
psxcounters: try to eliminate another source of audio drift
[pcsx_rearmed.git]
/
plugins
/
gpu_neon
/
psx_gpu
/
psx_gpu.c
diff --git
a/plugins/gpu_neon/psx_gpu/psx_gpu.c
b/plugins/gpu_neon/psx_gpu/psx_gpu.c
index
a79254d
..
1d513d8
100644
(file)
--- a/
plugins/gpu_neon/psx_gpu/psx_gpu.c
+++ b/
plugins/gpu_neon/psx_gpu/psx_gpu.c
@@
-51,6
+51,8
@@
u32 zero_block_spans = 0;
u32 texture_cache_loads = 0;
u32 false_modulated_blocks = 0;
u32 texture_cache_loads = 0;
u32 false_modulated_blocks = 0;
+#define stats_add(stat, count) // stat += count
+
/* double size for enhancement */
u32 reciprocal_table[512 * 2];
/* double size for enhancement */
u32 reciprocal_table[512 * 2];
@@
-1842,7
+1844,7
@@
void setup_spans_up_down(psx_gpu_struct *psx_gpu, vertex_struct *v_a,
} \
#define setup_blocks_add_blocks_direct() \
} \
#define setup_blocks_add_blocks_direct() \
-
texel_blocks_untextured += span_num_blocks;
\
+
stats_add(texel_blocks_untextured, span_num_blocks);
\
span_pixel_blocks += span_num_blocks \
span_pixel_blocks += span_num_blocks \
@@
-1938,14
+1940,14
@@
setup_blocks_builder(unshaded, untextured, undithered, unswizzled, direct);
void texture_blocks_untextured(psx_gpu_struct *psx_gpu)
{
if(psx_gpu->primitive_type != PRIMITIVE_TYPE_SPRITE)
void texture_blocks_untextured(psx_gpu_struct *psx_gpu)
{
if(psx_gpu->primitive_type != PRIMITIVE_TYPE_SPRITE)
-
texel_blocks_untextured += psx_gpu->num_blocks
;
+
stats_add(texel_blocks_untextured, psx_gpu->num_blocks)
;
}
void texture_blocks_4bpp(psx_gpu_struct *psx_gpu)
{
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
}
void texture_blocks_4bpp(psx_gpu_struct *psx_gpu)
{
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
-
texel_blocks_4bpp += num_blocks
;
+
stats_add(texel_blocks_4bpp, num_blocks)
;
vec_8x8u texels_low;
vec_8x8u texels_high;
vec_8x8u texels_low;
vec_8x8u texels_high;
@@
-1997,7
+1999,7
@@
void texture_blocks_8bpp(psx_gpu_struct *psx_gpu)
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
-
texel_blocks_8bpp += num_blocks
;
+
stats_add(texel_blocks_8bpp, num_blocks)
;
if(psx_gpu->current_texture_mask & psx_gpu->dirty_textures_8bpp_mask)
update_texture_8bpp_cache(psx_gpu);
if(psx_gpu->current_texture_mask & psx_gpu->dirty_textures_8bpp_mask)
update_texture_8bpp_cache(psx_gpu);
@@
-2031,7
+2033,7
@@
void texture_blocks_16bpp(psx_gpu_struct *psx_gpu)
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
block_struct *block = psx_gpu->blocks;
u32 num_blocks = psx_gpu->num_blocks;
-
texel_blocks_16bpp += num_blocks
;
+
stats_add(texel_blocks_16bpp, num_blocks)
;
vec_8x16u texels;
vec_8x16u texels;
@@
-3067,7
+3069,7
@@
void render_triangle(psx_gpu_struct *psx_gpu, vertex_struct *vertexes,
render_triangle_p(psx_gpu, vertex_ptrs, flags);
}
render_triangle_p(psx_gpu, vertex_ptrs, flags);
}
-#if
ndef NEON_BUILD
+#if
!defined(NEON_BUILD) || defined(SIMD_BUILD)
void texture_sprite_blocks_8bpp(psx_gpu_struct *psx_gpu)
{
void texture_sprite_blocks_8bpp(psx_gpu_struct *psx_gpu)
{
@@
-3120,7
+3122,7
@@
void texture_sprite_blocks_8bpp(psx_gpu_struct *psx_gpu)
#define setup_sprite_tile_fetch_texel_block_8bpp(offset) \
#define setup_sprite_tile_fetch_texel_block_8bpp(offset) \
- texture_block_ptr =
psx_gpu->texture_page_ptr +
\
+ texture_block_ptr =
(u8 *)psx_gpu->texture_page_ptr +
\
((texture_offset + offset) & texture_mask); \
\
load_64b(texels, texture_block_ptr) \
((texture_offset + offset) & texture_mask); \
\
load_64b(texels, texture_block_ptr) \
@@
-3228,7
+3230,7
@@
void texture_sprite_blocks_8bpp(psx_gpu_struct *psx_gpu)
#define setup_sprite_tile_half_8bpp(edge) \
{ \
#define setup_sprite_tile_half_8bpp(edge) \
{ \
- setup_sprite_tile_add_blocks(sub_tile_height
* 2);
\
+ setup_sprite_tile_add_blocks(sub_tile_height
);
\
\
while(sub_tile_height) \
{ \
\
while(sub_tile_height) \
{ \
@@
-3682,7
+3684,7
@@
void setup_sprite_##texture_mode##x4mode(psx_gpu_struct *psx_gpu, s32 x, s32 y,\
u32 num_blocks = psx_gpu->num_blocks; \
block_struct *block = psx_gpu->blocks + num_blocks; \
\
u32 num_blocks = psx_gpu->num_blocks; \
block_struct *block = psx_gpu->blocks + num_blocks; \
\
- u
16 *texture_block_ptr;
\
+ u
8 *texture_block_ptr;
\
vec_8x8u texels; \
\
setup_sprite_tiled_initialize_##texture_mode##x4mode(); \
vec_8x8u texels; \
\
setup_sprite_tiled_initialize_##texture_mode##x4mode(); \
@@
-3775,6
+3777,9
@@
setup_sprite_tiled_builder(8bpp,);
setup_sprite_tiled_builder(4bpp,_4x);
setup_sprite_tiled_builder(8bpp,_4x);
setup_sprite_tiled_builder(4bpp,_4x);
setup_sprite_tiled_builder(8bpp,_4x);
+#endif
+
+#if !defined(NEON_BUILD) || defined(SIMD_BUILD)
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
s32 v, s32 width, s32 height, u32 color)
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
s32 v, s32 width, s32 height, u32 color)
@@
-3803,7
+3808,7
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
texture_offset_base &= ~0x7;
texture_offset_base &= ~0x7;
- s
prites_16bpp++
;
+ s
tats_add(sprites_16bpp, 1)
;
if(block_width == 1)
{
if(block_width == 1)
{
@@
-3824,7
+3829,7
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
texture_block_ptr =
texture_page_ptr + (texture_offset_base & texture_mask);
texture_block_ptr =
texture_page_ptr + (texture_offset_base & texture_mask);
-
load_128b(block->texels, texture_block_ptr)
;
+
block->texels = *(vec_8x16u *)texture_block_ptr
;
block->draw_mask_bits = mask_bits;
block->fb_ptr = fb_ptr;
block->draw_mask_bits = mask_bits;
block->fb_ptr = fb_ptr;
@@
-3858,7
+3863,7
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
texture_offset_base += 1024;
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
texture_offset_base += 1024;
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
-
load_128b(block->texels, texture_block_ptr)
;
+
block->texels = *(vec_8x16u *)texture_block_ptr
;
block->draw_mask_bits = left_mask_bits;
block->fb_ptr = fb_ptr;
block->draw_mask_bits = left_mask_bits;
block->fb_ptr = fb_ptr;
@@
-3870,7
+3875,7
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
while(blocks_remaining)
{
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
while(blocks_remaining)
{
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
-
load_128b(block->texels, texture_block_ptr)
;
+
block->texels = *(vec_8x16u *)texture_block_ptr
;
block->draw_mask_bits = 0;
block->fb_ptr = fb_ptr;
block->draw_mask_bits = 0;
block->fb_ptr = fb_ptr;
@@
-3883,7
+3888,7
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
}
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
}
texture_block_ptr = texture_page_ptr + (texture_offset & texture_mask);
-
load_128b(block->texels, texture_block_ptr)
;
+
block->texels = *(vec_8x16u *)texture_block_ptr
;
block->draw_mask_bits = right_mask_bits;
block->fb_ptr = fb_ptr;
block->draw_mask_bits = right_mask_bits;
block->fb_ptr = fb_ptr;
@@
-3897,6
+3902,10
@@
void setup_sprite_16bpp(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
}
}
}
}
+#endif
+
+#ifndef NEON_BUILD
+
void setup_sprite_untextured(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
s32 v, s32 width, s32 height, u32 color)
{
void setup_sprite_untextured(psx_gpu_struct *psx_gpu, s32 x, s32 y, s32 u,
s32 v, s32 width, s32 height, u32 color)
{