Commit graph

308 commits

Author SHA1 Message Date
bunnei
a008b28659 Merge pull request #1133 from lioncash/emplace-back
gl_rasterizer: Replace push_back calls with emplace_back in AddTriangle
2015-09-10 15:07:06 -04:00
Lioncash
8a3428f16c renderer_opengl: Remove unimplemented function declaration 2015-09-10 10:45:44 -04:00
Lioncash
7b72b71605 gl_rasterizer: Replace push_back calls with emplace_back in AddTriangle 2015-09-10 00:20:30 -04:00
Yuri Kunde Schlesner
b044c047c4 OpenGL: Use Sampler Objects to decouple sampler config from textures
Fixes #978
2015-09-03 15:09:51 -03:00
Yuri Kunde Schlesner
466e608c19 OpenGL: Remove ugly and endian-unsafe color pointer casts 2015-09-03 15:09:51 -03:00
Yuri Kunde Schlesner
ec28f037e6 OpenGL: Add support for Sampler Objects to state tracker 2015-09-03 15:09:50 -03:00
Yuri Kunde Schlesner
a1a5570e97 Replace the previous OpenGL loader with a glad-generated 3.3 one
The main advantage of switching to glad from glLoadGen is that, apart
from being actively maintained, it supports a customizable entrypoint
loader function, which makes it possible to also support OpenGL ES.
2015-08-30 08:45:56 -03:00
bunnei
58e9f78844 Merge pull request #1049 from Subv/stencil
Rasterizer: Corrected the stencil implementation.
2015-08-29 20:06:25 -04:00
bunnei
f3cef178e3 gl_rasterizer_cache: Detect and ignore unnecessary texture flushes. 2015-08-27 19:07:53 -04:00
Yuri Kunde Schlesner
0fcabd2b11 Integrate the MicroProfile profiling library
This brings goodies such as a configurable user interface and
multi-threaded timeline view.
2015-08-24 22:16:28 -03:00
Subv
583d777b1a HWRenderer: Added a workaround for the Intel Windows driver bug that causes glTexSubImage2D to not change the stencil buffer.
Reported here https://communities.intel.com/message/324464
2015-08-24 11:28:28 -05:00
Subv
0c7da9b815 HWRasterizer: Implemented stencil ops 6 and 7. 2015-08-21 11:05:56 -05:00
Subv
e43eb130d4 HWRasterizer: Implemented stencil op 1 (GL_ZERO) 2015-08-21 10:59:49 -05:00
Subv
46f660a789 GLRasterizer: Implemented stencil testing in the hw renderer. 2015-08-20 10:11:09 -05:00
bunnei
18527b9e21 Shader: Move shader code to its own subdirectory, "shader". 2015-08-15 17:33:42 -04:00
bunnei
642b9b5030 GPU: Refactor "VertexShader" namespace to "Shader".
- Also renames "vertex_shader.*" to "shader_interpreter.*"
2015-08-15 17:33:41 -04:00
Yuri Kunde Schlesner
254582aa35 OpenGL: Fix state tracking in situations with reused object handles
If an OpenGL object is created, bound to a binding using the state
tracker, and then destroyed, a newly created object can be assigned the
same numeric handle by OpenGL. However, even though it is a new object,
and thus needs to be bound to the binding again, the state tracker
compared the current and previous handles and concluded that no change
needed to be made, leading to failure to bind objects in certain cases.

This manifested as broken text in VVVVVV, which this commit fixes along
with similar texturing problems in other games.
2015-08-06 00:59:37 -03:00
Yuri Kunde Schlesner
ff68db61bc OpenGL: Remove redundant texture.enable_2d field from OpenGLState
All uses of this field where it's false can just set the texture id to 0
instead.
2015-08-05 22:55:22 -03:00
Yuri Kunde Schlesner
428154da45 OpenGL: Add a profiler category measuring framebuffer readback 2015-07-28 17:37:46 -03:00
Yuri Kunde Schlesner
1762267de4 OpenGL: Make OpenGL object resource wrappers fully inline
The functions are so simple that having them separate only bloats the
code and hinders optimization.
2015-07-26 10:58:58 -03:00
bunnei
cea45af64d Merge pull request #977 from yuriks/glenable-tex2d
GL Renderer: Remove erroneous glEnable(GL_TEXTURE_2D) calls
2015-07-23 10:07:35 -04:00
Subv
7b4961e968 Rasterizer/GL: Set the border color when binding a texture. 2015-07-22 18:41:37 -05:00
Yuri Kunde Schlesner
e5c4fe0098 GL Renderer: Remove erroneous glEnable(GL_TEXTURE_2D) calls
In OpenGL 3, texturing is always enabled, and this call is invalid.
While it produced no effect in the rest of the execution, it wouldn't
have the intended effect of disabling texturing for that unit. Instead
bind a null texture to the unit.
2015-07-22 01:22:09 -03:00
Subv
009e34f08a GPU: Added registers for min and mag texture filters and implemented them in the hw renderer. 2015-07-21 16:26:09 -05:00
Subv
a694caeee0 GLRasterizer: Don't try to get a pointer to the depth buffer if it doesn't exist. 2015-07-19 14:09:23 -05:00
Tony Wasserka
902fa4da52 Add CiTrace recording support.
This is exposed in the GUI as a new "CiTrace Recording" widget.

