Commit graph

781 commits

Author SHA1 Message Date
Yuri Kunde Schlesner d9a904f9cb VideoCore: Shader interpreter cleanups 2016-09-29 21:15:49 -07:00
Yuri Kunde Schlesner 26b68313b9 VideoCore: Fix out-of-bounds read in ShaderSetup::ProduceDebugInfo
As far as I can tell, memset was replaced by a fill without correcting
the parameter type, causing an out-of-bounds array read in the Vec4
constructor.
2016-09-29 21:11:36 -07:00
Yuri Kunde Schlesner 01667d9a35 OpenGL: Take cached viewport sub-rect into account for scissor
Fixes #1938
2016-09-29 20:55:24 -07:00
wwylele d2419570b9 rasterizer: separate TextureCopy from DisplayTransfer 2016-09-29 10:01:34 +08:00
Yuri Kunde Schlesner f120e78b56 Remove special rules for Windows.h and library includes 2016-09-21 00:16:33 -07:00
Yuri Kunde Schlesner 84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
Yuri Kunde Schlesner a3afeb4687 VideoCore: Fix dangling lambda context in shader interpreter
The static meant that after the first execution, these lambda context
would be pointing to a random location on the stack. Fixes a random
crash when using the interpreter.
2016-09-15 22:15:11 -07:00
bunnei 09063dc5bb Merge pull request #2032 from bunnei/qt-graphics
Qt graphics configure & V-Sync option
2016-08-31 22:20:54 -04:00
Jannik Vogel 7a79fa7a90 OpenGL: Avoid error on unsupported lighting LUT 2016-08-30 19:30:26 +02:00
bunnei 08ad9b36d4 config: Add a setting for graphics V-Sync. 2016-08-29 21:42:30 -04:00
Yuri Kunde Schlesner ecf6ecf325 OpenGL: Add scaled resolution support to scissor 2016-06-27 22:16:04 -07:00
Yuri Kunde Schlesner f0b9bc14b6 PICA: Scissor fixes and cleanups 2016-06-27 21:14:39 -07:00
Subv f9be06b15f PICA: Implement scissor test 2016-06-27 21:14:13 -07:00
scurest 0f9274fe24 Remove superfluous std::move in return std::move(local_var) 2016-06-25 13:26:21 -05:00
Jannik Vogel a12571c709 OpenGL: Implement fog 2016-06-07 00:06:28 +02:00
Jannik Vogel ebee2513a9 Rasterizer: Implement fog 2016-06-07 00:06:28 +02:00
Jannik Vogel 57855a1701 Pica: Add fog state 2016-06-07 00:06:28 +02:00
Jannik Vogel c900c092e3 OpenGL: Avoid undefined behaviour for UNIFORM_BLOCK_DATA_SIZE 2016-06-07 00:06:28 +02:00
mailwl 07cc781163 gsp::gpu: Reset g_thread_id in UnregisterInterruptRelayQueue 2016-06-01 09:40:15 +03:00
bunnei 552018c50a Merge pull request #1812 from JayFoxRox/refactor-shader
Retrieve shader result from new OutputRegisters-type
2016-05-31 18:12:56 -04:00
bunnei 201a7af92a Merge pull request #1846 from JayFoxRox/missing-dirty-lighting
OpenGL: Set shader_dirty on lighting changes
2016-05-26 17:35:12 -04:00
bunnei a316fbb15a Merge pull request #1733 from lioncash/vert_loader
VertexLoader: Minor changes
2016-05-23 21:13:34 -04:00
Jannik Vogel 6a28f46844 OpenGL: Set shader_dirty on lighting changes 2016-05-23 23:28:13 +02:00
Jannik Vogel 30a01584f2 Pica: Name LightSrc.config register 2016-05-23 23:28:13 +02:00
Jannik Vogel 8e905b3af6 Pica: Name lighting.config0 and .config1 registers 2016-05-23 23:28:13 +02:00
Jannik Vogel 068bd6f728 OpenGL: Use uniforms for dist_atten_bias and dist_atten_scale 2016-05-23 23:28:13 +02:00
Jannik Vogel d77279a415 Refactor Tev stage dumper 2016-05-21 03:11:27 +02:00
Jannik Vogel 324c21c922 Extend Tev stage dumper 2016-05-21 03:08:59 +02:00
bunnei e5599ed300 Merge pull request #1786 from JayFoxRox/blend-equation
OpenGL: Support blend equation
2016-05-16 20:00:21 -04:00
Jannik Vogel ff0fa86b17 Retrieve shader result from new OutputRegisters-type 2016-05-16 18:55:51 +02:00
linkmauve f40fabd688 Merge pull request #1787 from JayFoxRox/refactor-jit
Refactor JIT
2016-05-16 17:54:45 +01:00
Jannik Vogel 5389dedfa1 OpenGL: Only update depth uniforms if the depth changed 2016-05-14 10:31:18 +02:00
Jannik Vogel f8a11a664f OpenGL: value-initialize variables which cause uninitialised access otherwise 2016-05-14 10:16:11 +02:00
Jannik Vogel 1308afe2c2 Use new shader-jit signature for interpreter 2016-05-13 09:41:55 +02:00
Jannik Vogel 4e01e9ffc5 Refactor access to state in shader-jit 2016-05-13 09:20:14 +02:00
Jannik Vogel 5864cb7e00 OpenGL: Support blend equation 2016-05-12 22:57:40 +02:00
Jannik Vogel 7e756faaba Move program_counter and call_stack from UnitState to interpreter 2016-05-12 19:05:42 +02:00
Jannik Vogel 6c6d99ca51 Move default_attributes into Pica state 2016-05-12 19:05:41 +02:00
bunnei f6eb62d062 Merge pull request #1690 from JayFoxRox/tex-type-3
Pica: Implement texture type 3 (Projection2D)
2016-05-11 21:47:08 -04:00
Jannik Vogel ae7a82fa1c Turn ShaderSetup into struct 2016-05-11 23:48:24 +02:00
Jannik Vogel 5a7306d6df OpenGL: Implement texture type 3 2016-05-11 08:07:37 +02:00
Jannik Vogel 4311297eb1 Rasterizer: Implement texture type 3 2016-05-11 08:07:36 +02:00
Jannik Vogel 2f8e8e1455 Pica: Add tc0.w to OutputVertex 2016-05-11 08:07:36 +02:00
Jannik Vogel 9cfebb9334 Pica: Add texture type to state 2016-05-11 08:07:36 +02:00
bunnei 86ecbdfa4d Merge pull request #1621 from JayFoxRox/w-buffer
Implement W-buffer and fix depth-mapping
2016-05-10 23:00:40 -04:00
Lioncash 75e5d0a6a0 gl_rasterizer: Fix compilation for debug builds 2016-05-10 09:22:02 -04:00
Jannik Vogel fc9cc21024 OpenGL: Implement W-Buffers and fix depth-mapping 2016-05-10 08:58:52 +02:00
Jannik Vogel 4c98113b57 Pica: Implement W-Buffer in SW rasterizer 2016-05-10 08:58:52 +02:00
linkmauve 006fe5fc0f Merge pull request #1704 from JayFoxRox/pod-config
Pica: PicaShaderConfig is TC and cleared before use
2016-05-10 01:16:53 +01:00
Lioncash 6d5f2a3cff vertex_loader: Correct forward declaration of InputVertex
It's actually a struct, not a class.
2016-05-08 23:08:18 -04:00
Lioncash 5587383eb7 vertex_loader: Provide an assertion for ensuring the loader has been setup
Also adds an assert to ensure that Setup is not called more than once
during a VertexLoader's lifetime.
2016-05-08 23:08:12 -04:00
Lioncash 1357724cd9 vertex_loader: Add constructors to facilitate immediate and two-step initialization 2016-05-08 23:03:32 -04:00
Lioncash 769f4a7018 vertex_loader: initialize_num_total_attributes.
Keeps the public API sane.
2016-05-08 23:03:32 -04:00
Lioncash 8ea5e7dfb5 vertex_loader: Use std::array instead of raw C arrays 2016-05-08 23:03:32 -04:00
Lioncash a286b61f75 vertex_loader: Correct header ordering 2016-05-08 23:01:26 -04:00
Alexander Laties 0a31e373f1 fixup simple type conversions where possible 2016-05-07 11:41:55 -04:00
Emmanuel Gil Peyrot aa4d4ff23c Frontends, VideoCore: Move glad initialisation to the frontend
On SDL2 this allows it to use SDL_GL_GetProcAddress() instead of the
default function loader, and fixes a crash when using apitrace with an
EGL context.

