Logan McNaughton
c9cf91e8da
Add support for ext_shader_framebuffer_fetch
2018-04-16 11:32:35 +07:00
Logan McNaughton
c01c0d5166
use gl_LastFragDepthARM and glTextureBarrier
2018-04-13 21:24:56 +07:00
Logan McNaughton
18e9a73eba
Cache SpecialFeatures check
2018-04-07 11:30:33 +07:00
Logan McNaughton
9c73fb27b1
Remove Image Texture requirement for some shaders
2018-04-07 11:30:33 +07:00
Sergey Lipskiy
ed21ec774b
Fix TexrectDrawer when frame buffer emulation disabled.
2018-03-21 21:20:57 +07:00
Logan McNaughton
cb90bb95ed
Cleanup FB Texture caching code
2018-02-26 21:15:51 +07:00
Sergey Lipskiy
b18ae00bfd
Correct next buffer detection in FrameBufferList::renderBuffer().
...
Fixed flickering in WDC.
2018-02-18 15:33:21 +07:00
Sergey Lipskiy
9b2f50ca67
Fix rendering in widescreen resolutions when fb emulation disabled, #1700
2018-01-05 15:27:19 +07:00
Sergey Lipskiy
fbd4a9a016
Unbind FBO before clearing frame buffers list.
...
Fixed memory leak on graphics context destroy.
2017-11-19 19:55:13 +07:00
Sergey Lipskiy
26623cec1f
Code cleanup: fix issues in GLideN64 found by static code analyser.
2017-11-18 22:07:27 +07:00
Sergey Lipskiy
5a037474a2
Code cleanup: fix compilation warnings.
2017-11-15 15:07:52 +07:00
Sergey Lipskiy
bc1f2d37d4
Code cleanup: remove commented code for blur post filter.
...
It will not be refactored.
2017-10-24 20:36:08 +07:00
Sergey Lipskiy
70c540b073
Rewrite fix for #1539 : keep in tile descriptor start address of frame buffer, not pointer on it.
...
Should be more safe.
2017-09-29 22:25:56 +07:00
Sergey Lipskiy
203c53307d
Reset gDPTile::frameBuffer if it points to removed buffer.
...
Fixed Paper Mario: Red Station Crashing #1539
2017-09-29 17:20:07 +07:00
Sergey Lipskiy
57da925a14
Check for overlapping frame buffers in FrameBufferList::removeIntersections()
...
Fixed Mario Tennis - missing bottom half of scoreboard #1564
Problem:
Top Gear Hyper Bike has overlapping frame buffers.
That is start address of a buffer points on last line in previous buffer.
When new buffer intersects with prevois one, plugin removes old buffer.
That causes black screen in case of Top Gear Hyper Bike.
FrameBuffer::updateEndAddress() was modified in commit 17eb8696ea
to fix it.
It sets buffer end address using buffer height - 1.
This fix causes issue with Mario Tennis scoreboard #1564
HW buffer is not detected because end address is wrong.
Solution:
Add another test for intersecting buffers.
It checks that the buffers are not just arbitrary intersected ones,
but it is sequence of two slighly overlapping buffers.
In that case buffer is not removed, but its end address is corrected,
because buffers address space must not intersect.
2017-09-26 16:31:24 +07:00
Sergey Lipskiy
032da85357
Reset m_cleared and m_RdramCopy for depth buffer after software render.
...
Fixed #1594 Mario Tennis VS screen: line flickers
2017-09-26 15:23:07 +07:00
Sergey Lipskiy
24b041b86e
Set fullscreen scissor at the end of FrameBufferList::renderBuffer()
...
Fixed clipped screen issue with OBS studio, #1515
2017-08-08 22:49:28 +07:00
Sergey Lipskiy
c907c3013a
Implement Debugger.
2017-06-25 15:35:48 +07:00
Sergey Lipskiy
ee60040a78
Rewrite debug logging
2017-06-25 15:02:36 +07:00
Sergey Lipskiy
e9436b7136
FrameBufferList::renderBuffer() : correct Y offset in source buffer.
...
Fixed screen shake in Lode Runner 3D #301
The game uses weird way to work in interlaced mode.
2017-04-12 15:32:01 +07:00
Sergey Lipskiy
175c733d56
Code cleanup: remove unused variables.
2017-04-12 15:27:24 +07:00
Sergey Lipskiy
5e51b386f1
Make Resident Evil 2 playable.
2017-04-02 12:02:38 +07:00
Sergey Lipskiy
4f5759ef46
Fix validity check for depth buffer.
...
Fixed Pokemon Stadium Menu Items Missing (Regression) #1446
2017-03-29 17:01:59 +07:00
Sergey Lipskiy
8a1f7f1067
Revert commit 210c9ea
.
...
Fixed Majora's Mask Flickering #1434
2017-03-28 15:16:42 +07:00
Sergey Lipskiy
bce9698958
Correct FrameBuffer::init
2017-03-18 20:09:10 +07:00
Sergey Lipskiy
21d64691cf
Correct chained buffers detection in FrameBufferList::renderBuffer()
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
cb1f6e78e3
FrameBufferList::saveBuffer do not create frame buffer if buffer width is too large.
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
c53bca1e2e
Correct vOffset in FrameBufferList::renderBuffer().
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
7b3e700eed
Fix FrameBufferList::renderBuffer() when MSAA enabled.
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
0775d28065
Remove FrameBuffer::m_scaleY
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
b00a593da0
Correct GraphicsDrawer::copyTexturedRect.
...
Fixed slide effect in BAR
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
9acffe1adc
Correct FrameBufferList::renderBuffer()
...
Fixed screen shrink effect in Mia Hamm Soccer
2017-03-16 18:50:15 +07:00
Sergey Lipskiy
456459be68
Add FrameBuffer::m_isMainBuffer flag.
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
a28ca93ada
Rewrite FrameBufferList::_findBuffer
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
811dea1d77
Rewrite viewport for polygons with screen coords.
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
5f4d03fe21
Rewrite FrameBufferList::renderBuffer()
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
17eb8696ea
Correct FrameBuffer::updateEndAddress()
...
Solved problem with Top Gear Hyper Bike
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
dd11326115
Rewrite buffer height calculation.
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
e6811b4d4f
Move gDP.colorImage.height update to FrameBufferList::setBufferChanged.
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
bca21ed071
Invert y coordinate to align image origin with frame origin.
2017-03-16 18:50:14 +07:00
Sergey Lipskiy
5d5bfcc147
Correct read from RDRAM in FrameBuffer::isValid
...
Fixed out of bounds read in Pokemon Stadium 2.
2017-03-11 13:07:24 +07:00
Sergey Lipskiy
0671ea1b02
Code cleanup: correct aux buffer detection in FrameBufferList::copyAux() and FrameBufferList::removeAux()
2017-02-27 21:04:40 +07:00
Sergey Lipskiy
5a0344aa02
Code cleanup: remove redundant parameter from FrameBuffer::init.
2017-02-27 21:00:27 +07:00
Sergey Lipskiy
873a830d88
Always render to FBO, even when frame buffer emulation is disabled.
2017-02-25 14:08:26 +07:00
Sergey Lipskiy
4b040304bb
Code cleanup in FrameBufferList::renderBuffer: remove redundant casts to ObjectHandle.
2017-02-25 14:08:24 +07:00
Sergey Lipskiy
827b6bb9cd
Code refactor: replace graphics::ObjectHandle() by graphics::ObjectHandle::null
2017-02-22 16:45:27 +07:00
Sergey Lipskiy
d7407d58f9
Minor code cleanup.
2017-02-12 16:10:58 +07:00
Sergey Lipskiy
b9453474b6
Fix initialization of multisample textures.
2017-02-12 16:05:02 +07:00
Logan McNaughton
1f74b9c821
Disable N64 Depth Compare if Image Textures are unsupported
...
Also disable fragment depth writing in GLES2
2017-02-09 21:54:44 +07:00
Sergey Lipskiy
7fe2b40cad
Remove rudiments of old code for RPI.
2017-02-04 22:51:54 +07:00
Sergey Lipskiy
210c9ea64a
Do not attach depth buffer to frame buffer if same depth buffer already attached.
2017-02-03 21:28:06 +07:00
Sergey Lipskiy
4756b1eb74
Correct FrameBufferList::renderBuffer
2017-01-29 22:16:01 +07:00
Sergey Lipskiy
df4a81bfea
Add special Parameter classes to make parametrs usage more safe.
2017-01-28 16:52:09 +07:00
Sergey Lipskiy
ea4d174e5c
Correct texture initialization.
2017-01-26 21:36:54 +07:00
Sergey Lipskiy
c9f98d175c
Fix some TODO issues in FrameBuffer.cpp
2017-01-25 21:01:32 +07:00
Sergey Lipskiy
5ba4588752
Rewrite ColorBufferToRDRAM
2017-01-25 20:58:05 +07:00
Sergey Lipskiy
80ed169e24
Remove use of OpenGL.h
2017-01-22 20:43:05 +07:00
Sergey Lipskiy
4e459c7645
Change type of CachedTexture name to graphics::ObjectHandle
2017-01-21 19:48:02 +07:00
Sergey Lipskiy
f64136ff3b
Remove OpenGL from DepthBuffer.
2017-01-21 18:55:14 +07:00
Sergey Lipskiy
f147927af9
Remove OpenGL use from FrameBuffer
2017-01-21 16:35:00 +07:00
Sergey Lipskiy
ba2847fda7
FrameBufferList::renderBuffer : replace glBindFramebuffer by gfxContext.bindFramebuffer
2017-01-18 22:40:01 +07:00
Sergey Lipskiy
c5e2575722
Fixes
2017-01-16 20:56:13 +07:00
Sergey Lipskiy
e83c3489a3
Replace OGLVideo by DisplayWindow
...
Replace OGLRender by GraphicsDrawer
2017-01-16 20:56:11 +07:00
Sergey Lipskiy
09a5b414c4
Remove FBOTextureFormats usage
2017-01-16 20:56:01 +07:00
Sergey Lipskiy
43e8aef6ea
Remove old-style code.
2017-01-09 11:21:06 +07:00
Sergey Lipskiy
c39b639d7c
Remove unused shaders related files.
2017-01-08 20:31:38 +07:00
Sergey Lipskiy
dcf1065957
Add textureIndices parameters
2017-01-08 17:49:47 +07:00
Sergey Lipskiy
daf6646b97
BufferManipulationObjects 2: createRenderbuffer, initRenderbuffer
2017-01-02 22:40:41 +07:00
Sergey Lipskiy
cf5e9d8ed2
BufferManipulationObjects WIP
2017-01-02 21:00:49 +07:00
Sergey Lipskiy
7fdf97cf29
Use gfxContext in FrameBuffer
2017-01-02 00:09:19 +07:00
Sergey Lipskiy
3eb11aac82
setTextureParameters WIP
2017-01-01 21:59:54 +07:00
Sergey Lipskiy
737442b1eb
Correct depth buffer clear for aux buffers.
...
Fixed regression in NFL Quarterback Club 98
2016-12-08 23:29:08 +07:00
purplemarshmallow
d43148bc9e
add hack for framebuffer emulation in Pokemon Snap
2016-11-30 22:00:58 +07:00
Sergey Lipskiy
807622f7bf
Fix image jitter in interlaced mode.
...
Fixed regression caused by commit f2b9883
2016-11-30 20:47:32 +07:00
Sergey Lipskiy
b32d8020bb
Add black column in output as solution for "Last column problem." #1246
2016-11-24 14:38:02 +07:00
Francisco Zurita
20e4f972aa
Use glTexStorage2D for textures being attached to FBOs
...
But only for GLES 3.0 and 3.1, with OpenGL it causes issues for older
versions.
2016-11-23 00:23:19 -05:00
Francisco Zurita
b3b8eeb83e
Use configured FBO texture formats in more places.
2016-11-23 00:14:15 -05:00
Logan McNaughton
ad77e3db52
Remove some GLES3_1 ifdefs
2016-11-22 12:59:15 +07:00
Sergey Lipskiy
f2b9883681
Correct only dstY0 for lower field.
...
Fixed image jitter in topgear hyperbike
2016-11-20 19:24:34 +07:00
Sergey Lipskiy
1f5bde610a
Another correction for Xoffset
...
Fixed topgear hyperbike heavily flickering (regression) #1240
Hyper Bike has *REG.VI_WIDTH == 1152
ColorImage.width == VI.width == 576
addrOffset is multiple of ColorImage.width,
so addrOffset % (*REG.VI_WIDTH) can be equal to ColorImage.width
and image shifted out of screen.
2016-11-20 19:22:31 +07:00
Sergey Lipskiy
be6179cbcc
Revert 263ddf4
because it does not work properly on old PC cards.
2016-11-14 20:45:32 +07:00
Francisco Zurita
16262e52ad
Fix some differences between GLES2 and GLES3 code.
2016-11-14 14:01:43 +07:00
Sergey Lipskiy
263ddf4baa
Use glTexStorage2DMultisample instead of glTexImage2DMultisample for OpenGL.
...
The same code with GLES3X.
2016-11-13 11:42:14 +07:00
Francisco Zurita
7ca4d0430b
Workaround for devices where glBlitFrameBuffer produces output upside
...
down.
2016-11-04 20:27:55 +07:00
Francisco Zurita
478344ab5f
Fix some issues with multisampling which were causing GL errors
2016-11-04 20:05:23 +07:00
Sergey Lipskiy
1d87a92c72
Do not use frame buffer as texture if the buffer is just allocated.
...
Fixed tripleplay2000: black background in game #346
Problem: The game allocates auxiliary buffer with the same width
as the main one. Plugin detects it as main buffer and set its width
and height as of main buffer. Actual buffer height is half of main
buffer height, but it became known only when game switches to the
main buffer. Wrong buffer height leads to wrong calculation of
buffer address space. Game uses textures with addresses behind
the actual buffer’s address space but within calculated one.
Plugin tries to use buffer texture instead and, as the result,
everything is black.
Solution: The situation is bad. Plugin cannot detect that
allocated buffer is an aux one. I decided to forbid buffer usage
as texture if buffer is new. New buffer is blank, so reading from
it is strange. N64 games do lots of strange stuff, so this solution
is potentially dangerous.
2016-10-29 23:46:39 +07:00
Francisco Zurita
df366f0f6b
Fix verious GL errors in GLES 3.1 mode and Mario tennis.
2016-10-29 19:50:44 +07:00
Sergey Lipskiy
57dbfb5145
Revert changes in FrameBuffer::getTexture made by commit 6942083
...
These changes are incorrect and cause regression in Paper Mario fortune teller.
2016-10-25 12:27:49 +07:00
Sergey Lipskiy
85a5ae8ea1
Implement performance counter.
...
Implement drawing performance info on screen.
2016-10-08 14:53:33 +07:00
Sergey Lipskiy
aab6726117
Implement crop image feature.
2016-10-08 14:53:21 +07:00
Sergey Lipskiy
ce5abcb21b
Correct FrameBuffer::isValid - do not update m_validityChecked when isValid called from VI_UpdateScreen
...
Fixed Broken Pokemon stadium 2 in-game portraits #1149
2016-10-05 15:39:41 +07:00
Sergey Lipskiy
ff55e5bea9
Apply scissor to all input coordinates in FrameBufferList::fillRDRAM.
...
Fixed Super Smash Bros Intro not playing with Framebuffer Emulation enabled #1154
2016-10-04 21:22:20 +07:00
Sergey Lipskiy
6942083612
Disable FrameBuffer::_getSubTexture for GLES2 because GLES2 implementation of OGLRender::copyTexturedRect can't be safely used here.
2016-09-29 19:58:56 +07:00
Sergey Lipskiy
39da91bb93
Move gDPFillRDRAM to FrameBufferList::fillRDRAM
...
Correct FrameBuffer::isValid()
Code cleanup.
Fixed Mickey Speedway USA is broken again. #1132
2016-09-27 21:43:28 +07:00
Sergey Lipskiy
b5163ca048
Drop cfb flag when buffer changed.
2016-09-19 15:32:24 +07:00
Sergey Lipskiy
e28bebd17e
Add validity check for background fb textures.
...
Fixed Nushi Zuri 64: fb background doesn't work anymore #1115
Problem: The game normally uses color and depth buffers.
When it needs to show rectangle with text, CPU copies current color buffer
by depth buffer address. This buffer rendered as background, text rendered over.
Plugin detects buffer usage and tries to use depth buffer as background texture.
That buffer in video memory has no color information, because data copied by CPU and contained in RDRAM.
Solution: check that found frame buffer is valid.
In this case validity check will fail because RDRAM content modified by CPU,
and background will be read from RDRAM.
2016-09-16 17:09:25 +07:00
Sergey Lipskiy
5a296525ea
FrameBufferList::renderBuffer : correct condition for Xoffset.
2016-09-12 21:26:37 +07:00
Sergey Lipskiy
32172d30af
Fix depth buffer clear for aux buffers.
2016-09-11 18:08:03 +07:00
Sergey Lipskiy
21ef068f2a
Fix typo in FrameBuffer::getTexture
2016-09-11 15:27:59 +07:00
Sergey Lipskiy
9faeb2bfb9
Force clear depth buffer for aux buffers.
...
Fixed uncleaned depth buffer problem when depth buffer cleared partially via fillrect.
2016-09-08 22:29:12 +07:00