Playback is implemented by a standalone 3DS homebrew application (which only runs reliably within Citra currently; on an actual 3DS it will often crash still).
2015-07-13 22:27:20 +02:00
Tony Wasserka
ae7120f5d9 Merge pull request #907 from Lectem/clamp_to_border
Add GL_CLAMP_TO_BORDER support.
2015-07-12 03:19:46 +02:00
Lectem
58d1c6398e Added GL_CLAMP_TO_BORDER support 2015-07-09 22:23:26 +02:00
Emmanuel Gil Peyrot
4964a359e1 Core: Cleanup hw includes. 2015-06-28 00:46:39 +01:00
Emmanuel Gil Peyrot
f48b28ad27 Core, VideoCore: Replace or fix exit() calls. 2015-06-28 00:36:55 +01:00
Emmanuel Gil Peyrot
596b7c4f63 Common: Cleanup key_map includes. 2015-06-28 00:36:54 +01:00
Emmanuel Gil Peyrot
94fc644430 VideoCore: Log the GL driver’s vendor and renderer. 2015-06-16 00:02:23 +01:00
tfarley
26bc816d7a Renderer formatting edits 2015-06-08 19:19:15 -04:00
tfarley
66b0d799ee Render-to-texture flush, interval math fix 2015-06-08 19:18:20 -04:00
tfarley
5025b35563 Liberal texture unbind (clout menu) 2015-06-08 19:18:19 -04:00
tfarley
fa2c92a3ac Depth format fix (crush3d intro/black screens) 2015-06-08 19:18:18 -04:00
tfarley
d42275f11c Implemented glColorMask 2015-06-08 19:18:17 -04:00
archshift
0414ad20cb Merge pull request #811 from archshift/commonify
Commonify video_core utility headers
2015-05-31 09:55:29 -07:00
bunnei
33b9abb91e Pica: Use zero for the SecondaryFragmentColor source.
- This is a workaround until we support fragment lighting.
2015-05-31 01:52:42 -04:00
bunnei
e6ace38815 Pica: Implement LogicOp function. 2015-05-31 01:52:41 -04:00
archshift
76690392bf Move video_core/color.h to common/color.h 2015-05-30 11:17:37 -07:00
archshift
5df2d1b5f7 Move video_core/math.h to common/vector_math.h
The file only contained vector manipulation code, and such widely-useable code doesn't belong in video_core.
2015-05-30 11:17:36 -07:00
Emmanuel Gil Peyrot
b1503b2020 Remove every trailing whitespace from the project (but externals). 2015-05-29 21:59:29 +01:00
Lioncash
951353558e gl_state: Remove unnecessary const specifier on Apply 2015-05-23 00:58:32 -04:00
bunnei
1b42d55a9d Pica: Create 'State' structure and move state memory there. 2015-05-22 22:59:42 -04:00
Lioncash
23d5df9d9c gl_state: Fix a condition typo in Apply 2015-05-22 19:49:12 -04:00
tfarley
05dc633a8c OpenGL renderer 2015-05-22 15:51:18 -07:00
Yuri Kunde Schlesner
7ada357b2d Memmap: Re-organize memory function in two files
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
2015-05-15 00:04:38 -03:00
Yuri Kunde Schlesner
17a8cae003 Memory: Add GetPhysicalPointer helper function 2015-05-09 04:02:32 -03:00
Yuri Kunde Schlesner
e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
archshift
cae89fb315 Allow the user to set the background clear color during emulation
The background color can be seen at the sides of the bottom screen or when the window is wider than normal.
2015-04-03 15:35:51 -07:00
bunnei
b56829df02 Merge pull request #629 from archshift/lcdfb
Implement SetLcdForceBlack and add implementation for color filling in the GPU code
2015-03-10 18:08:55 -04:00
archshift
041e99b613 Added LCD registers, and implementation for color filling in OGL code. 2015-03-09 15:51:41 -07:00
bunnei
06bf471581 Merge pull request #636 from bunnei/refactor-screen-win
Set framebuffer layout from EmuWindow.
2015-03-07 18:18:40 -05:00
bunnei
9960c49c21 Set framebuffer layout from EmuWindow. 2015-03-07 17:21:19 -05:00
Yuri Kunde Schlesner
cd1fbfcf1b Add profiling infrastructure and widget 2015-03-01 21:47:13 -03:00
Emmanuel Gil Peyrot
c439b3074d video_core: Implement the remaining framebuffer formats in the OpenGL renderer. 2015-02-15 14:08:12 +00:00
archshift
ef24e72b26 Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)