On Qt we will need to migrate from QGLWidget to QOpenGLWidget and
QOpenGLContext before we can use gladLoadGLLoader() instead of
gladLoadGL(), since the former doesn’t expose a function loader.
2016-05-06 03:10:14 +01:00
Jannik Vogel 7a77b8356c Pica: Rename VertexLoaded breakpoint to VertexShaderInvocation 2016-05-04 10:21:51 +02:00
Jannik Vogel f74652d2fe Pica: Use a union for PicaShaderConfig 2016-05-03 15:06:49 +02:00
Jannik Vogel 5fc8eb227a Pica: Add TevStageConfigRaw to PicaShaderConfig (MSVC workaround) 2016-05-03 15:06:46 +02:00
Jannik Vogel f3f7018c9e Pica: Make PicaShaderConfig trivially_copyable and clear it before use 2016-05-03 14:10:11 +02:00
Jannik Vogel 5ec1140f8b OpenGL: Don't copy const_color (Reverts #1745) 2016-05-03 12:34:52 +02:00
Jannik Vogel 696cb197a5 Pica: Replace logic in shader.cpp with loop 2016-05-03 01:40:47 +02:00
bunnei 15d0e98267 Merge pull request #1741 from linkmauve/iwyu-video_core
Fix video_core includes (and dependencies) using include-what-you-use
2016-05-01 17:44:57 -04:00
Jannik Vogel 7e0d6903ff OpenGL: Copy TevStageConfig using a loop. Fixes bug: const_color not copied 2016-05-01 16:35:54 +02:00
Jannik Vogel aab41604f7 OpenGL: border_color was never set. Fixed. (#1740) 2016-04-30 12:20:23 -07:00
Emmanuel Gil Peyrot 691a42fe98 VideoCore: Run include-what-you-use and fix most includes. 2016-04-30 17:02:41 +01:00
Jannik Vogel 49bfe9bf91 Remove TGA dumper 2016-04-30 09:43:59 +02:00
bunnei 90243c56fb Merge pull request #1730 from hrydgard/vertex-loader
* Remove late accesses to attribute_config

* Refactor: Extract VertexLoader from command_processor.cpp.

Preparation for a similar concept to Dolphin or PPSSPP. These can be JIT-ed and cached.

* Move "&" to their proper place, add missing includes and make some properly relative.

* Don't keep base_address in the loader, it doesn't belong there (with it, the loader can't be cached).

* Optimize the vertex loader, nearly doubling its speed.

* Debugger fix

* Move and rename the MemoryAccesses class to MemoryAccessTracker.
2016-04-29 09:42:47 -04:00
Yuri Kunde Schlesner e3a8292495 Common: Remove section measurement from profiler (#1731)
This has been entirely superseded by MicroProfile. The rest of the code
can go when a simpler frametime/FPS meter is added to the GUI.
2016-04-29 00:07:10 -07:00
Henrik Rydgard a86d7cacc1 Move and rename the MemoryAccesses class to MemoryAccessTracker. 2016-04-29 08:50:21 +02:00
Henrik Rydgard a442ee07f4 Debugger fix 2016-04-28 22:30:01 +02:00
Henrik Rydgard 251f29dd7f Optimize the vertex loader, nearly doubling its speed. 2016-04-28 22:21:39 +02:00
Henrik Rydgard 2403e86cbb Don't keep base_address in the loader, it doesn't belong there (with it, the loader can't be cached). 2016-04-28 20:17:35 +02:00
Henrik Rydgard d00e2340c6 Move "&" to their proper place, add missing includes and make some properly relative. 2016-04-28 19:40:11 +02:00
Henrik Rydgard 47ff008817 Refactor: Extract VertexLoader from command_processor.cpp.
Preparation for a similar concept to Dolphin or PPSSPP. These can be JIT-ed and cached.
2016-04-28 19:05:55 +02:00
Henrik Rydgard 0cf15f64ef Remove late accesses to attribute_config 2016-04-28 18:07:34 +02:00
bunnei 15c907317c Merge pull request #1710 from hrydgard/optimize-event-breakpoints
Replace std::map with std::array for graphics event breakpoints
2016-04-25 21:37:43 -04:00
Sam Spilsbury 656a442433 shader: Shader size is long uint, not uint. 2016-04-25 00:40:03 +08:00
Sam Spilsbury c6709d97bc shader: Handle non-CALL opcodes with a break 2016-04-25 00:39:54 +08:00
Sam Spilsbury bbffa6ad69 shader: Format string must be provided inline and not as a variable 2016-04-24 23:40:52 +08:00
Henrik Rydgard 01a1555b5d Replace std::map with std::array for graphics event breakpoints, and allow the compiler to inline. Saves 1%+ in vertex heavy situations. 2016-04-24 14:19:49 +02:00
Sam Spilsbury 39d4994c15 pica: Handle default lighting case 2016-04-23 11:54:02 +08:00
tfarley 562f36a144 HWRasterizer: reorder declarations to match defs 2016-04-22 10:52:02 -04:00
tfarley 3268cab26b HWRasterizer: sync specular uniform for new shaders 2016-04-22 10:48:00 -04:00
bunnei bab30bcd6e Merge pull request #1436 from tfarley/hw-tex-forwarding
Hardware Renderer Texture Forwarding
2016-04-22 08:15:51 -04:00
tfarley 22f3a7e94c HWRasterizer: Texture forwarding 2016-04-21 17:27:56 -04:00
tfarley e46d086189 Config: Add scaled resolution option 2016-04-21 17:27:48 -04:00
bunnei 14cc1ed911 Merge pull request #1655 from JayFoxRox/hw-dot3
OpenGL: Implement color combiner Operation::Dot3_RGB
2016-04-21 16:39:36 -04:00
bunnei 142a5dc3f5 Merge pull request #1625 from JayFoxRox/sw-blend-func
Rasterizer: Allow all blend factors for alpha blend-func
2016-04-17 20:20:15 -04:00
Jannik Vogel e2b63a2dd7 Rasterizer: Allow all blend factors for alpha blend-func 2016-04-17 22:44:24 +02:00
Lioncash 4501a9eb50 debug_utils: use std::make_unique for initializing PicaTrace 2016-04-14 22:05:28 -04:00
bunnei aff35d3e58 Merge pull request #1665 from lioncash/file
IOFile: Minor API changes
2016-04-14 16:28:15 -04:00
bunnei d7fe2784cc shader_jit_x64: Rename RuntimeAssert to Compile_Assert. 2016-04-13 23:04:53 -04:00
bunnei 3f623b2561 shader_jit_x64.cpp: Rename JitCompiler to JitShader. 2016-04-13 23:04:53 -04:00
bunnei 847fb951e2 shader_jit_x64: Free memory that's no longer needed after compilation. 2016-04-13 23:04:52 -04:00
bunnei 60aa72e117 shader_jit_x64: Use a sorted vector instead of a set for keeping track of return addresses. 2016-04-13 23:04:52 -04:00
bunnei 60749f2cda shader_jit_x64: Use CALL/RET instead of JMP for subroutines. 2016-04-13 23:04:52 -04:00
bunnei 1d45b57939 shader_jit_x64: Separate initialization and code generation for readability. 2016-04-13 23:04:50 -04:00
bunnei 6e0319eec9 shader_jit_x64: Get rid of unnecessary last_program_counter variable. 2016-04-13 23:04:49 -04:00
bunnei f3afe24594 shader_jit_x64: Execute certain asserts at runtime.
- This is because we compile the full shader code space, and therefore its common to compile malformed instructions.
2016-04-13 23:04:49 -04:00
bunnei ffcf7ecee9 shader: Remove unused 'state' argument from 'Setup' function. 2016-04-13 23:04:48 -04:00
bunnei a5a74eb121 shader_jit_x64: Specify shader main offset at runtime. 2016-04-13 23:04:47 -04:00
bunnei c9d10de644 shader_jit_x64: Allocate each program independently and persist for emu session. 2016-04-13 23:04:47 -04:00
bunnei 4632791a40 shader_jit_x64: Rewrite flow control to support arbitrary CALL and JMP instructions. 2016-04-13 23:04:44 -04:00
bunnei 135aec7bea shader_jit_x64: Fix strict memory aliasing issues. 2016-04-13 23:04:43 -04:00
Lioncash a4120ca66c file_util: Don't expose IOFile internals through the API 2016-04-13 20:17:17 -04:00
Jannik Vogel ff7c798d86 Pica: Remove geometry dumper (PICA_DUMP_GEOMETRY) 2016-04-10 22:07:06 +02:00
Jannik Vogel 0ad050f85d OpenGL: Implement color combiner Operation::Dot3_RGB 2016-04-10 15:31:24 +02:00
Jannik Vogel 35a92b4097 OpenGL: Respect buffer-write allow registers 2016-04-08 22:57:11 +02:00
Jannik Vogel c6bbc41984 OpenGL: Split buffer-write mask sync into seperate functions 2016-04-08 22:42:44 +02:00
Jannik Vogel fa24df7340 Rasterizer: Respect buffer-write allow registers 2016-04-08 22:35:22 +02:00
Jannik Vogel d47605b2ed OpenGL: Keep stencil-test and framebuffer.depth_format in sync 2016-04-08 22:35:17 +02:00
bunnei 6e750ae12d Merge pull request #1639 from linkmauve/fix-double-framebuffer-check
OpenGL: Fix a double framebuffer completeness checks.
2016-04-07 19:52:02 -04:00
Mathew Maidment aa6380e5bc Merge pull request #1643 from MerryMage/make_unique
Common: Remove Common::make_unique, use std::make_unique
2016-04-05 20:10:11 -04:00
MerryMage a06dcfeb61 Common: Remove Common::make_unique, use std::make_unique 2016-04-05 13:31:17 +01:00
Emmanuel Gil Peyrot 3219be8ee0 OpenGL: Fix a double framebuffer completeness checks. 2016-04-03 17:00:44 +01:00
Jannik Vogel 693cbc1f8f OpenGL: Check for framebuffer completeness 2016-04-03 17:06:05 +02:00
Jannik Vogel c26b141407 Avoid warnings by casting to size_t for ARRAY_SIZE() comparisons 2016-04-01 02:14:43 +02:00
Yuri Kunde Schlesner 81004211dd Pica: Improve accuracy of immediate-mode support
This partially fixes Etrian Odyssey IV.
2016-03-23 20:18:40 -07:00
Yuri Kunde Schlesner 0c447e0a06 OpenGL: Don't attempt to draw empty triangle batches
Our code did not handle this well, causing random crashes in some
situations.
2016-03-23 20:02:05 -07:00
bunnei ebbba0d381 Merge pull request #1508 from JayFoxRox/vs-output-map
Respect vs output map
2016-03-22 11:59:12 -04:00
bunnei 784c5539ea Merge pull request #1538 from lioncash/dot
shader_interpreter: use std::inner_product for the dot product
2016-03-20 00:35:06 -04:00
bunnei 58852bedbf Merge pull request #1535 from JayFoxRox/fix-align
PICA: Alignment happens locally in vertex
2016-03-17 20:00:00 -04:00
Lioncash 63e956cc7a video_core: Don't cast away const 2016-03-17 02:01:38 -04:00
Lioncash 4d89df8df2 shader_interpreter: use std::inner_product for the dot product
Same thing, less code.
2016-03-17 01:00:30 -04:00
Lioncash c928b04eee core/video_core: Make NumIds functions constexpr 2016-03-17 00:29:47 -04:00
Lioncash 39baad9926 core/video_core: Don't cast away const in subscript operators
Not to say these subscript operators aren't totally ugly as is.
2016-03-17 00:27:15 -04:00
Jannik Vogel 7eef9ebc3b PICA: Alignment happens locally in vertex 2016-03-17 02:24:20 +01:00
bunnei 55f24e1cf4 Merge pull request #1519 from JayFoxRox/vp-offset-fix
PICA: Fix viewport offset
2016-03-16 14:19:53 -04:00
bunnei 96cafbe4cc Merge pull request #1503 from bunnei/clear-jit-cache
Clear JIT cache
2016-03-16 13:18:51 -04:00
Jannik Vogel 9aad2f29bb PICA: Fix MAD/MADI encoding 2016-03-15 20:01:25 +01:00
Jannik Vogel 964cfaea47 PICA: Fix viewport offset 2016-03-14 18:37:33 +01:00
Jannik Vogel f746a00964 Respect vs output map 2016-03-14 13:03:34 +01:00
Jannik Vogel a66c186e81 PICA: Align vertex attributes 2016-03-13 04:54:23 +01:00
bunnei 6efb710b28 shader_jit_x64: Clear cache after code space fills up. 2016-03-12 12:15:49 -05:00
bunnei c103759cdc shader_jit_x64: Make assert outputs more useful & cleanup formatting. 2016-03-12 12:06:28 -05:00
bunnei 46f78b7f19 shader: Update log message to use proper log class. 2016-03-12 12:03:32 -05:00
Yuri Kunde Schlesner 305e63d9ea Merge pull request #1475 from lioncash/align
Common: Get rid of alignment macros
2016-03-09 20:08:38 -08:00
bunnei 4a2d1571bc Merge pull request #1474 from lioncash/renderer
renderer_base: Minor changes
2016-03-09 10:57:38 -05:00
Lioncash 88d604383e Common: Get rid of alignment macros
The gl rasterizer already uses alignas,
so we may as well move everything over.
2016-03-09 01:31:14 -05:00
bunnei 8530a2d7df Merge pull request #1344 from LittleWhite-tb/error-output
Output errors in GUI
2016-03-08 23:12:04 -05:00
Lioncash 4b5b32e721 renderer_base: In-class initialize variables 2016-03-08 21:46:47 -05:00
Lioncash be913040a8 render_base: Clarify/normalize getter functions 2016-03-08 21:45:24 -05:00
Lioncash bf76afc68d renderer_base: Don't directly expose the rasterizer unique_ptr
There's no reason to allow direct access to the unique_ptr instance. Only
its contained pointer.
2016-03-08 21:31:44 -05:00
LittleWhite 4be68dddfb Improve error report from Init() functions
Add error popup when citra initialization failed
2016-03-08 22:05:25 +01:00
Yuri Kunde Schlesner c58bc25d5b Pica: Write depth value even when depth test is disabled
This has been confirmed on hardware. Fixes Etrian Odyssey IV.
2016-03-05 20:16:20 -08:00