Commit Graph

157 Commits

Author SHA1 Message Date
Flyinghead f9feaa313b pvr: sort triangles during parse. Use primitive restart
Sort triangles during ta_parse. Use the same index as other polys. Store
results in rend_context.
Use primitive restart if available to avoid too many degenerate
triangles.
Update renderers.
2022-12-13 22:57:57 +01:00
Flyinghead 1ab4eb00c0 tex cache: minor key mask fix. egl: no need for depth/stencil surface
Part of PalSelect was used as cache key for palette textures
PrintTexture fix
egl,wgl,xgl: No need for depth/stencil surface
gl: non-functional refactoring
2022-12-09 17:49:32 +01:00
Flyinghead 40dbf53792 pvr: use render pass # to read the right tile when marking blocks
Fixes Unreal Tournament flashing/black screen.
gl: mark vram area in rtt to avoid overwriting data (Worms World Party)
Force Worms World Party to use CopyToVRam (regression due to
6a5db32d5d)
Don't calculate precise aspect ratio and use 4/3 instead (or more if
widescreen or stretch).
Fix clipping issue when using SCALER_CTL.vscalefactor. Avoir crash when
clip values are >= width or height.
vulkan: RenderFramebuffer wasn't working at all if !EmulateFramebuffer
2022-10-30 12:10:24 +01:00
Flyinghead c1f0dd81d2 pvr: copy pvr regs at start_render time to avoid concurrent update
copy TA_GLOB_TILE_CLIP and SCALER_CTL to rend context when starting
render. Use rend context copy to calculate framebuffer size.
Fixes framebuffer size glitches in vf4 water stages.
lr: pass aspect ratio when resizing.

dx11: Wrong sizing of rotated games.

gl: test automation fixes.
2022-10-25 15:00:04 +02:00
Flyinghead 5722dc90f0 Full framebuffer emulation. Renderer interface changes
Helps for:
Densha de Go! 2, Issue #171
Vigilante 8, Issue #275
Xtreme Sports
Sonic Shuffle
The Ring of the Nibelungen
2022-10-23 16:32:42 +02:00
Flyinghead 1858cf3b33 Merge remote-tracking branch 'origin/master' into dev 2022-09-24 19:28:38 +02:00
Edward Li c2e1425209 Stop Apple fanboys from asking where is Metal 2022-09-21 14:43:28 +02:00
Flyinghead e0d87eb093 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/rend/gui.cpp
2022-08-22 13:09:56 +02:00
Flyinghead 85b8c599c4 pvr: object list is sometimes shared between op and tr modvols
Region tile object list pointers can be identical for op and tr modvols,
in which case tr modvols should be drawn using op modvols geometry.
Used by crazy taxi 1/2, alien front online, daytona usa and probably
many others.
Issue #717
2022-08-22 12:38:04 +02:00
Flyinghead 807b8dea91 lr: Framebuffer size and aspect ratio. Fix vmu size and position (GL)
gl4: fix lightgun xhair size and position
2022-07-19 20:26:37 +02:00
Flyinghead 76bf574668 gl,gl4: disable anisotropic filtering if not linear
Issue #695
2022-07-15 20:36:29 +02:00
Flyinghead fdcea88519 gl4: wrong depth for transparent polys with native depth interp
Issue #630
2022-06-01 19:26:56 +02:00
flyinghead bf6c73060b native depth interpolation option to help AMD gpus
When enabled, set 1/z in pos.w and use native interpolation for colors,
UV and depth.
Get rid of manual modvol clipping in dx11.
2022-06-01 19:26:56 +02:00
Flyinghead d08f0e6599 gl4: wrong depth for transparent polys with native depth interp
Issue #630
2022-05-13 13:03:02 +02:00
flyinghead 77a11d2a2e native depth interpolation option to help AMD gpus
When enabled, set 1/z in pos.w and use native interpolation for colors,
UV and depth.
Get rid of manual modvol clipping in dx11.
2022-05-12 13:43:43 +02:00
Flyinghead 4554450d1d oit: add max layers and pixel buffer size options 2022-05-05 18:01:05 +02:00
Flyinghead 3cc991fa4f oit: poly number/vertex id overflow
Use 17 bits for vertex id but substract first vtx index
Use 13 bits for poly number instead of 12
Panzer Front uses more than 4095 tr polys.
Issue #616
2022-05-01 12:33:53 +02:00
Flyinghead 3b81bbcae5 naomi2: gmp diffuse/specular flags select vertex or model colors only
These flags shouldn't be used to disable diffuse/specular shading
Fixes road surface glitches in initdv3e (Usui map)
2022-04-21 13:55:09 +02:00
Flyinghead e0058c17ff lr: don't terminate emu on deinit. gl4: buffer wasn't released on term()
shared libraries containing gnuc unique symbols are never unloaded on
linux, and possibly other platforms. So don't terminate the emulator on
deinit and init it only once.
Issue #566