Also removed some GEKKO cruft.
2015-02-10 18:30:31 -08:00
Yuri Kunde Schlesner
5961a2852d GSP: Update framebuffer info on all interrupts
Hardware testing determined that the GSP processes shared memory
framebuffer update info even when no memory transfer or filling GX
commands are used. They are now updated on every interrupt, which isn't
confirmed correct but matches hardware behaviour more closely.

This also reverts the hack introduced in #404. It made a few games
behave better, but I believe it's incorrect and also breaks other games.
2015-01-14 05:20:12 -02:00
bunnei
f7a3f45f1e GSP: Toggle active framebuffer each frame 2015-01-07 18:06:00 -05:00
bunnei
0de6a08d75 Merge pull request #291 from purpasmart96/license
License change
2014-12-21 16:05:44 -05:00
purpasmart96
ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Chin
e795692614 Clean up some warnings 2014-12-20 10:03:36 -05:00
Yuri Kunde Schlesner
0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
Rohit Nirmal
8a62423970 Change NULLs to nullptrs. 2014-12-03 12:57:57 -06:00
bunnei
63b1453dd8 Merge pull request #236 from rohit-n/sign-compare
Silence a few -Wsign-compare warnings.
2014-12-03 10:04:47 -05:00
Rohit Nirmal
f9b53c3e94 Silence a few -Wsign-compare warnings. 2014-11-30 22:29:23 -06:00
vaguilar
95b33ee0a7 Fixed viewport error caused by rounding 2014-11-30 09:53:50 -08:00
Emmanuel Gil Peyrot
739bb58c3a Remove tabs in all files except in skyeye imports and in generated GL code 2014-11-19 09:04:03 +00:00
Tony Wasserka
c5c6e095f0 OpenGL Renderer: Cleanup viewport extent calculation. 2014-11-18 13:09:01 +01:00
Tony Wasserka
bd8f491e4c Fixup EmuWindow interface and implementations thereof. 2014-11-18 13:09:01 +01:00
Kevin Hartman
221a9b023d Viewport scaling and display density independence
The view is scaled to be as large as possible, without changing the aspect, within the bounds of the window.
On "retina" displays, or other displays where window units != pixels, the view should no longer draw incorrectly.
2014-11-18 13:06:05 +01:00
Yuri Kunde Schlesner
d72708c1f5 Add override keyword through the code.
This was automated using `clang-modernize`.
2014-10-26 16:18:05 -02:00
Yuri Kunde Schlesner
15c59f3974 Only check OpenGL shader log if size is >1.
This prevents a crash when the buffer size returned by the driver is 0,
in which case no space is allocated to store even the NULL byte and
glGetShaderInfoLog errors out.

Thanks to @Relys for the bug report.
2014-10-21 16:07:39 -02:00
Yuri Kunde Schlesner
11642fd3a2 Rework OpenGL renderer.
The OpenGL renderer has been revised, with the following changes:
 - Initialization and rendering have been refactored to reduce the number of
   redundant objects used.
 - Framebuffer rotation is now done directly, using texture mapping.
 - Vertex coordinates are now given in pixels, and the projection matrix
   isn't hardcoded anymore.
2014-10-12 14:38:53 +02:00
Yuri Kunde Schlesner
5f598a5e2c OpenGL renderer: Shuffle initialization code around and rename functions. 2014-10-12 14:37:24 +02:00
Yuri Kunde Schlesner
787a1b047c Remove virtual inheritance from RendererOpenGL
Also make destructor virtual so that instances are properly destructed.
2014-10-12 14:37:24 +02:00
bunnei
5481115e71 Merge pull request #97 from archshift/cleanup
Small, general code cleanup
2014-09-13 22:58:58 -04:00
archshift
8fe5f2e2fe Moved common_types::Rect from common to Common namespace 2014-09-08 15:43:36 -07:00
archshift
81baa477b5 renderer_opengl.cpp: improved alignment for readability 2014-09-07 12:09:02 -07:00
Yuri Kunde Schlesner
478289140d Replace GLEW with a glLoadGen loader.
This should fix the GL loading errors that occur in some drivers due to
the use of deprecated functions by GLEW. Side benefits are more accurate
auto-completion (deprecated function and symbols don't exist) and faster
pointer loading (less entrypoints to load). In addition it removes an
external library depency, simplifying the build system a bit and
eliminating one set of binary libraries for Windows.
2014-09-01 17:41:56 -03:00
Yuri Kunde Schlesner
9d172ab550 Downgrade GLSL version to 1.50 (compatible with GL 3.2) 2014-08-28 05:38:13 -03:00
bunnei
20d169e4a1 VideoCore: Fixes rendering issues on Qt and corrects framebuffer output size. 2014-08-26 17:34:52 -04:00
Kevin Hartman
cbfd6b6e52 Rewrite of OpenGL renderer, including OS X support
Screen contents are now displayed using textured quads. This can be updated to expose an FBO once an OpenGL backend for when Pica rendering is being worked on. That FBO's texture can then be applied to the quads.

Previously, FBO blitting was used in order to display screen contents, which did not work on OS X. The new textured quad approach is less of a compatibility risk.
2014-08-25 20:56:59 -07:00
Tony Wasserka
7b6a7d7dfb Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.
This cleans up the mess that address reading/writing had become and makes the code a *lot* more sensible.
This adds a physical<->virtual address converter to mem_map.h. For further accuracy, we will want to properly extend this to support a wider range of address regions. For now, this makes simply homebrew applications work in a good manner though.
2014-08-12 13:32:56 +02:00
Tony Wasserka
9c781a6c76 Remove the fancy RegisterSet class introduced in 4c2bff61e.
While it was some nice and fancy template usage, it ultimately had many practical issues regarding length of involved expressions under regular usage as well as common code completion tools not being able to handle the structures.
Instead, we now use a more conventional approach which is a lot more clean to use.
2014-08-12 02:17:21 +02:00
Tony Wasserka
9fd2537e93 Use uniform formatting when printing hexadecimal numbers. 2014-07-23 00:44:31 +02:00
Tony Wasserka
246cb75584 RegisterSet: Simplify code by using structs for register definition instead of unions. 2014-07-23 00:33:08 +02:00
Tony Wasserka
75775e9ef4 GPU: Make use of RegisterSet. 2014-07-23 00:33:08 +02:00
Tony Wasserka
c6fdeb7b23 Renderer: Fix component order in bottom framebuffer. 2014-07-23 00:33:08 +02:00
Tony Wasserka
cb6f97b2eb Renderer: Respect the active_fb GPU register. 2014-07-23 00:33:08 +02:00
Tony Wasserka
9b96407e8e Renderer: Add a few TODOs. 2014-07-23 00:33:08 +02:00
Tony Wasserka
1dfa392824 Rename LCD to GPU. 2014-06-12 06:10:49 -04:00
archshift
5a8ed196e6 common_types: Changed BasicRect back to Rect, in the common namespace
Only Rect is in the namespace for now; the rest of common should be added in the future
2014-05-19 17:57:35 -07:00
archshift
b8c8d0903e Merge remote-tracking branch 'upstream/master' into issue-7-fix 2014-05-16 23:21:03 -07:00
Sethpaien
e1fcb2fdfb Update FlipFramebuffer
Less calculations + fix
2014-05-08 18:05:30 +02:00
archshift
948cfe6d37 Reverse debugging changes 2014-04-30 20:00:44 -07:00
archshift
fb47258af7 TGA dumps work, courtesy of @bunnei 2014-04-30 18:34:49 -07:00
archshift
48deb45624 Xcode complains that the class name is redundant. 2014-04-27 22:23:01 -07:00
archshift
ff48c8bed3 Rect to BasicRect
Somewhere along the line an OSX header had already taken the name Rect.
2014-04-27 22:21:46 -07:00
bunnei
a48c6b947d removed DISALLOW_COPY_AND_ASSIGN in favor of NonCopyable class 2014-04-27 18:29:51 -04:00
bunnei
1142ccba03 fixed renderer to use correct framebuffer location 2014-04-27 12:42:01 -04:00
bunnei
7a080551ac fixed GL context acquire (applies to Qt GUI only) 2014-04-21 22:00:32 -04:00
bunnei
70c2cce963 renamed hw_lcd module to just lcd 2014-04-17 23:48:23 -04:00
bunnei
9d5a561c1b fixed framebuffer color order 2014-04-17 17:47:34 -04:00
bunnei
d4411acfd0 removed hard-coded framebuffer addresses from renderer_opengl.cpp 2014-04-16 21:30:10 -04:00
bunnei
de0a034a84 fixed project includes to use new directory structure 2014-04-08 20:15:08 -04:00
bunnei
63e46abdb8 got rid of 'src' folders in each sub-project 2014-04-08 19:25:03 -04:00