gl4: buffer not released on term() was causing crashes or black screen when restarted.
2022-04-05 14:53:47 +02:00
Flyinghead bf61f5cfe8 Merge remote-tracking branch 'origin/master' into dev 2022-04-04 12:11:10 +02:00
Hugo Locurcio a9cabdc342 Add texture filter override setting, expose anisotropic filtering
The new texture filter option can be set to:

- Default (keeps the game's intended filter mode).
- Force Nearest-Neighbor (crisper appearance).
- Force Linear (smoother appearance).

Additionally, mipmapping can now be enabled on nearest neighbor-filtered
textures (which is used if nearest-neighbor filtering is enabled, including
with anisotropic filtering).

Anisotropic filtering was already implemented in both OpenGL and Vulkan,
but it was not exposed in the GUI.
2022-04-01 16:00:41 +02:00
Flyinghead 1015a8c098 naomi2: vulkan support
oit: use #define instead of functions in GLSL
2022-03-12 17:56:46 +01:00
Flyinghead c11a6cd432 naomi2: partial gles2 compatibility
Issue #553
2022-03-07 20:32:08 +01:00
Flyinghead 214db9e0b1 gl4: depth pass need texture and UV for punch-through polys 2022-02-15 17:18:32 +01:00
flyinghead 8d071bf4ea naomi2: dx11 support. fix ambient color. no depth write in per-strip
dx11: naomi2 support
n2: ambient color was swapping red and blue
gl, dx11: don't write depth in per-strip to avoid missing geometry,
prefer wrong depth order/blending for now
optimize naomi2 per-triangle sorting
2022-02-13 21:01:45 +01:00
Flyinghead 20d25059bf naomi2: remove geom shader. Merge transparent polys. bump mapping fix.
elan: Get rid of geometry shader and do geometry clipping manually.
pvr: Aggressively merge transparent polys in per-triangl and OIT mode, duplicating the last vertex to merge opposite cull mode strips.
gl4: reset OIT pointers in final shader. No need for clear pass.
gl4: alternate between 2 buffers for verts.index/tr poly params.
gl4: use gl_VertexID + poly number for poly index.
gl: new GlBuffer class.
2022-02-11 15:54:18 +01:00
Flyinghead debbae6ab1 naomi2: elan v10 emulation. texture dma xfers. 2-volume support
emulate elan v10 (fixes modvol in vf4, initd, beachspiker, wldrider)
wrong color order for model and vtx color
model param override xor support
improved light direction precision. Angle attenuation algo change
get rid of alpha light and modifier volume hacks
texture dma xfer from main and elan ram
gl4: use geometry only vtx and geom shaders for depth pass
2-volume support
2022-02-05 14:50:12 +01:00
Flyinghead 0362fd1079 naomi2: disable elan when net rollbacking, optimizations. ggpo: RTT fix
n2: do not process elan commands during ggpo rollbacks.
n2: Cache model colors to avoid unpacking for each vtx
pvr: merge equivalent polys with different culling by duping a vtx
pvr: fix crash during direct FB render
pvr: use correct color ordering for naomi2. Use identify matrix for null matrix pointers
ggpo: do not signal end of frame on a render to texture
2022-02-01 17:37:54 +01:00
Flyinghead 38765dc89a pvr: fix multipass. naomi2: constant color shading.
pvr: link multipass TA contexts. Each pass has its own.
pvr: get rid of context pool
naomi2: constant color shading. Use model diffuse and specular
selection. Don't use vtx color for offset color.
naomi2: pseudo-parallel lights fix
naomi2: pass-through TA data needs forced list type. Terminate with
end-of-list
enable RTT copy to vram for Beach Spikers
2022-01-31 20:40:09 +01:00
Flyinghead 5fb8b458bb pvr: use TA_OL_BASE instead of PARAM_BASE/TA_ISP_BASE to id TA context
Writes current TA_OL_BASE to all tiles OPB block. Read from region array
at render time to identify context.
Fixes vf4 water reflections RTT
get rid of dump_frame/read_frame
2022-01-29 18:39:38 +01:00
Flyinghead de1322b928 naomi2: Fix T&L matrix. vmem elan ram support.
Fix T&L matrix (wild riders)
Open GL support for normal/light matrix
handle elan RAM in vmem
2022-01-28 21:24:30 +01:00
Flyinghead e5d517dad2 use platform.isConsole(), platform.isNaomi(), ... 2022-01-27 17:52:19 +01:00
Flyinghead e1038ea632 naomi2: fix regressions. 2-volume and bump mapping support WIP
optimize open gl uniforms
2022-01-26 22:15:10 +01:00
Flyinghead 8947100701 libretro: missing new param to gl4GetProgram 2022-01-25 15:43:30 +01:00
Flyinghead cb99e7d920 naomi2: do T&L on the gpu. bypass TA format. env mapping.
fix model/instance/matrix parsing
handle culling reversed model flag
geometry shader for near plane clipping
2022-01-25 15:37:04 +01:00
Flyinghead e02afb34d1 dx11: wrong shadow scale factor. vk: object leak. Code duplication
dx11: shadow scale factor inverted in per-pixel
vulkan: clear deleted overlay images when terminating
Use color struct for FOG_COL_VERT, FOG_COL_RAM, FOG_CLAMP_MIN,
FOG_CLAMP_MAX and VO_BORDER_COL. Avoid code duplication in renderers.
2021-12-17 13:40:42 +01:00
flyinghead 4c14a96888 vk, gl4: out of bound array index when sorting pixels 2021-12-12 18:42:50 +01:00
flyinghead 99195c3f4c dx11: set clip planes on X and Y. rend: Force palette update at init
dx11: Set clip planes at X -1/1 and Y -1/1 to avoid rasterizer errors.
Fixes Daytona Mermaid lake depth issues
dx11: fix texture wrap around at UV 1 with nearest filtering
dx9: inside clipping
all renderers: force full palette update at init
2021-12-01 14:54:03 +01:00
flyinghead f91847dad0 DX11 renderer WIP 2021-11-26 18:08:41 +01:00
Flyinghead 06ef0e5fdc vk,gl: use w=1 in shaders. Fix translucent modvols
Use w=1 to avoid multiply/divide of xy as in dx9
Disable rendering when video output disabled
Use original w value in pixel struct to avoid precision loss (samsptk)
vk oit: missing memory barrier was producing Tr modvol glitches (JSR)
gl oit: Tr modvol needs full vertex shader
2021-11-07 18:21:44 +01:00
Flyinghead 18cecc8d38 gl,vk: use VO_BORDER_COL for clear color 2021-09-27 13:39:08 +02:00
Flyinghead e02ccbf32a gl: update fog and texture palette in Process() 2021-09-03 11:12:47 +02:00
Flyinghead e3e3229612 iOS: multiple controller/rumble support. GL: fix black screen after RTT
iOS:
* multiple controllers support. Rumble support.
* fix audio recording
* declare CHD/GDI/CUE/CDI content types
* start game when opening file URL
* Use safe area for UI and virtual gamepad
* Better icons
2021-08-23 14:02:12 +02:00
Flyinghead de060d66ab don't save flash if no game started. libretro: fix notifications
compilation warnings, non-functional changes
2021-07-20 19:21:11 +02:00
Flyinghead 117f47e3a2 rend: shader builder utility 2021-07-19 12:49:47 +02:00
Flyinghead af76a09e03 gl: repeat % operator for printf. remove Switch special case 2021-07-18 18:15:35 +02:00
Flyinghead 9e5769912b gl: workaround nouveau bug (oit). Use float palette coords for switch
Don't switch render type before terminating current one.
2021-07-17 15:53:47 +02:00
Flyinghead 345dab9633 libretro: fix nvidia palette issue. request 3.2 to get a core gl ctx 2021-07-09 13:10:30 +02:00
Flyinghead 5c952021b7 libretro: vmu and crosshair display. lightgun fixes 2021-07-08 20:09:09 +02:00
Flyinghead 205f2690d6 gl4: delete fog & palette textures when terminating
fixes fullscreen toggle screen corruption
2021-07-07 10:54:10 +02:00