Compare commits

..

1415 Commits

Author SHA1 Message Date
Zangetsu38 e60edb56ae Debug 2017-10-11 00:37:20 +02:00
Zangetsu38 92ad64cae3 d3d12: Update minidx12 SDK on build 15.063. 2017-10-11 00:37:20 +02:00
Jake d47183e89e rsx: invalidate cache every frame: invalidate unbound rtt's in surface store 2017-10-11 00:37:20 +02:00
Zangetsu38 ff55752445 Update Project to Visual Studio 2017. 2017-10-11 00:37:19 +02:00
Zangetsu38 8fc9930c3b Update Submodule GSL 2017-10-11 00:37:19 +02:00
Zangetsu38 d930ecbf40 Some Change in Gui. 2017-10-11 00:37:19 +02:00
Nekotekina 6448924163 Allow shader cache dialog cancellation 2017-10-11 00:37:19 +02:00
Nekotekina d72f5247f9 Optimize PPU module loading
I'm garbage 🤦
2017-10-11 00:37:19 +02:00
Nekotekina 25aefb580b Fix instruction editor a bit 2017-10-11 00:37:19 +02:00
Nekotekina 64bbf3f9df Add PPU instruction stat dumper
Needs PPU Debug option to activate and PPU Interpreter
Dumps after Resume (after Pause)
Fix utils::memory_decommit, clean vm.cpp
2017-10-11 00:37:19 +02:00
kd-11 a3c436a5c2 vk: Better vsync mode selection 2017-10-11 00:37:19 +02:00
Zangetsu38 b36251488c Update LLVM 5.0 2017-10-11 00:33:16 +02:00
Zion Nimchuk fae33d3657 Initial LLVM 5 port 2017-10-11 00:31:49 +02:00
scribam 9bcc298b18 Remove unused rsx-debugger submodule and the rsx_program_decompiler entry in .gitmodules (#3542) 2017-10-11 01:22:32 +03:00
kd-11 5a03db7d2e rsx: Improve memory protection behavior when strict mode is off 2017-10-10 12:10:41 +03:00
kd-11 91ef202ee7 vulkan: Better VkResult handling 2017-10-10 12:10:41 +03:00
Zion Nimchuk 6d6b281270 Fix gentoo LLVM linking 2017-10-09 22:46:36 +01:00
Zion Nimchuk a3c49bea2c Revert "Add option to build using llvm shared libs and document other cmake options"
This reverts commit 6f33953861.
2017-10-09 22:46:36 +01:00
kd-11 1d375cb13c vulkan: Fix window resize race condition when doing flip 2017-10-09 20:25:41 +03:00
Megamouse 20ad9a13b8 Qt: add high resolution settings to gui tab 2017-10-09 20:25:41 +03:00
kd-11 fc0f98b5db rsx: Res scaling improvements
- gl: Reintroduce the wcb hw downscaling
- rsx: Clamp scalable render target size with a config var
2017-10-09 20:25:41 +03:00
kd-11 3fe37ede97 rsx: Fixups
- gl: Remove redundant texstorage1D call
- gl: Disable the wcb scaling code as it doesnt work right yet [WIP]
- vk: Fix wcb reads
2017-10-09 20:25:41 +03:00
kd-11 55df3cdf67 vulkan: Implement vsync 2017-10-09 20:25:41 +03:00
kd-11 6e8107a5cb rsx: Implement AF override 2017-10-09 20:25:41 +03:00
kd-11 7bee4064a6 gl/wcb: Use temporary scaled image to implement bilinear filter 2017-10-09 20:25:41 +03:00
kd-11 12ab03b0b5 rsx/gl: Implement resolution scaling
rsx: Revise wpos calculation to take resolution scale into account
2017-10-09 20:25:41 +03:00
kd-11 47202d5839 rsx: Set up patch functionality for program coeffecients 2017-10-09 20:25:41 +03:00
Robbie 47b121a700 PPU Page Faults (#3309)
I guess I'll merge it and fix some issues later myself.
2017-10-08 23:37:54 +03:00
scribam d53b640bcf Change compiler requirements in cmake script to match with the values listed in the README.md file 2017-10-08 14:50:31 +03:00
Unknown 78ef467138 Qt: fix fullscreen icon 2017-10-08 13:34:46 +03:00
Unknown b7f6bd4c91 Qt: extend drag and drop to mainwindow 2017-10-08 13:34:46 +03:00
Unknown e272acd7c1 Qt: sort game_list_frame members 2017-10-08 13:34:46 +03:00
Unknown 93d2ac887d Qt: add spu and ppu debug checkboxes to debug tab 2017-10-08 13:34:46 +03:00
Megamouse a84cc1d3bb Qt: move Render_Info to emu_settings.h 2017-10-08 13:34:46 +03:00
Nekotekina cc594ad353 Add supporters 2017-10-05 19:51:37 +03:00
Nekotekina beab5291bb mutex.cpp: minor update
New concept (incomplete)
2017-10-05 19:51:37 +03:00
Nekotekina 3907dd0444 Implement SYS_NET_SO_REUSEPORT 2017-10-05 19:51:37 +03:00
Nekotekina 3d64b65813 Fix /dev/urandom typo 2017-10-05 19:51:37 +03:00
Nekotekina ab4e66a0bf Add cellVdec hack (stolen TLS) 2017-10-05 19:51:37 +03:00
Nekotekina 144f6809bf Implement CALL_FUNC 2017-10-05 19:51:37 +03:00
Nekotekina d296e6021d libbeisobmf.sprx 2017-10-05 19:51:37 +03:00
Nekotekina 45a855ef1f Fix cellKb 2017-10-05 19:51:37 +03:00
Nekotekina e5f756205c sys_net full rewrite
Implement sys_net syscalls
Clean libnet functions
Use libnet.sprx
Use libhttp.sprx
Use libssl.sprx
Use librudp.sprx
Implement sys_ss_random_number_generator
2017-10-05 19:51:37 +03:00
Talkashie 6335fa8df1 Update tooltips.json (#3529) 2017-10-05 19:34:48 +03:00
Megamouse b2605206b1 Qt: fix gamegrid regression: mismatch between entry count and grid size 2017-10-05 17:10:18 +01:00
Zion Nimchuk 33182650ca Add a GitHub issue template, hopefully help with invalid issue spam. 2017-10-05 11:30:39 +01:00
Megamouse 0ca1f82059 [Qt] fix experimental build warning layout and smoothen gamelist scrolling (#3532)
* Qt: fix layout of "experimental build warning" for dpi scaling

and remove compiler warning in welcome_dialog.ui

* Qt: smoothen gamelist/-grid scrolling by setting singlestep value

and fix missing scroll and deselect on gamegrid

* Qt: show all bootable categories in gamegrid
2017-10-05 05:22:02 +03:00
toccata10 0c5cb4824b Add Deadzones for evdev gamepads (#3519) 2017-10-05 04:59:35 +03:00
Megamouse cf83b796e1 Qt: include debug tool colors in stylesheet (#3527)
Qt: include debug tool colors in stylesheet
2017-10-04 23:10:24 +01:00
kd-11 b338c81907 spu: Fixes (#3526)
* spu: Rewrite interpreter fast FM
- Partially implement accurate FM
- Fix FMA/FMS/FNMS by removing an optimization that does not work for INF (cmpunord)
- cmpunord does not catch all cases of an extended result/overflow
- NOTE: FM still does not handle corner cases well (e.g inf * 1.2 because SPU does not have concept of inf)
2017-10-04 20:58:06 +03:00
Megamouse 81b3e7e449 Qt: disable viewport settings on custom configs 2017-10-03 01:34:26 +03:00
scribam 425ddd13e5 [Qt] Fix repository urls to install Qt 2017-10-03 00:41:56 +03:00
Megamouse eb8af974dc Qt: add old log style to Kuroi 2017-09-28 18:23:17 +03:00
Megamouse 3067c8bd27 Qt: fix tty objectname and add tty text color to stylesheet 2017-09-28 18:23:17 +03:00
jjsat 632c8872cd Respect the controller setting when returning data from cellPadGetData. 2017-09-28 12:15:54 +03:00
Megamouse 9650218bb8 Qt: fix log stacking bug when wordwrap occurs 2017-09-28 01:46:20 +03:00
Megamouse 0b51102167 Qt: add log colors to stylesheet
and silence some compiler warnings
2017-09-28 01:46:20 +03:00
Megamouse ca36d08893 Qt: use rgba lambda for default stylesheet 2017-09-28 01:46:20 +03:00
Megamouse a358384900 Qt: support thumbnail icons in stylesheets 2017-09-28 01:46:20 +03:00
Megamouse 77a75305c7 Qt: implement GetOpaqueImageArea 2017-09-28 01:46:20 +03:00
Ryan Gonzalez 85b9809b39 Fix evdev axis reversal (#3303) 2017-09-28 01:13:57 +03:00
Zion Nimchuk d36de7d54f AppVeyor git branch in title fix #2 2017-09-28 00:50:24 +03:00
Jake 2b1c757084 ds4: Fix initial connection issue and hotplug/dongle calibration detection 2017-09-24 22:03:49 +03:00
kd-11 e7db0c7d99 vk: Clamp unreleased texture metric
- TODO: Find the leaking references
2017-09-23 16:46:41 +03:00
kd-11 393e3b702f rsx: Clean up debug overlays. Add unreleased textures metric to track texture memory 2017-09-23 16:46:41 +03:00
kd-11 23ad687e7e vk: New images always should be UNDEFINED or PREINITIALIZED 2017-09-23 16:46:41 +03:00
kd-11 a04ecdbe0a vulkan: Use frameid to determine texture storage to discard 2017-09-23 16:46:41 +03:00
kd-11 9ee21af524 vulkan: Optimize memory allocation 2017-09-23 16:46:41 +03:00
kd-11 b74cdcde00 rsx: Make the 3rd texture dimension matter
- Affects cube maps and texture3D surfaces
2017-09-23 16:46:41 +03:00
kd-11 4d83d749a0 rsx: Texture cache fixes
- Update section flags when requested
- Fix nullptr dereference: cached_dest will be null if dst_is_render_target is true
2017-09-23 16:46:41 +03:00
Zion 8e66e719fa Fix branch name for AppVeyor Builds (#3472) 2017-09-22 13:26:43 +03:00
kd-11 c6e6f4afea vs/qt: Explicitly reference target output to avoid failing post-build step
- Referencing the whole build folder will err if there is any non-qt exe in the folder
2017-09-21 20:05:07 +03:00
kd-11 d0148728c6 rsx: Fixes
- Fix section scanning range for early reject
- Specify IMAGE_ASPECT_STENCIL when uploading image_from_cpu
2017-09-21 20:05:07 +03:00
kd-11 dfc564f837 gl: Check that fence is not empty before calling destroy 2017-09-21 20:05:07 +03:00
Farseer 2b0edf6cde Allow null argument
Should fix Jak 2
2017-09-21 17:31:46 +03:00
Henrique Jung daa7520d1d Deploy QT DLLs using windeployqt tool (#3432)
* Deploy QT DLLs using windeployqt tool

Replace the old mechanism that manually copy the DLLs using either CMake
or VS built-in functions. The new approach uses the windeployqt tool
provided by the QT project that automatically detect the needed DLLs and
perform the necessary copying.

This approach should be more robust if there's an upstream change on QT
project regarding DLLs usage.

* QT DLLs: do not ship RPCS3 with ANGLE and software-OpenGL

According to https://doc.qt.io/qt-5/windows-requirements.html ANGLE is
useful for applications that use OpenGL ES by removing the need to
install OpenGL drivers, redirecting OpenGL calls to DirectX instead.
RPCS does not uses OpenGL ES so it's better to just remove it from the
binary distribution.

opengl32sw.dll is a fallback mechanism when ANGLE libraries are not
available that uses a software backend for OpenGL. It's unlikely that
RPCS3 will work using software-OpenGL, so there's little point into
shipping them.

* QT DLLs: do not ship with SVG and translation files

Like the other removed QT libraries: they are not needed right now. We
can deploy them if they become useful someday.
2017-09-21 16:53:20 +03:00
kd-11 3499d089e7 rsx: Texture cache fixes and improvements
rsx: Conditional lock hack removed
vulkan - Fixes
- Remove unused texture class
- Fix native pitch calculation (WCB)
rsx: Catch hanging begin/end pairs when flushing deferred draw calls
vulkan: Register DXT compressed formats
vulkan: Register depth formats
gl: Workaround for 'texture stitching' when gathering flip surface
- TODO: Add a proper flip hack option
rsx: Fix texture memory size calculation
- DXT textures dont have real pitch. Since pitch is used to calculate memory size, make sure it always evaluates to rsx_size
rsx: Fix cpu copy detection
rsx: Validate blit dst surface and dont make assumptions about region blit order
- Also relax restrictions on memory owned by the blit engine if strict rendering is not enabled
rsx: Fix depth texture detection
rsx: Do not manually offset into dst. The overlapped range check does so automatically
rsx: Minor optimizations
rsx: Minor fixes
- Fix to detect incompatible formats when using GPU texture scaling and show message
- Better 'is_depth_texture' algorithm to eliminate false positives
2017-09-21 16:17:06 +03:00
kd-11 6b96a2022a rsx: Add support for non-projective shadow sampling
- Fixes missing shadows in persona 5

vk: Enable polygon depth bias a.k.a polygonOffset
- Fixes shadow acne in persona 5
2017-09-21 16:17:06 +03:00
kd-11 3836b40bf7 rsx: Fixups 2017-09-21 16:17:06 +03:00
kd-11 571dbfb7b1 rsx: Texture cache improvements
- Limits buffer size to min 720 in the Y axis (1024 section causes conflicts in some cases - TODO)
rsx: Fixups to allow large textures for blit operation
- Also includes checks for both leaking sections and blit regions for vulkan
hotfix for hanging when using WCB
addendum - unlock both ro and no blocks before attempting to copy memory blocks
gl: Fixups for ARB_explicit_uniform_location
- Forces glsl v 430 to make use of the extension
rsx/vk: Rework texture cache to minimize recursive access violations
- Also modifies the vulkan commandbuffer begin/end/submit mechanism
gl: Fix cached_texture_section::is_flushable to take memory protection into account
rsx: Fix blit dst offset calculation
2017-09-21 16:17:06 +03:00
kd-11 10e25eb362 rsx: Fix multidraw range splits again
rsx: Hotfix for disjoint range detection
2017-09-21 16:17:06 +03:00
kd-11 45d0e821dc gl: Minor optimizations
rsx: Texture cache - improvements to locking
rsx: Minor optimizations to get_current_vertex_program and begin-end batch flushes
rsx: Optimize texture cache storage
- Manages storage in blocks of 16MB
rsx/vk/gl: Fix swizzled texture input
gl: Hotfix for compressed texture formats
2017-09-21 16:17:06 +03:00
kd-11 e37a2a8f7d rsx: Texture cache fixes and improvments
gl/vk/rsx: Refactoring; unify texture cache code
gl: Fixups
- Removes rsx::gl::texture class and leave gl::texture intact
- Simplify texture create and upload mechanisms
- Re-enable texture uploads with the new texture cache mechanism
rsx: texture cache - check if bit region fits into dst texture before attempting to copy
gl/vk: Cleanup
- Set initial texture layout to DST_OPTIMAL since it has no data in it anyway at the start
- Move structs outside of classes to avoid clutter
2017-09-21 16:17:06 +03:00
kd-11 07c83f6e44 gl: cleanup; fix program linkage on mesa using GL_ARB_explicit_uniform_location, also make use of ARB_multidraw 2017-09-21 16:17:06 +03:00
kd-11 061824a7ec rsx: Add support for batched multidraw
gl: Fix multidraw [WIP]
rsx: Ignore vertex base when data source is generated using arithmetic
vk: Check pending flag before doing fence poke
vk/gl: Fix for inlined array and immediate draws
rsx: Collapse joined draws when batching
2017-09-21 16:17:06 +03:00
kd-11 abb56a354d rsx: Bug fixes and improvements
rsx: Try to skip unknown commands without discarding entire cb
2017-09-21 16:17:06 +03:00
kd-11 9359b8c170 rsx/fp: Shader decompiler fixes
- Requires proper 2-pass impl
rsx/fp: Catch hanging code blocks
rsx/fp: Don't pause on scaling error
2017-09-21 16:17:06 +03:00
kd-11 2d0f1f27a8 esx: Fixes to the texture cache
rsx: Blit engine improvements
- Always handle blits to and from framebuffers through the GPU
- Handle depth surfaces properly when using GL
- Check for format mismatches when blitting to the surface store [WIP]
2017-09-21 16:17:06 +03:00
kd-11 73312fc363 rsx: Several fixes and improvements
- Do not ignore non-centered pixel blitting
- Register method ac00+16
- Bump texture memory heap to account for GPU texture scaling requirements (vulkan)
- Explicit MRT location index output to better convey intent (openGL)
2017-09-21 16:17:06 +03:00
kd-11 deb590cb05 rsx/vk: Bug fixes
- Make each frame context own its own memory
- Fix GPU blit
- Fix image layout transitions in flip

vk: Improve frame-local memory usage tracking to prevent overwrites
- Also slightly bumps VRAM requirements for stream buffers to help with running out of storage
- Fixes flickering and missing graphics in some cases. Flickering is still there and needs more work
vk: Up vertex attribute heap size and increase the guard size on it
vulkan: Reorganize memory management
vulkan: blit cleanup
vulkan: blit engine improvements
- Override existing image mapping when conflicts detected
- Allow blitting of depth/stencil surfaces
2017-09-21 16:17:06 +03:00
kd-11 2033f3f7dc rsx/vk/gl: Refactoring and reimplementation of blit engine
Fix rsx offscreen-render-to-display-buffer-blit surface reads
- Also, properly scale display output height if reading from compressed tile

gl: Fix broken dst height computation
- The extra padding is only there to force power-of-2 sizes and isnt used

gl: Ignore compression scaling if output is rendered to in a renderpass

rsx/gl/vk: Cleanup for GPU texture scaling. Initial impl [WIP]
- TODO: Refactor more shared code into RSX/common
2017-09-21 16:17:06 +03:00
Nekotekina 3e3160d7ac Minor VFS fix 2017-09-21 14:34:09 +03:00
Nekotekina dd919c76b8 cellAudio: use error_code 2017-09-20 14:27:52 +03:00
Nekotekina a6a0f13264 Remove unnecessary include git-version.h 2017-09-20 14:26:42 +03:00
Nekotekina b9a0c107ab Fix library loading mode 'both' 2017-09-20 14:26:42 +03:00
Nekotekina 5c93acefd9 Try to fix some fs errors 2017-09-19 15:07:07 +03:00
Nekotekina a428dac71c sys_fs_mkdir: implement ENOENT 2017-09-19 15:07:07 +03:00
Nekotekina 3901f08fa0 Fix error on loading a library twice 2017-09-19 15:07:07 +03:00
Nekotekina 519f21db18 Exitspawn support renewal
Implemented _sys_process_exit2 syscall
Rewritten sys_game_process_exitspawn
Rewritten sys_game_process_exitspawn2
Implemented _sys_process_atexitspawn
Implemented _sys_process_at_Exitspawn
And some other changes
2017-09-19 15:07:07 +03:00
Nekotekina 18d472b7e1 Patch: new 'load' syntax
[load, path_name1] - load sequence
[load, path_name2, -0x40] - same, but modify the addresses by -64
2017-09-19 15:07:07 +03:00
Nekotekina bc098d6b9c Rewrite _sys_strncat 2017-09-19 15:07:07 +03:00
Nekotekina 22ff8abd7d Rewrite _sys_strncpy 2017-09-19 15:07:07 +03:00
Nekotekina 871ccfd32c Rewrite _sys_strrchr 2017-09-19 15:07:07 +03:00
Nekotekina 7a79e184c5 Rewrite _sys_strchr 2017-09-19 15:07:07 +03:00
Nekotekina 0e72cc879f Rewrite _sys_strcpy 2017-09-19 15:07:07 +03:00
Nekotekina 13304bd18b Rewrite _sys_strcat 2017-09-19 15:07:07 +03:00
Nekotekina a4b824c50a Rewrite _sys_strncmp 2017-09-19 15:07:07 +03:00
Nekotekina ccc87081f3 Rewrite _sys_strcmp 2017-09-19 15:07:07 +03:00
Nekotekina 800ba9d902 Rewrite _sys_strlen 2017-09-19 15:07:07 +03:00
Nekotekina 015b9fdf8b Fix _sys_strncasecmp 2017-09-19 15:07:07 +03:00
Nekotekina 83f93202d0 Rewrite _sys_memcmp 2017-09-19 15:07:07 +03:00
Nekotekina ae2ea02377 Implemented _sys_prx_load_module_on_memcontainer 2017-09-19 15:07:07 +03:00
Nekotekina 4fe4521881 Implemented __sys_look_ctype_table
Implemented _sys_tolower, _sys_toupper
Fixed _sys_strncasecmp
2017-09-19 15:07:07 +03:00
Nekotekina b83575bcbb Remove unnecessary newline in Log.cpp 2017-09-19 15:07:07 +03:00
Nekotekina 17175e1c23 Fixed global variables in Log.cpp 2017-09-19 15:07:07 +03:00
Nekotekina cc57719856 Restore UTF-8 in Log.cpp 2017-09-19 15:07:07 +03:00
Nekotekina b9b71ccbc1 Implemented syscall _sys_process_exit 2017-09-19 15:07:07 +03:00
Nekotekina e789b969b0 Implemented MFF_HIDDEN for VNIDs
Minor refactoring
Now possible: ```REF_FUNC(...).flag(MFF_HIDDEN);```
2017-09-19 15:07:07 +03:00
Nekotekina be44024a1a Fix initial log message 2017-09-19 15:07:07 +03:00
Nekotekina c7d4a30646 Backup logs to old_logs/ 2017-09-19 15:07:07 +03:00
Nekotekina 837c5dddee Add <typeinfo> 2017-09-19 15:07:07 +03:00
Nekotekina 669b1385cc Move sys_process_exit 2017-09-19 15:07:07 +03:00
scribam 01ffaab3e0 Silent some compiler warnings 2017-09-19 13:21:12 +03:00
Robbie d5fb7180d0 HGA calls sys_rsx_context_attribute before calling sys_rsx_memory_allocate. This inevitably causes RPCS3 to crash. Add nullptr check to prevent this. 2017-09-18 21:24:13 +01:00
Megamouse b141b43c1c [Qt] fix graphics adapter selection and rebase for less redundancy 2017-09-17 21:05:54 +01:00
Megamouse cad91e114d Qt: add char count label to osk dialog 2017-09-17 12:39:52 +03:00
Megamouse db51779682 Qt: settings_dialog layout fix (hack) 2017-09-17 11:40:41 +03:00
Peter Mcteague c18e71ca29 Add git_branch to git-version.h, add display version info to gs_frame and add branch and version to log. (#3186)
* Added version number and branch name to gs_frame and log file. This also involved making the files that generate git-version.h , get the branch.
2017-09-16 14:54:25 +03:00
Alex Touchet 6a54b3929e Update Visual Studio 2015 URL 2017-09-15 10:53:27 +03:00
myfreeweb 07af701afe Vulkan: use pkg-config instead of checking for Linux (#3440)
Makes Vulkan optional on Linux / makes it possible on FreeBSD.
2017-09-14 21:02:09 +03:00
Nekotekina 669d953529 Implement fs::error::notempty 2017-09-14 00:23:23 +03:00
Nekotekina 22d8b57027 Improve lv2_memory object 2017-09-14 00:23:23 +03:00
Nekotekina 0e691e2c51 sys_mmapper: minor range fix 2017-09-14 00:23:23 +03:00
Nekotekina ae1e9e78db sys_fs: use g_tls_error for diagnostic
Affected syscalls:
sys_fs_open
sys_fs_opendir
sys_fs_stat
sys_fs_mkdir
sys_fs_fcntl (get free space)
2017-09-14 00:23:23 +03:00
Nekotekina e00aedd1a0 fs: minor fix 2017-09-14 00:23:23 +03:00
Zion Nimchuk 4a10dcc549 Fix buffer overrun in cert loading, made it more accurate. Fixes #3408 2017-09-13 17:40:57 +03:00
Megamouse 553f67d7e3 Qt: improve gamelist refresh, fix some more scroll issues
despite earlier efforts with modelindex and so on the annoying scroll jump still surfaced sometimes, so we only scrollTo index on selected occasions from now on.
Furthermore we don't need to refresh the gamelist if no custom config has been applied, so this will only be needed on accept from now on
2017-09-11 23:17:32 +03:00
Megamouse fac8a520f0 Qt: Remove duplicate gui repaints in settings dialog
ApplyGuiOptions(true) already forces GuiStylesheetRequest and therefore RepaintGui in main_window if necessary.
We don't need GuiRepaintRequest on accept because there should be no option left that doesn't repaint immediately
2017-09-11 23:17:32 +03:00
Megamouse f0358f85fc [Qt] fix small buttons/missing icons in the toolbar (Doppelgänger) (#3413)
* Qt: use lambda for colorizedIcon in main_window and game_list_frame

* Qt: enable AA_UseHighDpiPixmaps for better looking icons

* Qt: use iconSize instead of sizehint for linux, add some comments
2017-09-10 20:46:39 +03:00
Henrique Jung 4b9fa8ec6d CMake build: copy QT DLLs files to bin directory
AppVeyor build relies on CMake to build the VS project files, which then
is used to build RPCS3, so we must tell CMake to copy Qt DLLs files the
same way VS build does.
2017-09-10 19:25:54 +03:00
Henrique Jung 45cdf6af3b VS build: delete QT DLLs from bin directory
Commit 6cfb184b1e added these files when
implementing a very large code refactoring. They seems to be unecessary
since there's a couple of VS post-build scripts that copy the files from
the user local QT installation to the bin directory every time the rpcs3
project is built. So their presence in the repository only makes cloning
it a little slower.
2017-09-10 19:25:54 +03:00
Robbie 47685bef39 If the loop is never entered, then the jit is null. 2017-09-10 18:51:59 +03:00
Megamouse b11f9e0405 [Qt] add scrollbar to about dialog (#3417)
* Qt: add scrollbar to about dialog

* move contributors
2017-09-10 14:03:24 +03:00
Henrique Jung 84e7de0a78 VS build: copy Qt5WinExtras.dll to bin directory
When building RPCS3 on Visual Studio, there's some DLLs that are copied
from the local QT installation to the RPCS3's output directory using a
post-build script. However, one of these DLL was missing, which is
required for running the program on debug mode (for release versions,
the file is already present on git).

This commit just add the additional command that is needed to copy the
file.
2017-09-10 01:27:22 +01:00
scribam f39e2b999f [Qt] Delete "ui" pointer in destructor 2017-09-09 20:29:42 +01:00
Megamouse cd4b28b4d7 Qt / OpenGL: fix delete_context 2017-09-09 19:46:10 +01:00
Megamouse 2db2114a45 Qt: add Refresh button to gamepad settings, minor cleanup 2017-09-09 19:46:10 +01:00
Megamouse 4b11a62b4d Qt: fix gamepad settings layout issue 2017-09-09 19:46:10 +01:00
RipleyTom 0457f23b13 Pad Refactoring
Adds a window to setup multiple input types as once
All controllers are now handled by a single thread
[hcorion] evdev refactor
2017-09-09 00:55:03 +01:00
Peter Mcteague a6ba7ed21c Fixed a line where event->ingore() was called after break. 2017-09-09 00:33:53 +01:00
Peter Mcteague 5326912bc0 Added ignoring of keyboard shortcuts to keyboard_pad_handler
This fixes an issue where pressing keyboard shortcuts will input them to
the game.
2017-09-09 00:33:53 +01:00
Megamouse be46c82aaa [Qt] style adjustments 6
rename members and clean headers for gamelist and main window
adjust some more connects
2017-09-08 19:23:34 +01:00
Megamouse 43bae9f9d7 [Qt] style adjustments 5
rename even more members and clean headers
adjust some more connects
move some function bodies to cpp
2017-09-08 19:23:34 +01:00
Megamouse 95231c4dee [Qt] style adjustments 4
rename more members and clean headers
adjust some connects
2017-09-08 19:23:34 +01:00
Megamouse a95e01290e [Qt] style adjustments 3
rename some members and clean headers
2017-09-08 19:23:34 +01:00
Farseer 0cbbd3a5b1 Trophy fixes
Should fix Kung Fu Panda 2 Raging Blast 2
2017-09-08 20:10:57 +03:00
Zion Nimchuk d8f3354ce3 Fix some of libpng known incorrect profile spam 2017-09-08 17:23:16 +01:00
RipleyTom e4105f46de Implement _sys_prx_get_module_info 2017-09-08 00:06:53 +03:00
Megamouse 9a1ee9e984 use single line titles in gamelist and recent games menu 2017-09-07 21:26:44 +01:00
Zion Nimchuk 7c897d5019 Weird tlou fix 2017-09-06 21:44:58 +01:00
Zion Nimchuk bfe2bccc51 Implement progress bar in taskbar for non-windows platforms, Fixes #2605 2017-09-06 21:44:58 +01:00
Zion Nimchuk 11aa0be04a Change MacOSX -> MacOS, add warning about glvnd, Fixes #2949 2017-09-06 21:44:58 +01:00
Zion Nimchuk d2cae96e8d Add option to build using llvm shared libs and document other cmake options 2017-09-06 21:44:58 +01:00
Megamouse 8e955297ef [Qt] style adjustments 2
some more of the same
2017-09-06 17:15:38 +01:00
Megamouse 205f6a9000 [Qt] style adjustments 1
mainly move { to newline
get rid of some lines here, add some lines there
2017-09-06 17:15:38 +01:00
jjsat 4558f93f92 Convert endianess before passing buffers to setsockopt. 2017-09-06 00:14:15 +03:00
jjsat 634c411946 Fix sys_tty_write() if called with pwritelen == NULL. 2017-09-06 00:14:15 +03:00
Megamouse d4d0d35e05 game_list_frame: force single line text in list items 2017-09-05 21:44:46 +03:00
scribam f4f36a3cb1 .travis.yml: remove "dist: trusty" as it is now the default distribution 2017-09-05 17:46:38 +01:00
scribam 21d70a75d5 .travis.yml: remove GCC_COLORS variable export and duplicated "brew update;" instruction 2017-09-05 17:46:38 +01:00
scribam 47ed9aa1b9 .travis.yml: rework binutils package update 2017-09-05 17:46:38 +01:00
scribam b60ac78c58 Remove coverity and coveralls references 2017-09-05 17:46:38 +01:00
Nekotekina 83e139cd1a Improve sys_fs_ftruncate
Handle stream API lock (EBUSY)
Handle append mode
2017-09-04 02:15:29 +03:00
Nekotekina b415b0e737 fs: atomic truncation 2017-09-04 02:15:29 +03:00
Nekotekina 2e510e5ca0 Fix rXml limitation
(trophies)
2017-09-04 02:15:28 +03:00
Nekotekina 1262263f5c Fix sys_event_port_connect_ipc 2017-09-04 02:15:28 +03:00
Nekotekina 9b9e2bcafb Move sys_gamepad filter 2017-09-04 02:15:28 +03:00
RipleyTom cde29aba64 multi pkg fix 2017-09-04 00:10:15 +01:00
scribam 34cf1ff7c7 Remove old wxWidgets-related references 2017-09-03 23:12:36 +01:00
Zion Nimchuk cc880b53aa Add cross-platform implementation of cellHttpUtilParseUri 2017-09-04 00:37:36 +03:00
Zion Nimchuk 8ad44dd00f Implement cellSslCertificateLoader 2017-09-04 00:37:36 +03:00
Megamouse 9440e65452 settings_dialog: minor connect simplification 2017-09-02 15:22:58 +03:00
Megamouse 5cb6815bf3 GUI: Fix Repaint on stylesheet change 2017-09-02 15:22:58 +03:00
Ofek caab400258 Various fixes (Trophy, Gcm corrections, stack alloc) (#2894)
* Fixed sys_get_random_number generating less bytes than needed, and ceiling the buffer size in 0x1000 instead of failing
* Corrected alignment check in libgcm
* Now calling callback of sceNpManagerRegisterCallback
* Fixed trophies
2017-09-02 14:43:44 +03:00
Megamouse d3f13ab8a3 fix da build 2017-09-02 12:04:22 +03:00
Talkashie ca6064b109 sys_usbd stuff (#3346)
* Create sys_usbd.cpp

* Create sys_usbd.h

* Update lv2.cpp
2017-09-02 04:21:42 +03:00
Ani e57caefd09 libad: Enable LLE load
Removes libad from ignore list.

It will only affect games that call for it, making them progress further with the Recompiler instead of dying in Unregistered Function, as there's no HLE implementation of libad.

Tested with Guitar Hero 5 [BLES00576]
2017-09-01 21:10:50 +01:00
Nekotekina 7e99f6bc5f Add supporters 2017-09-01 21:39:32 +03:00
Nekotekina a85caaee1d Set PPU stack bounds 2017-09-01 21:24:43 +03:00
Nekotekina 5b00aaf561 Fix decrypt_self usage 2017-09-01 02:10:57 +03:00
Nekotekina 174f11bdbd Fix access violation handler 2017-09-01 01:22:48 +03:00
Nekotekina 05442bdb11 Protect SPU segments 2017-09-01 00:59:25 +03:00
Nekotekina 9ba3cea2b1 RawSPU: implemented read SPU_RunCntl_offs 2017-08-31 23:22:52 +03:00
Nekotekina 20d48289b8 RawSPU: implement read SPU_NPC_offs 2017-08-31 22:55:39 +03:00
Nekotekina 8f9410ceff Implemented syscall sys_event_port_connect_ipc 2017-08-31 22:10:22 +03:00
Nekotekina 3a08dd7dde RawSPU: implement Prxy_TagStatus_offs
Rollback to immediate MFC transfers
2017-08-31 22:03:47 +03:00
Nekotekina cfb858a51c Load liblv2.sprx by default 2017-08-31 21:46:58 +03:00
Nekotekina 37d7fdbcae Fix sys_raw_spu_image_load 2017-08-31 21:44:42 +03:00
Nekotekina 62c14e9437 Fix sys_raw_spu_load 2017-08-31 21:44:26 +03:00
Nekotekina 90b8346312 Implemented syscall _sys_spu_image_get_segments 2017-08-31 21:39:12 +03:00
Nekotekina 167d6a08f8 Implemented syscall _sys_spu_image_get_information 2017-08-31 21:30:13 +03:00
Nekotekina 649d68a00f +sys_spu_elf_get_segments 2017-08-31 20:38:17 +03:00
Nekotekina 8807cd06b7 +sys_spu_elf_get_information 2017-08-31 20:37:54 +03:00
Nekotekina b533d57717 sys_spu_image: minor update
Cleanup
Templates extended
2017-08-31 20:36:51 +03:00
Nekotekina 14a6269243 Fix fatal error dialog 2017-08-31 05:21:26 +03:00
Nekotekina 7b96190e6c Log backup rotation (incomplete) 2017-08-30 17:15:35 +03:00
Nekotekina 010b75251f fs::rename fixed
Added overwriting policy
sys_fs_rename improved
2017-08-30 17:14:30 +03:00
Nekotekina da3f3fd1fb Fix ipc_manager::add
Thanks to @Farseer2 for debugging
2017-08-29 21:26:31 +03:00
Nekotekina 26e13b4f5f Compress log to RPCS3.log.gz 2017-08-29 17:12:13 +03:00
Nekotekina a771fcb397 Fill log with \n 2017-08-29 17:12:13 +03:00
JayC-03 64a6fbe39f Add missing game categories
Used by some media apps, 
YouTube boots now.
2017-08-29 03:19:35 +03:00
Zion Nimchuk 43b860d267 Make travis CI build with PulseAudio backend. 2017-08-29 01:36:59 +03:00
Zion 818df50bb5 Spelling correction 2017-08-28 18:43:47 +03:00
Nekotekina 2570911283 Register Win32 error 32 2017-08-27 16:09:34 +03:00
Nekotekina f59a448f3f Copy sys_spu_segment info in SPU TG
No idea whether it fixes something or not
2017-08-27 03:00:10 +03:00
Nekotekina 834712bb58 Reserve log space for higher severity levels 2017-08-27 03:00:10 +03:00
Nekotekina d98f739043 Make impossible to disable fatal errors 2017-08-27 03:00:10 +03:00
Nekotekina aa5dc5455e _sys_spu_image_import implemented
vm:var<T[]> improved (begin/end)
sys_spu_image_import rewritten
2017-08-27 03:00:10 +03:00
Ani dfc970c926 Point forums URLs to the new one
Updates forums URLs to our new forums
2017-08-27 01:27:38 +03:00
Ani 68ecf340c5 Update Contributing Guidelines
Updates contributing guidelines to use Game Compatibility wiki page and new forums hyperlinks
2017-08-27 01:27:38 +03:00
Ani 3d626e84ef GUI: Add Kuroi (Dark) Theme
New and first theme for RPCS3.
It's based on a dark color scheme.
2017-08-27 01:27:38 +03:00
Ani 95abf768a7 Fix GitIgnore 2017-08-27 01:27:38 +03:00
scribam cb00190c3e [Qt] Replace deprecated qSort function by std::sort 2017-08-26 22:32:40 +01:00
scribam 8fdf1b23a3 Update cell_FreeType2.cpp 2017-08-26 22:03:15 +01:00
kd-11 2e9405db4c rsx: Remove index expansion for quad strips 2017-08-26 21:53:54 +03:00
kd-11 fe5828cb47 rsx: Implement QUAD_STRIP
- QUAD_STRIP evaluates to TRIANGLE_STRIP in memory. The memory layout is identical.
- The only difference between the two modes would be the primitive_ID but that doesnt matter on RSX
- Its worth noting that results will be different between the two modes if input vertices are non-coplanar for every set of N verts
2017-08-26 21:53:54 +03:00
kd-11 e56d8db6a3 gl: Do not modify bound depth/stencil buffers bound to zcull memory
- Fixes some rare cases where zcull always fails
2017-08-26 21:53:54 +03:00
kd-11 e76b6e3f27 gl: Workaround for restrictive z range 2017-08-26 21:53:54 +03:00
kd-11 9a7ce2fd29 rsx/vp: ARL fix 2017-08-26 21:53:54 +03:00
kd-11 462b93f62c vulkan: Gracefully handle back-to-back flip request spam 2017-08-26 21:53:54 +03:00
kd-11 f71f67c4ff rsx: Make fragment state dynamic to reduce shader permutations 2017-08-26 21:53:54 +03:00
kd-11 8358bda133 gl/rsx: Fixes to zcull pixel counting 2017-08-26 21:53:54 +03:00
scribam 85199e200b [Qt] Simplify firmware libraries searching 2017-08-25 22:20:57 +03:00
RipleyTom 5681801b85 cellOskDialogLoadAsync fix
Takes into account text limit and initial text
2017-08-25 21:31:27 +03:00
Talkashie 86ef07b166 Correct typo 2017-08-25 18:42:41 +01:00
Nekotekina 00339cb99b Fix log mapping (Linux) 2017-08-24 21:20:18 +03:00
Andrew O'Neil daf3760cd4 Add PulseAudio audio backend 2017-08-24 17:43:34 +03:00
Nekotekina c1450ad616 Reenable thread_local for all platforms 2017-08-24 16:27:07 +03:00
Nekotekina 025a09ed87 Optimize RPCS3.log and limit it to 64 MiB
Use memory-mapped file for writing
2017-08-23 23:11:18 +03:00
Nekotekina 1716db14ed Fix moving disc games with arbitrary dir name 2017-08-23 21:26:18 +03:00
Nekotekina d0e171784c Implemented fs::file::get_handle 2017-08-22 21:18:26 +03:00
Nekotekina a68983b551 Ensure all log messages are displayed 2017-08-22 21:06:37 +03:00
Megamouse c7c0139788 stylesheets: add custom color to gamepad 2017-08-22 15:28:22 +03:00
Zangetsu38 37bc2b3bb9 rsx: implement pixel size 16. 2017-08-21 17:32:21 +03:00
Megamouse c85806c422 GUI: improve reset to deafult button 2017-08-21 01:05:57 +03:00
Megamouse ee98683538 stylesheets: UI Colors fixes 2017-08-21 01:05:57 +03:00
Megamouse a822d990d2 stylesheets: UI_Colors hotfix 2017-08-20 17:56:52 +03:00
Megamouse 33d3303bdf GUI: hide utilities by default 2017-08-20 17:32:30 +03:00
Megamouse 8b35df8327 misc: add build warning to log 2017-08-20 17:32:30 +03:00
Megamouse 0854ed2b51 misc: get rid of some compiler warnings 2017-08-20 17:32:30 +03:00
Megamouse 713c1a7a86 cg_disasm: fix frame by removing parent 2017-08-20 17:32:30 +03:00
Megamouse fb816a0eb9 osk: fix backspace 2017-08-20 17:32:30 +03:00
Megamouse fff62df6a2 stylesheets: make UI Colors optional 2017-08-20 16:14:32 +03:00
Zion Nimchuk e6a07e80d7 Fix evdev joystick detection 2017-08-19 20:05:33 +03:00
Zion Nimchuk 514a98321d Use newer binutils version to link against newer ffmpeg libraries 2017-08-19 20:05:33 +03:00
Zion Nimchuk 36ac35361f Update ffmpeg submodule with updated libs and headers for linux 2017-08-19 20:05:33 +03:00
Zion Nimchuk bc7d728eb3 Fix linux builds giving experimental build even if not on experimental build. 2017-08-19 20:05:33 +03:00
Zion Nimchuk 66a43c35db Fix evdev controller detection, add joystick squircling 2017-08-19 20:05:33 +03:00
Robbie e9f057c91b Make removing a save fast 2017-08-19 18:17:46 +03:00
Robbie 196cdfafa6 Implement a proper save manager. 2017-08-19 18:17:46 +03:00
Nekotekina 590ca7115f Rewrite cellVideoOutConfigure 2017-08-19 17:35:04 +03:00
Jake 650db9c962 cellPad: remove unneeded & 2017-08-19 12:27:53 +03:00
Jake 5d7c454e52 rsx: Vertex Decompiler, fix sca register assignment 2017-08-19 12:27:53 +03:00
Jake 4d5f98017f d3d12: ignore 0 sized rt dma copy 2017-08-19 12:27:53 +03:00
Jake 7ecf6cb014 rsx: Ignore sending system reserved semaphores to renderer 2017-08-19 12:27:53 +03:00
Danila Malyutin 9d1aebce74 Silence some obvious warnings
Makes travis logs a bit cleaner
2017-08-18 23:09:52 +03:00
scribam dc9671c639 Add cellAtracGetSamplingRate and cellAtracMultiGetSamplingRate functions 2017-08-18 22:42:38 +03:00
scribam 93bfe8164c Move sys_gamepad files to the correct directory 2017-08-18 21:59:25 +03:00
probonopd d6329eaa1a Make it pass desktop-file-validate in Ubuntu 14.04 2017-08-18 20:57:21 +03:00
kd-11 f21a3069a5 vulkan: Don't keep invalidated objects around too long
Games like Tales of Vesperia seem to be using a random memory allocator with very low collision chance.
This means objects are very unlikely to be reused in such games leading to pile-up
2017-08-18 16:51:38 +03:00
kd-11 a8b989b51d vk: Improve window resize handling
- Be careful not to request images not available
- Request a triple buffer at all times if available to keep acquisition from locking up
2017-08-18 16:51:38 +03:00
kd-11 142bfb5250 rsx: Fix immediate indexed drawing 2017-08-18 16:51:38 +03:00
kd-11 334327df67 rsx: Add a success message on program compile completion
- Should help users wondering if rpcs3 'froze' during shader compile
2017-08-16 23:58:30 +03:00
kd-11 2400210144 vk: Reimplement access violation sync handling 2017-08-16 23:58:30 +03:00
kd-11 1b1c300aad vulkan: Restructure frame queues 2017-08-16 23:58:30 +03:00
kd-11 531b03e7af vk: Catch leaking imageview refs on resize 2017-08-16 23:58:30 +03:00
kd-11 650c1c64f1 gl: Workarounds for intel GPUs which dont seem to be truly GL4 compliant 2017-08-16 23:58:30 +03:00
kd-11 2fd4726919 rsx: Fix single vertex array input declarations 2017-08-16 23:58:30 +03:00
kd-11 b86745ee4e gl: Fix vsync; always use adaptive vsync instead of double-buffered 2017-08-16 23:58:30 +03:00
kd-11 c04aa05398 rsx: Shader pipeline fixes and improvements
- Do not set zfunc if alphakill is not enabled. This is because at the moment alphakill requires a different shader to be built

- use glsl loop-unroll friendly comparison; skip vertex input compare if either key requests it

- Minor tweaks to fp key generation
2017-08-16 23:58:30 +03:00
kd-11 3c9bab8563 ui: Move disable vertex cache to debug. Also add an option to disable zcull emulation in the debugger 2017-08-16 23:58:30 +03:00
kd-11 0dc24799f1 gui: Add delete shader cache option in the context menu 2017-08-16 23:58:30 +03:00
kd-11 6eb1786635 rsx: Clamp depth range to [0,1]
- Fixes remaining issues with Ni no Kuni
2017-08-16 23:58:30 +03:00
kd-11 bbf2a97d2e rsx: Zero-initialize the vertex register block
- Some games reference constant regs that they never initialize
2017-08-16 23:58:30 +03:00
kd-11 00c6a589a5 rsx/util: Add simple consistent hash function
rsx/vk/shaders_cache: Move vp control mask to dynamic state

rsx/vk/gl: adds a shader cache for GL. Also Separates pipeline storage for each backend

rsx: Add more texture state variables to the cache
2017-08-16 23:58:30 +03:00
kd-11 c7dca1dbef rsx/vk: Implement shaders cache and fix broken pipeline_storage comparison and hash
- Fix pipeline state storage to uniquely store each pipeline variant
- Adds a progress bar to indicate loading is taking place
2017-08-16 23:58:30 +03:00
kd-11 1da732bbf5 rsx/gl/vk: Invalidate texture regions when memory is unmapped
- Free GPU resources immediately if mappings change to avoid leaking VRAM
2017-08-16 23:58:30 +03:00
kd-11 00b0311c86 rsx/gl/vulkan: Refactoring and partial vulkan rewrite
- Updates vulkan to use GPU vertex processing
- Rewrites vulkan to buffer entire frames and present when first available to avoid stalls
- Move more state into dynamic descriptors to reduce progam cache misses; Fix render pass conflicts before texture access
- Discards incomplete cb at destruction to avoid refs to destroyed objects
- Move set_viewport to the uninterruptible block before drawing in case cb is switched before we're ready
- Manage frame contexts separately for easier async frame management
- Avoid wasteful create-destroy cycles when sampling rtts
2017-08-16 23:58:30 +03:00
kd-11 6a707f515e vk/gl: Factorize shared GLSL code
- prep vulkan for shared glsl backend
2017-08-16 23:58:30 +03:00
kd-11 c0409a819e gl: Workaround for depth/color format mismatch when using hardware blit 2017-08-16 23:58:30 +03:00
kd-11 b2b5f564a1 rsx: Add a few more depth format types to known behaviour paths 2017-08-16 23:58:30 +03:00
kd-11 d54c2dd39a gl: Move vertex processing to the GPU
- Significant gains from greatly reduced CPU work
- Also reorders command submission in end() to improve throughput

- Refactors most of the vertex buffer handling
- All vertex processing is moved GPU side
2017-08-16 23:58:30 +03:00
Megamouse e668ecd453 stylesheets: fix gamegrid font 2017-08-16 16:11:11 +01:00
Megamouse 0020359b8f stylesheets: fix color settings 2017-08-16 16:11:11 +01:00
Megamouse a0176775ff stylesheets: make toolbar styles more accessible 2017-08-16 16:11:11 +01:00
Megamouse a18fddb831 stylesheets: move white header section to default stylesheet 2017-08-16 16:11:11 +01:00
Megamouse ea462ae7d7 stylesheets: fix default not working 2017-08-16 16:11:11 +01:00
Ryan Gonzalez 6d14583f28 Better evdev joystick axis scaling (#3202)
Fix evdev scaling when the minimum value is <0
Declare a trigger as pressed as long as any value >0 is given
2017-08-15 22:14:13 +03:00
scribam 956117a74f Fix the window title when the option "show_fps_in_title" is not checked 2017-08-15 21:34:16 +03:00
scribam 0c1d4e43e4 Simplify m_show_fps assignation 2017-08-15 21:34:16 +03:00
scribam ae156801df Simplify qstr function 2017-08-15 21:34:16 +03:00
RipleyTom 844e09c40e Fix search edit context menu weird color 2017-08-15 21:14:09 +03:00
RipleyTom 81da93a302 Fix rare occurence where there is a /PS3_GAME+something directory which leads to weird behavior 2017-08-15 21:14:09 +03:00
RipleyTom e0508c6c64 unpkg fix 2017-08-15 15:58:16 +03:00
RipleyTom db9618ac2f Resets sleep timer on button press
Adds windows sleep timer reset on ds4 button input

Refactoring

Shorter version
2017-08-15 15:28:53 +03:00
RipleyTom a38182b967 Adds check for pkg signature in QT part 2017-08-15 14:30:32 +03:00
RipleyTom 474bd7beaf Adds support for multi-files pkg. 2017-08-15 14:30:32 +03:00
Talkashie d8c449aadf Update cellNetCtl.cpp 2017-08-14 18:17:46 +03:00
Talkashie 2c611ec0ba Update cellHttp.cpp 2017-08-14 18:17:46 +03:00
Nekotekina b44f5e59ac Fix appveyor.yml 2017-08-14 02:48:52 +03:00
Nekotekina 0ad0510624 Fix appveyor.yml 2017-08-14 02:34:00 +03:00
Nekotekina d2fb69cda3 Add build warning 2017-08-13 23:26:32 +03:00
Nekotekina 2047cb8d1d CFG: print errors for enums 2017-08-13 21:39:08 +03:00
Nekotekina 24f9f06279 Check FNID duplication 2017-08-13 21:39:08 +03:00
Nekotekina b671bb72dc Rewrite Drag&Drop classification 2017-08-13 21:39:08 +03:00
Nekotekina af11ad6253 Fix deadlock in vm::unmap 2017-08-13 21:39:08 +03:00
Nekotekina 0d9b89fb34 Update supporters 2017-08-13 21:39:08 +03:00
RipleyTom 80fee5ac1e (#3214)
Adds cpu to log.
Adds [DO NOT USE] to D3D12 selection.
2017-08-13 18:32:48 +03:00
Talkashie a909bd6edd Register missing functions in cellSysutil (#3206) 2017-08-13 00:32:00 +03:00
Megamouse eeb4d4d4de emu_settings: fix faulty custom config file creation 2017-08-12 12:53:51 +03:00
Megamouse 4c42043940 game_list_frame: add scrollAfter option to Refresh for Talkashie 2017-08-12 12:53:51 +03:00
praydog 6136abd0f8 Minor DS4 Bluetooth fix (#3140)
* Fix DS4 input not working after controller restart (bluetooth)

* Fix bad hid_free_enumeration logic

* Tabbing

* Proper way of telling DS4 to send 0x11 reports

* Dead code removal
2017-08-11 00:41:13 +03:00
Zion Nimchuk 69a5f3d58b Update ffmpeg 2017-08-10 15:34:55 +03:00
scribam 98ef419abd Add sceNpTssGetDataNoLimit and sceNpTssGetDataNoLimitAsync functions 2017-08-10 15:03:54 +03:00
scribam 77354f0f90 Add _sce_net_add_name_server function 2017-08-10 15:03:54 +03:00
scribam 108f87c08f Add cellUsbdRegisterCompositeLdd, cellUsbdUnregisterCompositeLdd and cellUsbdResetDevice functions 2017-08-10 15:03:54 +03:00
scribam 08e2698b9c Add cellSearchGetContentInfoSharable function 2017-08-10 15:03:54 +03:00
scribam 6e81db7b43 Add cellVideoOutSetCopyControl function 2017-08-10 15:03:54 +03:00
scribam e9f12ae30a Stub cellAvconfExt functions 2017-08-10 15:03:54 +03:00
scribam 2f977aae18 Stub cellSysutilAvc2 functions 2017-08-10 15:03:54 +03:00
Megamouse 0e5a862d8a fix resize on boot 2017-08-10 02:53:40 +03:00
kd-11 1e46cd255b gl: Fix inconsistent state tracking 2017-08-10 00:16:20 +03:00
kd-11 e5e6af41a6 gl: Fix occlusion statistics clearing 2017-08-10 00:16:20 +03:00
kd-11 ce437eb8d2 gl: Properly initialize pipeline properties 2017-08-10 00:16:20 +03:00
kd-11 4c019c55d2 rsx/gl: Fix zcull queries and log conditional render modes
- Fixes a situation where a query readback is requested while zcull render is still active
2017-08-10 00:16:20 +03:00
Megamouse ae440a92ac use new range for combobox, remove obsolete code 2017-08-09 23:44:29 +03:00
Robbie 54d2e8bfdd Remove some warnings from Linux and fixed something from code review. 2017-08-09 22:11:28 +03:00
Robbie 3f206981d9 Finesse size of goto address. Downgrade image loading failed to warning. 2017-08-09 22:11:28 +03:00
Robbie fa7407cd42 Remove about 100 warnings from rpcs3qt code. 2017-08-09 22:11:28 +03:00
Robbie 866b9524b3 Add rpcs3 icon to save dialogs. 2017-08-09 22:11:28 +03:00
Robbie d1cde4d0a7 Perform refactoring of pads to remove the ugly pad initialization. 2017-08-09 22:11:28 +03:00
Zion b01e7e3362 Fix Fedora glew install instructions, Fixes #3182 2017-08-09 14:19:25 +03:00
Aurora e9b020beaa Update build instructions for macOS 2017-08-08 23:20:07 +03:00
Aurora 2fcd38c2bc Reduce the zero-page size on macOS, so that PPUThread works 2017-08-08 23:20:07 +03:00
Aurora 300b34e268 Disable PIE on macOS too 2017-08-08 23:20:07 +03:00
Aurora ce0e87373d Update hidapi 2017-08-08 23:20:07 +03:00
Aurora 7e1c6a5819 Make it build on macOS with Clang 2017-08-08 23:20:07 +03:00
Nekotekina 613214cdca Improve error formatting 2017-08-08 22:17:51 +03:00
Malcolm Jestadt 009f53a267 fix segfault in boot recent list 2017-08-08 02:34:24 +03:00
Megamouse f3ad922a8f drag and dropperinno (#3037) 2017-08-06 22:29:28 +03:00
Nekotekina 7b27a8e993 Fix idm::init, fxm::init 2017-08-06 16:13:11 +03:00
kd-11 fcb7072fee Implement hardware zcull emulation
rsx/gl: Support s1 immediate values; ogl minor refactoring
2017-08-06 14:29:42 +03:00
kd-11 7ab1792ef7 rsx: Implement conditional locks 2017-08-06 14:29:42 +03:00
Jan Beich 40d305b35d Make ALSA optional 2017-08-06 02:02:57 +01:00
RipleyTom 2d7e91ba8a Yield instead of sleeping rsx thread. (#3158)
Another Yield
2017-08-06 01:46:01 +01:00
Nekotekina b05434bc6f Fix Firmware message 2017-08-05 17:07:30 +03:00
Nekotekina 7b4c044480 Relax allocations in ppu_load_exec 2017-08-04 14:33:53 +03:00
Nekotekina c14eb4e54a Implement error report stacking 2017-08-04 14:33:53 +03:00
Nekotekina f6c8f46462 CFG: catch exceptions 2017-08-04 14:33:53 +03:00
Nekotekina faf9ed9fec CFG: provide _int range in to_list() 2017-08-04 14:33:53 +03:00
Megamouse 930ce4af60 log_frame: fix random stack 2017-08-03 23:06:54 +03:00
Megamouse d51a986dd4 GUI: fix icon sizes and exterminate gamelist bug
recreate old icon size values
2017-08-03 23:06:54 +03:00
Jake 02845f546e Add gcm to auto lle / liblv2 2017-08-02 01:33:12 +03:00
Jake fff34a7f0f d3d12: Fix 0 sized framebuffer crashes 2017-08-02 01:33:12 +03:00
Jake 21dd715b42 sys_rsx: implement support for lle-gcm 2017-08-02 01:33:12 +03:00
Jake d9a693019b rsx/gcm: Implement rsx dma. Refactor gcm/rsx to not be as codependent 2017-08-02 01:33:12 +03:00
mp-t 607d2486ea Code review (#3114)
* Fix always-true conditions in sceNp module

* gl_render_targets: useless check on unsigned variable, possible bug

* fixed UB in crypto utility functions

* copy-paste error in vk::init_default_resources

* pass strings by const ref

* Dont copy vectors. Make sure copies are not needed because functions are used in a multi-threaded context.
2017-08-01 20:22:33 +03:00
Nekotekina 77f58326af Add supporters 2017-07-30 01:09:42 +03:00
Nekotekina bf14cbdb27 Fix _sys_lwcond_signal, _sys_lwcond_signal_all 2017-07-30 01:09:42 +03:00
Nekotekina 93db420f80 sys_lwmutex, sys_lwcond refactoring 2017-07-30 01:09:42 +03:00
Nekotekina a209d0d7fa Minor fix of sys_event_queue_receive 2017-07-30 01:09:42 +03:00
Nekotekina f564a72d03 SPU: minor optimization 2017-07-30 01:09:42 +03:00
Talkashie aeb01bd216 Update outdated firmware log message 2017-07-30 01:10:24 +03:00
Zion bc4d73da02 Bundle Qt5Svg.so, Fixes #3094 (#3120)
Bundle Qt5Svg.so, Fixes #3094
2017-07-29 04:39:20 +01:00
Robbie f9e996e006 Rewrite memory pool to be thread safe. 2017-07-28 23:50:21 +03:00
Megamouse 4dbc546e7b GUI: add custom config indicator (#3108)
* game_list: add custom config indicator

* icon resize: get rid of duplicate call (great performance boost)

* icon resize: only save on slider release or clicks (performance)

refactoring shenanigans

* game_list: skip filtered out games in Refresh (performance)

* settings_dialog: remove unnecessary show() that caused glitches

* gs_frame: add disableMouse setting

* fix travis warnings
2017-07-28 23:03:48 +03:00
Zion 9a1a7dd531 Fix build (#3117) 2017-07-28 16:30:35 +01:00
Talkashie 7ac96f7526 Fix missing newline, add periods, add tooltip for gs_resizeOnBoot (#3112)
* Update settings_dialog.cpp

* Update tooltips.json
2017-07-27 22:37:29 +01:00
kd-11 f613901eac gl/vk: Do not trust gcm buffer size to match internal rendering resolution
- Should fix games with strange scaling artifacts due to upscaling from lower resolutions
2017-07-27 14:33:30 +03:00
kd-11 4cd5624fa7 rsx/vk/gl: Refactoring - Also adds a vertex cache to openGL as well 2017-07-27 14:33:30 +03:00
kd-11 fc6891a0e3 ui: Restore 'Strict Mode Rendering' to GPU tab. Also add an option to disable the vertex cache
- Also, updates json tooltips for some options
2017-07-27 14:33:30 +03:00
kd-11 fb7ccbd7b4 vulkan: Workaround to avoid lockup due to double fault
- TODO: Ensure no page faults occur within a page-fault handler!
2017-07-27 14:33:30 +03:00
kd-11 17c399d4e8 spu: acquire_pc rewritten to be more precise in timing
- More accurate pauses may slightly reduce performance but makes it more viable
  to allow more threads to participate without stuttering
2017-07-27 14:33:30 +03:00
kd-11 dd19622823 vulkan: Texture cache rewritten - Use a map of vectors instead of a flat array 2017-07-27 14:33:30 +03:00
kd-11 46fa6e47fe rsx/vk: Vertex cache rewritten, add option to disable it as well
- Also enable SPU loop detection by default while were at it
2017-07-27 14:33:30 +03:00
Nekotekina 7fa42cfaad Fix sys_semaphore_wait (on timeout) 2017-07-26 22:35:45 +03:00
Nekotekina 5d8640109d Add supporters 2017-07-26 22:24:35 +03:00
Nekotekina 6f6b23e879 Delete make_fself.cmd 2017-07-26 21:29:49 +03:00
Nekotekina d2116a187e Update tooltips 2017-07-26 21:27:34 +03:00
Nekotekina f58652e51c cellRec: fix vm::bptr 2017-07-26 21:09:00 +03:00
Nekotekina bf53035e3f IPC support for lv2 sync objects 2017-07-26 21:03:41 +03:00
Nekotekina 60c6bb9865 Restore hook static functions 2017-07-26 21:03:41 +03:00
Nekotekina 67b71c0f89 Fix sys_rwlock_wunlock 2017-07-26 21:03:41 +03:00
Nekotekina 5766fb1f31 Fix sys_rwlock_wlock 2017-07-26 21:03:41 +03:00
Ryan Gonzalez dbd69536ed Linux evdev joystick support (#2885)
* Linux evdev joystick support (#2678)

* Cleanup libevdev configure code

* evdev fixes

* Evdev joystick additions/fixes

* Error message tweak

* Fix evdev multiple joysticks (thanks @hcorion!)

* Change by-id to by-path in evdev
2017-07-26 21:03:06 +03:00
Zion Nimchuk 08f0047529 Refactor setsockopt for better cross-platform-ness 2017-07-26 20:27:07 +03:00
Zion Nimchuk 54a38aa927 Fix issue #2788 2017-07-26 20:27:07 +03:00
scribam 173cc13d01 Stub some cellSysutilAvc2 functions 2017-07-26 17:49:40 +03:00
scribam 1899f399b6 Mixed minor changes 2017-07-26 17:49:40 +03:00
scribam 4c5921a7a4 Stub some cellGameExec and cellResc functions 2017-07-26 17:49:40 +03:00
scribam be84dd73a9 Stub cellRec functions 2017-07-26 17:49:40 +03:00
Megamouse 9f3f07f3ae game_list: enable stepless icon sizes 2017-07-26 17:00:32 +03:00
Megamouse d260ccfc96 settings_dialog.ui: just LINUX things 2017-07-26 17:00:32 +03:00
Megamouse 1c3b9754aa settings_dialog: enable LLE List multiselection 2017-07-26 15:44:59 +03:00
Megamouse 37c26b77ee settings_dialog: make size consistent 2017-07-25 23:18:41 +01:00
Megamouse ff772dd28b game_list: fix sort and scroll 2017-07-25 17:37:29 +03:00
Zion Nimchuk 60e2928ec1 Fixes #3063 2017-07-25 03:42:04 +01:00
Zion Nimchuk f8e57147b0 Linux builds now link LLVM statically, fixed Qt libpng issue, moved to single AppImage 2017-07-25 02:41:05 +01:00
LambdaMan 1bef748dc4 Allow overlapping ranges in cellGcmMapEaIoAdress with coherency check (#3070)
According to Jarves, lle-gcm branch already does the same thing so we know the behaviour should be correct
2017-07-25 02:27:23 +03:00
RipleyTom b2fa0fdf53 Fix PARAM.SFO filename case (#3081)
For (get_list_item)
2017-07-24 23:53:20 +03:00
Megamouse ab198c0c5f gamelist: scroll fix (workaround) 2017-07-24 23:21:35 +03:00
Megamouse f577af452d Update Framelimiter Tooltip 2017-07-24 23:21:35 +03:00
Megamouse a7802e9377 Settings Overhaul 2017-07-24 23:21:35 +03:00
kd-11 3b03f9a010 vulkan: Avoid double flushing if a texture is externally synchronized 2017-07-24 16:52:42 +03:00
kd-11 cb194e06ce gl: Fix framebuffer validity checks 2017-07-24 16:52:42 +03:00
kd-11 a24780fe5e vulkan: Avoid cache miss whenever possible if WCB is enabled 2017-07-24 16:52:42 +03:00
kd-11 a7c28f5827 rsx: Fix remainder/iteration computations in BufferUtils 2017-07-24 16:52:42 +03:00
kd-11 425821863b vulkan; Add a weak vertex cache with single frame validity 2017-07-24 16:52:42 +03:00
kd-11 8db6555bdb lower mt upload threshold to something useful 2017-07-24 16:52:42 +03:00
kd-11 6557bf1b20 rsx: More aggressive thread scheduling for vertex processing
- Significantly helps vertex performance
- Not recommended as more threads will harm performance if the PC does not have the cores for it
2017-07-24 16:52:42 +03:00
Robbie 6648084c64 Add Q_EMITs and clean up a couple signals. 2017-07-23 19:17:39 +03:00
RipleyTom 5543441618 xinput config file 2017-07-23 18:30:24 +03:00
Robbie 0508e1e638 Log marking. Useful for knowing when time based things happen in log. 2017-07-23 17:27:16 +03:00
Nekotekina adf119e960 sys_rwlock_runlock fixed
Registered _sys_rwlock_trywlock
2017-07-23 16:01:52 +03:00
Nekotekina 2bc57fbee3 LLVM: Add error message 2017-07-23 11:03:38 +03:00
Nekotekina 42b06af577 Force recompiling liblv2.sprx 2017-07-23 11:03:38 +03:00
Nekotekina f9a69c449d PPU LLVM: minor bitcast avoidance 2017-07-23 11:03:38 +03:00
Nekotekina 3f9affd2ad Stub some SPU syscalls 2017-07-23 11:03:38 +03:00
Nekotekina 23701248f3 Set LLVM recompiler as default 2017-07-23 11:03:38 +03:00
Nekotekina c9abab6828 cellGame: minor refactoring 2017-07-23 11:03:38 +03:00
Nekotekina 9dc9378bcc Fix illegal instruction message 2017-07-23 11:03:38 +03:00
Robbie 5cc152b8dd Save Data Note (#3054)
* Split save_data_utility into two classes.

* Add entry notes to saves.

* Code review changes
2017-07-23 10:55:08 +03:00
Megamouse 9bd6d28514 gs_frame: fix event 2017-07-22 20:34:56 +03:00
Megamouse 58816e314c main_window: adjust toolbar size to prevent blurry icons 2017-07-22 20:34:56 +03:00
Megamouse e93fbc6900 Merge pull request #3 from RipleyTom/OpenGLFix
Fix openGL
2017-07-22 20:34:56 +03:00
Megamouse f8c2e198c5 gs_frame: fix the mysterious "second boot crash" 2017-07-22 20:34:56 +03:00
Megamouse f69e252c7a cg_disasm: fixerinno 2017-07-22 20:34:56 +03:00
Megamouse 96dfa9b526 Splitter fix 2017-07-22 20:09:54 +03:00
Robbie 2b24635ef7 Scroll fix 2017-07-22 20:09:54 +03:00
Jake fde6099769 rsx: Fix vertex decompiler to support 2 arg destination 2017-07-22 09:41:00 +03:00
Jake 7b3693bb29 sys_timer: Fix initial timer state 2017-07-22 09:41:00 +03:00
kd-11 df8fa74e2a vulkan hotfix (#3046)
* Rework vertex attribute binding for vulkan. Allows always providing a buffer view to the pipeline even if the game has the attribute disabled as long as it is consumed by the vertex shader.
2017-07-22 01:54:28 +03:00
scribam 9747ab61f9 Missing function names (HLE) and small fixes (#3038)
* Add sceNpScoreGetFriendsRanking and sceNpScoreGetFriendsRankingAsync functions

* Add sceNpSnsFbGetLongAccessToken function

* Add new functions for the sceNpTus module

* Add new functions for the cellSailRec module

* Stub cellCrossControllerInitialize

* Add sceNpAuth* functions for the sceNp2 module

* Remove unnecessary call to c_str()

* Add missing module id "CELL_SYSMODULE_ADEC_AT3MULTI"

* Add Turkish keyboard mapping constant

* Add cellOskDialogExtRegisterKeyboardEventHookCallbackEx function

* Update cellSubDisplay

* Update cotire version to 1.7.10

* Replace cellSubdisplay by cellSubDisplay

* Update cellSysutil.cpp with new functions stubbed
2017-07-21 18:41:11 +03:00
Nekotekina d7e72797a8 Version 0.0.3 2017-07-20 18:05:34 +03:00
Nekotekina 0dfd2eadc1 Travis: do not zip 2017-07-20 18:02:26 +03:00
Nekotekina 291ec1eeb2 SPU recompiler: minor optimization 2017-07-20 17:22:09 +03:00
Nekotekina b24eb621ae Use RTM instructions (skylake+) 2017-07-20 17:22:09 +03:00
Nekotekina 0fa148e65e Improve CPU feature check
Damn exit on SSSE3 failure
Check AVX for Intel processors
2017-07-20 17:22:09 +03:00
Talkashie 3f6b24d33a Correct typo
No classes or names or any of that poop are being changed here, only a text string.
2017-07-20 15:43:24 +03:00
Danila Malyutin 9fee2ebeb5 Enable optimizations on travis 2017-07-20 01:17:51 +03:00
kd-11 99828a8f15 spu: Clean up asmjit - avoid touching the shared db whenever possible
- Gets around the locking issues when fetching from the shared db
2017-07-19 23:28:33 +03:00
kd-11 2526626646 rsx: Surface cache bug fixes
- Properly handle data 'transfer' when recycling frame buffer images
- Clear 'recycled' surfaces before use
2017-07-19 23:28:33 +03:00
kd-11 582913dc31 spu: Simplify watchdog design (PC is purely HLE and occupies SPU code kernel space only, max 256K) 2017-07-19 23:28:33 +03:00
kd-11 94c1b74a17 fix build; restore asmjit reader_lock for now 2017-07-19 23:28:33 +03:00
kd-11 cbd1b28d0d spu: Add polling loop detection and clean up channel access contention code
- spus run a tight gpu-style kernel with no multitasking on the cores themselves
-- this does not map well to PC processor cores because they never sleep even when doing nothing
-- the poll detection hack tries to find a good place to insert a scheduler yield
-- RdDec is a good spot as it signifies the spu kernel is waiting on a timer
2017-07-19 23:28:33 +03:00
kd-11 05ffb50037 vk/rsx: Bug fixes and improvements
- Improvements to framebuffer usage; Avoid creating new resources every frame
- Handle null fragment program properly
- Collect vertex upload statistics

- vk: Pre-initialize 'unused' varying registers in the vertex shader in case it gets matched with a fs that consumes it
 -- Fixes a crash about fog_c not being declared

gl/dx12/vk: Handle null fragment program

- cleanup - use yield semantic instead of sleep(0) as yield is more cross-platform
 -- sleep(0) is a windows specific scheduler hint
2017-07-19 23:28:33 +03:00
kd-11 72e13ddeb2 spu: Implement concurrent instruction execution watchdog for wrch
- Delays threads by a predetermined amount to 'desync' spurs kernels.
  Largely reduces lock contention issues as well as making spurs kernels
  play nice with reservations
- Also reduces number of lost notifications (SPU_EVENT_LR)
2017-07-19 23:28:33 +03:00
kd-11 78f09d7645 asmjit: Minimal locking when reading, also only lock when actually writing to the db 2017-07-19 23:28:33 +03:00
kd-11 f69121116a rsx/vk: Optimize framebuffer lifetime management
- Significant gains due to avoiding aggressive create-delete cycles every frame
2017-07-19 23:28:33 +03:00
RipleyTom 0136215ef1 Minor sceNpBasicGetEvent Fix 2017-07-19 21:41:37 +03:00
Megamouse ab534ac55d main_window fixerinno
remove sinful toolbar sorcery
2017-07-19 21:16:13 +03:00
Megamouse 67bbd59924 debugger_frame fixerinno
delete zombie dialog
clear breakpoints properly
2017-07-19 21:16:13 +03:00
RipleyTom f0b1a587aa Implements deadzone for xinput 2017-07-19 20:35:12 +03:00
Megamouse ae8f858c56 settings_dialog: get rid of string duplication
use enum to dictate button id
2017-07-19 17:40:27 +03:00
Dangles91 7426eb285f Fixes for save_op_get_list_item
Only return data for dir and bind where requested. Some games like Akiba's Trip call this function but don't ask for any data back.
2017-07-18 15:22:49 +03:00
Nekotekina f91f2e3e6d Patch: add floating point support
Also count applied entries
2017-07-17 18:36:54 +03:00
Nekotekina e39ee10105 Patch system improved
SPU patch rewritten
PPU patch implemented
2017-07-17 16:49:46 +03:00
Nekotekina 2ef2f0f63b PPU LLVM: simplify module loading 2017-07-17 16:49:46 +03:00
Nekotekina e875c91121 Restore timeBeginPeriod 2017-07-17 16:49:46 +03:00
Dangles 6610abcd5f Minor changes for save data utility (#3005) 2017-07-16 19:10:45 +03:00
Megamouse aed9b31294 add system_info.h (#2985)
add system info to log
add SSSE3 Error message to main_window
2017-07-16 17:36:38 +03:00
Zion Nimchuk 6597eb27c7 Fix PIE being on by default 2017-07-16 16:59:46 +03:00
Megamouse 035a39a9a8 GUI: minor figgcess (#3010)
* emulator tab: minor layout adjustment

* tool bar: adjust size dynamically for hidpi

* gamelist tool bar: adjust size dynamically for hidpi

* gamelist search bar: adjust style

* move game_list.h into rpcs3qt

* hide game data by default
2017-07-15 21:22:24 +03:00
Learath2 9c547d5eef Fix bug with std::stof being locale-dependant (#3012) 2017-07-15 03:38:10 +03:00
Learath2 504fa5ffda Add version to install firmware dialog (#2958) 2017-07-14 18:34:05 +03:00
Megamouse ad66dbfd0b Add game window resize on boot (#3000) 2017-07-14 18:10:38 +03:00
Megamouse 0adb579736 rename controls to keyboard 2017-07-14 17:45:47 +03:00
Megamouse d4c83e5dd2 Settings: fix cameraBox 2017-07-14 17:45:47 +03:00
Megamouse 821a8c6e65 settings_dialog: add icon hints to color buttons 2017-07-14 17:20:41 +03:00
Megamouse ef60809219 move colorizedIcon to gui_settings 2017-07-14 17:20:41 +03:00
Megamouse a21ed06d27 Icons (blue): fix inconsistent colors 2017-07-14 17:20:41 +03:00
Megamouse 97f59405aa game_list_frame: repaint tool icons 2017-07-14 17:20:41 +03:00
Megamouse b586bd3b10 gui_settings: add gamelist tool icon color 2017-07-14 17:20:41 +03:00
Megamouse c617b17037 settings_dialog: add color picker for gamelist tool icons 2017-07-14 17:20:41 +03:00
Megamouse 73bbfcb246 main_window: repaint tool icons 2017-07-14 17:20:41 +03:00
Megamouse cfa7d04c49 settings_dialog: add color picker for main window tool icons 2017-07-14 17:20:41 +03:00
Megamouse fb191693d1 gui_settings: add tool icon color 2017-07-14 17:20:41 +03:00
Megamouse 743a19027a game_list_frame: add method colorizedIcons 2017-07-14 17:20:41 +03:00
Robbie ced539579e Murdering a wx zombie 2017-07-14 14:20:07 +03:00
Robbie 225af34ce9 For the Neko 2017-07-14 14:20:07 +03:00
Robbie eb80b7ec34 Small main_window refactoring. Fixed one of the guiconfig crashes too somehow. 2017-07-14 14:20:07 +03:00
Talkashie 3df960bb52 Fix various typos and capitalisation inconsistencies.
also Jarves please implement sysutils
2017-07-14 13:54:13 +03:00
Nekotekina 25fcde9507 Rearrange /dev_bdvd mounting logic
Prevent booting patches without /dev_bdvd
Prevent booting with foreign /dev_bdvd
2017-07-14 03:39:22 +03:00
Nekotekina d8abe75526 Improved sprx boot (for devs only) 2017-07-14 01:47:00 +03:00
Nekotekina 15fe8f1c51 Fix cmdline start 2017-07-14 01:47:00 +03:00
scribam ce7b55871b Add sceNp2* functions 2017-07-14 01:46:07 +03:00
scribam 9d8fa28dd9 Add sceNp* functions 2017-07-14 01:46:07 +03:00
scribam 3a3e9770f3 Add cellHttp* functions 2017-07-14 01:46:07 +03:00
scribam 2d037fa130 Remove "#pragma once" directive in a cpp file 2017-07-14 01:46:07 +03:00
Robbie ab595d2b95 Improve Save Manager (#2951)
* Add the save icons to the save data entry and manager.

* Simplify code slightly since I have an else now so no need for == false

* Move the icon to the top of the list because it looks better.  Remove redundant settitle.

* Fix size.  It's a bit forced but there wasn't any better way as far as I could see on stack overflow.

Also, add an error dialog if you have no entries.

Simplify the logic slightly for the selected since with the no data case handled, I can make more assumptions about the return value.

* save_data_utility: fix dialog sizes

* CELL_OK

* Retcon dialog to instead be error in log.

* Dangle92 and I had some fun. Everything should be good now.

* In dangle's code he disabled the icon, in mine I hide it if there is nothing. Having both isn't needed.  Yay merges resulting in doing stupid things.

* Fix leek

* Default size to zero for sanity. Shared pointer is fine handling null (tested with disgaea and renaming icon file)

* Simplifying. Thanks for review and advice all
2017-07-13 18:38:13 +03:00
Megamouse e8ba5876ce clean up some unused / redundant includes 2017-07-13 16:38:50 +03:00
Megamouse 2cd5f63284 game_list: enable deselection + fix entry selection 2017-07-13 16:38:50 +03:00
RipleyTom d410494a7d Fixes pkg overwriting files without the PKG_FILE_ENTRY_OVERWRITE flag 2017-07-13 15:43:13 +03:00
Robbie dcfe8e1abd fixz (#2996)
Patch crash regression in game grid
2017-07-13 04:05:29 +01:00
Nekotekina 7702eb2fa7 PPU: clean linkage info 2017-07-12 21:29:09 +03:00
Megamouse bb563b3eb7 minor menu fix 2017-07-12 21:00:13 +03:00
Nekotekina 4913cac24f Refresh game list after booting 2017-07-12 19:41:33 +03:00
Nekotekina 113b937263 Fix moving game dir 2017-07-12 19:35:46 +03:00
Nekotekina a5c431c2b7 _lv2prx mutex implemented 2017-07-12 19:11:51 +03:00
Nekotekina 5ba23ac4c4 sys_lwmutex_locker aux class 2017-07-12 19:09:53 +03:00
Nekotekina f7472d59aa GUI: fix recent entry duplication 2017-07-12 18:16:09 +03:00
Nekotekina 3cd4256b9e Fill game list from all locations 2017-07-12 18:16:09 +03:00
Nekotekina 08e9400870 Improve booting disc games
Store disc locations for disc games
Create /dev_hdd0/disc/ directory
Move disc games from /dev_hdd0/game/ to /disc/ automatically
Load disc game patches automatically
2017-07-12 16:38:19 +03:00
Nekotekina 420bfef214 Cleaning after PoorRequest 2017-07-12 14:07:38 +03:00
Nekotekina ae265f7586 GUI: Disable poorly designed limitations 2017-07-12 14:00:38 +03:00
Nekotekina ff53ff3bbf Force HLE for net-related libraries 2017-07-12 14:00:38 +03:00
Nekotekina 4a512694d9 Implemented _sys_memchr 2017-07-12 14:00:38 +03:00
Nekotekina 8202352452 Do not load sprx twice 2017-07-12 14:00:38 +03:00
Nekotekina 73a2a937c4 PPU LLVM: reuse loaded executables 2017-07-12 14:00:38 +03:00
Nekotekina a51f82c949 GUI: add supporters 2017-07-12 14:00:38 +03:00
Nekotekina 3278062c29 PPU: load only libsysmodule.sprx 2017-07-12 14:00:38 +03:00
Nekotekina 74f2be7307 PPU: free prx segments 2017-07-12 14:00:38 +03:00
Nekotekina 0ee454f44b vm: decommit by exec_addr 2017-07-12 14:00:38 +03:00
Nekotekina 9a38d63661 Store sys_spu_image value 2017-07-12 14:00:38 +03:00
Nekotekina bab537c7e2 PPU LLVM: unuse FP_SAT_OP 2017-07-12 14:00:38 +03:00
Robbie a426d32a36 Search for threads. 2017-07-12 04:56:07 +03:00
Robbie 9403948ce3 Disable remove custom config if no custom config exists. 2017-07-12 03:19:24 +03:00
Robbie 0405b860c6 Add $(EmulatorDir) to VFS dialog 2017-07-12 03:19:24 +03:00
Robbie 83df572604 Fix a couple crashes 2017-07-12 03:19:24 +03:00
Robbie 0698136c63 Add ui_*.h to gitignore 2017-07-12 03:19:24 +03:00
Megamouse 67f1fa086d debugger_frame: transfer capture button from main_window menu
and clean up some unused actions in main_window.ui
2017-07-12 00:56:53 +01:00
Megamouse 06f6ac66fa debugger_frame: remove pause button
and move its functionality to run button
2017-07-12 00:56:53 +01:00
RipleyTom 34709eb399 Fix Stswi instruction 2017-07-10 18:42:02 +03:00
scribam 5c60a99cc4 Check if the pth is a valid directory before to look for icons. 2017-07-10 17:39:45 +03:00
Robbie cea0ff4598 Fix VFS default button (#2975) 2017-07-10 14:43:57 +01:00
Megamouse b7aed7bbde Dagimon super mega level
add stretchToDisplayArea to settingsdialog

fix color picker and toolbar background

settingsdialog adjustments

fix tooltips + .pup

fix adapter box
2017-07-10 16:15:57 +03:00
Megamouse 1a4e1919fc Dagimon mega level
ani fixes

add color options for toolbar and game icons
2017-07-10 16:15:57 +03:00
Megamouse 457c2d364f Dagimon ultra level
gui new design: hidpi fixes

settings_dialog fix glitch

welcome dialog hdpi adjustments

about dialog hdpi adjustments

about dialog fix size

pad dialog hdpi adjustments

settings_dialog: remove SetActiveTab
2017-07-10 16:15:57 +03:00
Megamouse c9e9fcd0a3 Dagimon champion level 2017-07-10 16:15:57 +03:00
Megamouse 9f8eb88a9f Dagimon rookie level
fix lib stuff

fix build

add slider amd searchbar

disable gamelist toolbar per default

Dagimon rookie level
2017-07-10 16:15:57 +03:00
raven02 2e47c42367 Add Stretch to Display Area option (#2961) 2017-07-08 16:06:11 +03:00
kd-11 41d921808b spu: Reimplement FCGT and FCMGT to handle corner cases (such as comparisons against infinites and denormals)
- Also optimize FMA/FMS/FNMS for recompiler
2017-07-08 14:52:16 +03:00
kd-11 9e7a42d057 rsx: Minor bug fixes
- vk: Do not select first available format when choosing a swapchain format
- gl/vk: Ignore rendering zero sized framebuffers/scissors
- fp: Re-enable range clamp on fp16 registers; fix fx12 clamping [-2, 2]
2017-07-08 14:52:16 +03:00
kd-11 d43e06c0ea rsx: Fix some fp bugs
rsx/fp: Properly fix RCP
- Input is always scalar, output is a vector

rsx/fp: Ignore forced unit for SIP and TEX instructions
2017-07-08 14:52:16 +03:00
kd-11 c788331e45 vk: Fix layout transitions 2017-07-08 14:52:16 +03:00
kd-11 3d935b64f2 rsx/gl/vk: Enable contents transfer when a new framebuffer is created and not cleared 2017-07-08 14:52:16 +03:00
kd-11 e9b8f94fb1 rsx/gl/vk: Enable frame skipping 2017-07-08 14:52:16 +03:00
kd-11 b95ffaf4dd rsx: Implement skip draw. Also, start working on MT vertex upload 2017-07-08 14:52:16 +03:00
kd-11 ab97a0a5a3 spu: dma tweaks 2017-07-08 14:52:16 +03:00
Megamouse e74d6446c8 msg_dialog_frame: hidpi fixes for osk_dialog 2017-07-07 01:53:42 +03:00
Megamouse cbb7753227 msg_dialog_frame: hidpi fixes for m_dialog
move spacings up
2017-07-07 01:53:42 +03:00
Zion Nimchuk 78fad1a372 Finalize AppImage build 2017-07-04 21:19:33 +01:00
RipleyTom d793f8ad78 Implements sys_fs_disk_free 2017-07-04 16:16:32 +03:00
Nekotekina dda274afb0 Fix Miku OP video
And break something else
2017-07-04 02:04:22 +03:00
Nekotekina f0d184f38b PPU LLVM: relocation support 2017-07-04 02:04:22 +03:00
Nekotekina 9fccb47e7c bf_t: fix warning 2017-07-04 02:04:22 +03:00
Robbie fd1ca2f102 Change default selection button to select entry instead of cancel. 2017-07-03 23:56:55 +03:00
Robbie 458968658f Fix akiba with cell cancel 2017-07-03 23:56:55 +03:00
Martin Lindhe 051dd388d7 remove invalid comment 2017-07-03 23:30:09 +03:00
Zion 233506480b Fix CMake build instructions on Linux (#2946)
Fix CMake build instructions on Linux
2017-07-03 19:30:34 +01:00
Martin Lindhe 37898d38e5 README: add fedora instructions 2017-07-03 17:51:39 +01:00
Martin Lindhe be441bd3a7 README: relax qt5 version requirement to 5.7 2017-07-03 17:32:14 +01:00
Martin Lindhe 2e9a543598 qt: relax dependency to qt 5.7 2017-07-03 17:32:14 +01:00
Robbie 190a59ce03 Basic Save Manager (#2924)
* The basic unstubbing.  Save entries will be listed and you can select a save.  If you select none, then it'll work as well.  WIP

* Filled out the trivial parts of the info dialog.

* Finish implementation and clean up.  No "maintain" dialog or context menu for now until the copy/delete functions are implemented.

* Fix crash

* Update cellSaveData.cpp
2017-07-01 21:42:09 +03:00
Zangetsu38 253e7a90b8 vk: add "add_signed" in blend op. 2017-06-30 18:40:40 +03:00
Megamouse fd4a153eef GUI fixes + log stacking (#2897)
* Add Stacking option to log contextmenu

Squashed commit:

[69f296af] cleanup

[4f4bf41f] use contextmenu instead

[e67036bc] use gui settings instead (+1 squashed commits)

Squashed commits:

[b3913dbe] fix backwards selection (+1 squashed commits)

Squashed commits:

[1e150f04] add stacking option (+3 squashed commit)

Squashed commit:

[be78da4f] fix scroll

[d3450c21] fix clearSelection

[e962ec9c] fix log color issue

* fix recent games related app crash

* gamelist improvements

Squashed commit:

[aa1f79c2] fix title names & con background

[d8381984] fix gamelist search

* finally fix show menu bug

* add rows to gamelist: resolutions, sound formats and parental level

* fix gamelist loadsettings
2017-06-30 15:41:40 +03:00
Inviuz 645f0e63ab REF 57 plus FREF fix
kept bothering me until i realized what was wrong with it
2017-06-30 14:24:00 +03:00
Nekotekina c087a9534a PPU LLVM: SSA reordering
Fetch indirect jump target
Flush registers earlier
2017-06-29 17:48:55 +03:00
Nekotekina da87bb6710 PPU LLVM: minor fix 2017-06-29 17:48:55 +03:00
Nekotekina 3c064439b3 PPU LLVM: new mptr/cptr format 2017-06-29 17:48:55 +03:00
Nekotekina 85f8a42bd2 PPU: MTOCRF optimization 2017-06-29 17:48:55 +03:00
Nekotekina ef55d6fa0c PPU LLVM: less trash, fix crash 2017-06-29 17:48:55 +03:00
Nekotekina aa34fa8baa PPU LLVM: some passes disabled 2017-06-29 17:48:55 +03:00
Nekotekina 2629f9be44 PPU: VREFP, VRSQRTEFP changed 2017-06-29 17:48:55 +03:00
Nekotekina fc2a45d6d6 Removed unnecessary code 2017-06-29 17:48:55 +03:00
Nekotekina 22af341ad3 umulh64, mulh64 moved; added ror8/16/32 2017-06-29 17:48:55 +03:00
kd-11 a69f19a9ab rsx/decompilers: Avoid std::endl like the plague. It adds extra processing overhead 2017-06-29 13:13:19 +03:00
kd-11 d7662e54cc rsx/fp: Do not swizzle shadow lookups 2017-06-29 13:13:19 +03:00
kd-11 459a7ba5a2 rsx: Avoid using push_back/emplace_back on empty STL containers
- Reckless management of STL containers causes significant slowdown
- Also reorders vertex compare steps to fail quickly on simpler checks
2017-06-29 13:13:19 +03:00
kd-11 9cb58a47cd gl: Avoid creating surface copies when strict mode is disabled. 2017-06-29 13:13:19 +03:00
kd-11 3651e67a25 vk: Fix mapping of output colors to render target ranges 2017-06-29 13:13:19 +03:00
kd-11 8a0f6f1cbc gl: Fix legacy ring buffer address alignment
- Should always return a base address aligned to the buffers alignment.
- Fixes renderdoc crashes when capturing
2017-06-29 13:13:19 +03:00
kd-11 9cbaacb13f cellVideoOut: Enable 59.94 Hz required for some games 2017-06-29 13:13:19 +03:00
kd-11 1887e2460f rsx: Use loose memory protection on textures since they're almost guaranteed to be wholly moved when changing. Speedup. 2017-06-29 13:13:19 +03:00
kd-11 6e578c4fde rsx: Initialize declared but unset varying variables to all ones 2017-06-29 13:13:19 +03:00
kd-11 47e5074dc5 rsx: Emulated index buffers are based on vertex 0 with no disjoint ranges
- Drop the 'first' argument as it is unused for now
2017-06-29 13:13:19 +03:00
kd-11 74d8619240 dx12: Fix error reporting 2017-06-29 13:13:19 +03:00
Nekotekina 89f676de75 PPU: preparations (no fixes) 2017-06-26 16:56:13 +03:00
Nekotekina 061c92ba1f PPU LLVM: Improve FlushRegisters 2017-06-26 16:56:13 +03:00
Nekotekina 8034196c25 ppu_syscall_code type added (for fmt) 2017-06-26 16:56:13 +03:00
Nekotekina f49a30bc1a PPU LLVM: disable unnecessary passes 2017-06-26 16:56:13 +03:00
Nekotekina 1196e9decc PPU LLVM: remove unnecessary code 2017-06-26 16:56:13 +03:00
Nekotekina cd4f290d3d PPU LLVM: v2, simplification (no allocas) 2017-06-26 16:56:13 +03:00
Nekotekina 45fae363c6 PPU LLVM: MFCR optimized 2017-06-26 16:56:13 +03:00
Nekotekina 9738ce0cf6 LLVM: fix cancellation 2017-06-26 16:56:13 +03:00
Nekotekina e5ae32e5f3 Fix #ifdef style 2017-06-26 16:56:13 +03:00
Inviuz 81ab6ab8b4 FREFS/weak imports and VREFS 4 and 6 2017-06-26 14:17:34 +03:00
Megamouse cfbfdd7b8a dialog fixes for multithreading (#2913)
* add appicon to msg_dialogs

* give every msg_dialog its own taskprogress

* weird little m*f* algorithm
2017-06-26 02:44:52 +03:00
Megamouse 8d0e7adb62 fix image load log message 2017-06-25 00:13:10 +03:00
Megamouse 96a893120d disable compat for non ps3 games 2017-06-25 00:13:10 +03:00
Megamouse a1c72de1eb add "Other" category
include all categories to list and filters
2017-06-25 00:13:10 +03:00
Megamouse d11bb71a17 Reenable Home and Audio/Video interactions 2017-06-25 00:13:10 +03:00
Nekotekina 6561ddae41 PPU LLVM: multithread compilation 2017-06-24 19:12:19 +03:00
Nekotekina ef21e2253f qt: Use #pragma once, Q_SIGNALS, Q_SLOTS 2017-06-24 14:25:11 +03:00
Nekotekina dd553331df qt: Remove emit 2017-06-24 14:25:11 +03:00
Nekotekina d86858da64 Fix tabs 2017-06-24 14:25:11 +03:00
Nekotekina fcefbf26c6 wxFuneral 2017-06-24 14:25:11 +03:00
Nekotekina 79a3b308d1 qt: Update about dlg 2017-06-24 14:25:11 +03:00
Robbie 5ecc7d5360 Fix issue with msgdialog not passing event back properly. 2017-06-24 13:59:07 +03:00
Nekotekina 321f50bf7b qt: Fix kb pad handler 2017-06-23 20:09:33 +03:00
Nekotekina d0b37777c3 Remove throw cpu_flag 2017-06-23 20:09:33 +03:00
Nekotekina aea094730b PPU LLVM: paradigm shift
For now, compile only one block at time
Use tail calls to move between blocks
Fully write PPU context (except CIA)

This fixes many compatibility problems
2017-06-23 20:09:33 +03:00
Nekotekina a29d7d3962 LLVM: implement STSWI, LSWI...
Fix DIVD, DIVDU, DIVW, DIVWU, MULHW
Removed __adde_get_ca in ADDE, SUBFE
2017-06-23 20:09:33 +03:00
Nekotekina 155f13ed54 Workaround booting NP games 2017-06-23 20:09:33 +03:00
Nekotekina 82a296f900 PPUOpcodes.h updated 2017-06-23 20:09:33 +03:00
Nekotekina 0df861d7b5 Added uptr type 2017-06-23 20:09:33 +03:00
Nekotekina 0890cc3e49 qt: Fix OutDir config 2017-06-23 20:09:33 +03:00
Nekotekina 0da9c8d20c qt: Fix logging 2017-06-23 20:09:33 +03:00
Zion b3c4ec4b55 Fix Travis build (#2902) 2017-06-23 16:51:39 +03:00
Megamouse 4ce8e9ba16 fix debugger o.O (#2903)
* fix debugger o.O

* minor simplification

* how did I not see this the first time
2017-06-23 15:08:38 +03:00
Megamouse 51ce8f6c20 add No Thread option 2017-06-23 02:16:14 +03:00
kd-11 72edf26fb8 rsx/gui: Add a strict mode toggle. Also reorganizes the graphics tab a bit
code cleanup
2017-06-22 23:36:15 +03:00
kd-11 d2b3cf22e3 vs: drop user files from shipped vs files 2017-06-22 23:36:15 +03:00
kd-11 28f3e9a65b vk: Move resource init/destroy to constructor and destructor 2017-06-22 23:36:15 +03:00
kd-11 17318112eb rsx: Do not sample as pcf shader if writing a vector result 2017-06-22 23:36:15 +03:00
kd-11 590bb7cbe4 rsx: Bug fixes
rsx: Give more info when ring buffer allocations fail
2017-06-22 23:36:15 +03:00
kd-11 798f90dac2 rsx/ui: Make a few settings configurable via the GUI 2017-06-22 23:36:15 +03:00
kd-11 b2e906f4cc rsx: Code cleanup. Fixes several dozen warnings
- Wrap unused parameters as comments to prevent C1400
- Fix sized variable conversions with explicit casts
2017-06-22 23:36:15 +03:00
kd-11 11317acdbe rsx: Handle non-zero base vertex better
- Vertex buffer contents treat the base vertex as vertex 0 so we do the same for indices

rsx: Fix vertex base indexing

rsx: Properly fix non-zero offset indexed rendering
2017-06-22 23:36:15 +03:00
kd-11 5c6cf77c57 rsx: Register NV4097_SET_COLOR_KEY_COLOR method. 2017-06-22 23:36:15 +03:00
kd-11 13825c9ef7 vk: Proper shutdown to avoid destroying resources still in use 2017-06-22 23:36:15 +03:00
kd-11 6013b0782e vk: Avoid constantly reinitializing the SH context when compiling SPIRV. Speedup 2017-06-22 23:36:15 +03:00
kd-11 5f180e0b30 vk: Prefer optimal formats when clearing buffers 2017-06-22 23:36:15 +03:00
kd-11 84ae1c5214 gl: Silence log spam 2017-06-22 23:36:15 +03:00
kd-11 86adc42739 rsx/gl/vk: Invert default stencil values
- Fixes stencil volume shadows in a few games. This is part of the surface invalidation workarounds
2017-06-22 23:36:15 +03:00
kd-11 30f276a49b gl: Properly emulate signed normalized wide integers
Another fix for signed normalized formats; single component vectors are swizzled
2017-06-22 23:36:15 +03:00
kd-11 98cf72e0fb rsx: Fix clip space computations 2017-06-22 23:36:15 +03:00
kd-11 75964c686f rsx/gl/vk: Fix some warnings and whitespace issues (LF vs CRLF) 2017-06-22 23:36:15 +03:00
kd-11 0cb6dee474 vk/gl: Do not sample currently bound render targets
- Create temporary copies for use with the draw call instead
2017-06-22 23:36:15 +03:00
kd-11 db1a90d828 rsx: Discard surface store contents once per frame (temp workaround)
Need to find the proper command issued to discard all surfaces
2017-06-22 23:36:15 +03:00
kd-11 110974af0b vk/gl: Fix sampling of shadow2D textures 2017-06-22 23:36:15 +03:00
kd-11 69d3d47901 gl: Fix clip-space -> depth conversion. Fixes remaining depth read issues
- Also set some default values for samplers in a cleaner way using their 'natural' float values
2017-06-22 23:36:15 +03:00
kd-11 b50d5107b3 rsx/vk/gl: Minor fixes 2017-06-22 23:36:15 +03:00
kd-11 6a9eef0382 rsx/gl/vk: Enable use of native PCF shadows 2017-06-22 23:36:15 +03:00
kd-11 5f66d0b996 rsx/wip: Fix depth surface reuse and clearing (fixes shadows) 2017-06-22 23:36:15 +03:00
kd-11 701728ecd7 rsx: Fix depth-as-rgba read in fp 2017-06-22 23:36:15 +03:00
kd-11 423fd4a388 rsx: Fix stencil initial values 2017-06-22 23:36:15 +03:00
Zion ea2970d6e5 Fix da build (#2900)
* Add RelWithDebInfo

* Fix the build
2017-06-22 21:05:32 +01:00
Jan Beich 392d91b604 Improve portability for BSDs (#2813)
* sys_net: don't use fds_bits from a system header on FreeBSD

rpcs3/Emu/Cell/Modules/sys_net.cpp:137:14: error: no member named '__fds_bits' in
      'sys_net::fd_set'; did you mean 'fds_bits'?
                                if (src->fds_bits[i] & (1 << bit))
                                         ^~~~~~~~
                                         fds_bits
/usr/include/sys/select.h:75:18: note: expanded from macro 'fds_bits'
#define fds_bits        __fds_bits
                        ^
rpcs3/Emu/Cell/Modules/sys_net.h:114:13: note: 'fds_bits' declared here
                be_t<u32> fds_bits[32];
                          ^

* GUI: fallback to xdg-open on other Unices

rpcs3/Gui/GameViewer.cpp:289:26: error: use of undeclared identifier 'command'
        wxExecute(fmt::FromUTF8(command));
                                ^

* File: FreeBSD never supported copyfile(3) but sendfile(2) works fine

Utilities/File.cpp:114:10: fatal error: 'copyfile.h' file not found
#include <copyfile.h>
         ^~~~~~~~~~~~

* Thread: add signal handling for BSDs

Utilities/Thread.cpp:761:23: error: use of undeclared identifier 'REG_RAX'
static const decltype(REG_RAX) reg_table[] =
                      ^
Utilities/Thread.cpp:763:2: error: use of undeclared identifier 'REG_RAX'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
        ^
Utilities/Thread.cpp:763:11: error: use of undeclared identifier 'REG_RCX'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                 ^
Utilities/Thread.cpp:763:20: error: use of undeclared identifier 'REG_RDX'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                          ^
Utilities/Thread.cpp:763:29: error: use of undeclared identifier 'REG_RBX'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                                   ^
Utilities/Thread.cpp:763:38: error: use of undeclared identifier 'REG_RSP'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                                            ^
Utilities/Thread.cpp:763:47: error: use of undeclared identifier 'REG_RBP'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                                                     ^
Utilities/Thread.cpp:763:56: error: use of undeclared identifier 'REG_RSI'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                                                              ^
Utilities/Thread.cpp:763:65: error: use of undeclared identifier 'REG_RDI'
        REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
                                                                       ^
Utilities/Thread.cpp:764:2: error: use of undeclared identifier 'REG_R8'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
        ^
Utilities/Thread.cpp:764:10: error: use of undeclared identifier 'REG_R9'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                ^
Utilities/Thread.cpp:764:18: error: use of undeclared identifier 'REG_R10'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                        ^
Utilities/Thread.cpp:764:27: error: use of undeclared identifier 'REG_R11'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                 ^
Utilities/Thread.cpp:764:36: error: use of undeclared identifier 'REG_R12'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                          ^
Utilities/Thread.cpp:764:45: error: use of undeclared identifier 'REG_R13'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                                   ^
Utilities/Thread.cpp:764:54: error: use of undeclared identifier 'REG_R14'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                                            ^
Utilities/Thread.cpp:764:63: error: use of undeclared identifier 'REG_R15'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                                                     ^
Utilities/Thread.cpp:764:72: error: use of undeclared identifier 'REG_RIP'
        REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP
                                                                              ^
Utilities/Thread.cpp:792:26: error: no member named 'gregs' in '__mcontext'
                const u64 reg_value = *X64REG(context, reg - X64R_RAX);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:804:21: error: no member named 'gregs' in '__mcontext'
                out_value = (u8)(*X64REG(context, reg - X64R_AL));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:809:21: error: no member named 'gregs' in '__mcontext'
                out_value = (u8)(*X64REG(context, reg - X64R_AH) >> 8);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:815:31: error: no member named 'gregs' in '__mcontext'
                const s8 imm_value = *(s8*)(RIP(context) + i_size - 1);
                                            ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:827:33: error: no member named 'gregs' in '__mcontext'
                const s16 imm_value = *(s16*)(RIP(context) + i_size - 2);
                                              ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:836:33: error: no member named 'gregs' in '__mcontext'
                const s32 imm_value = *(s32*)(RIP(context) + i_size - 4);
                                              ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:846:20: error: no member named 'gregs' in '__mcontext'
                out_value = (u32)RCX(context);
                                 ^~~~~~~~~~~~
Utilities/Thread.cpp:779:18: note: expanded from macro 'RCX'
#define RCX(c) (*X64REG((c), 1))
                 ^~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:851:19: error: no member named 'gregs' in '__mcontext'
                const u32 _cf = EFLAGS(context) & 0x1;
                                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:851:19: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:852:19: error: no member named 'gregs' in '__mcontext'
                const u32 _zf = EFLAGS(context) & 0x40;
                                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:852:19: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:853:19: error: no member named 'gregs' in '__mcontext'
                const u32 _sf = EFLAGS(context) & 0x80;
                                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:853:19: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:854:19: error: no member named 'gregs' in '__mcontext'
                const u32 _of = EFLAGS(context) & 0x800;
                                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:854:19: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:855:19: error: no member named 'gregs' in '__mcontext'
                const u32 _pf = EFLAGS(context) & 0x4;
                                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:855:19: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:885:12: error: no member named 'gregs' in '__mcontext'
                case 1: *X64REG(context, reg - X64R_RAX) = value & 0xff | *X64REG(context, re...
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:885:62: error: no member named 'gregs' in '__mcontext'
  ...*X64REG(context, reg - X64R_RAX) = value & 0xff | *X64REG(context, reg - X64R_RAX) & 0xffffff...
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:886:12: error: no member named 'gregs' in '__mcontext'
                case 2: *X64REG(context, reg - X64R_RAX) = value & 0xffff | *X64REG(context, ...
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:886:64: error: no member named 'gregs' in '__mcontext'
  ...reg - X64R_RAX) = value & 0xffff | *X64REG(context, reg - X64R_RAX) & 0xffff0000; return true;
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:887:12: error: no member named 'gregs' in '__mcontext'
                case 4: *X64REG(context, reg - X64R_RAX) = value & 0xffffffff; return true;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:888:12: error: no member named 'gregs' in '__mcontext'
                case 8: *X64REG(context, reg - X64R_RAX) = value; return true;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:913:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x1; // set CF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:913:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:917:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x1; // clear CF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:917:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:922:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x40; // set ZF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:922:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:926:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x40; // clear ZF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:926:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:931:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x80; // set SF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:931:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:935:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x80; // clear SF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:935:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:940:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x800; // set OF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:940:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:944:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x800; // clear OF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:944:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:953:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x4; // set PF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:953:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:957:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x4; // clear PF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:957:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:962:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) |= 0x10; // set AF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:962:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:966:3: error: no member named 'gregs' in '__mcontext'
                EFLAGS(context) &= ~0x10; // clear AF
                ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:966:3: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:976:7: error: no member named 'gregs' in '__mcontext'
                if (EFLAGS(context) & 0x400 /* direction flag */)
                    ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                         ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:976:7: error: use of undeclared identifier 'REG_EFL'
Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS'
#define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL])
                                                      ^
Utilities/Thread.cpp:1020:25: error: no member named 'gregs' in '__mcontext'
        auto code = (const u8*)RIP(context);
                               ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:1146:3: error: no member named 'gregs' in '__mcontext'
                RIP(context) += i_size;
                ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:1368:47: error: no member named 'gregs' in '__mcontext'
        const bool is_writing = context->uc_mcontext.gregs[REG_ERR] & 0x2;
                                ~~~~~~~~~~~~~~~~~~~~ ^
Utilities/Thread.cpp:1368:53: error: use of undeclared identifier 'REG_ERR'
        const bool is_writing = context->uc_mcontext.gregs[REG_ERR] & 0x2;
                                                           ^
Utilities/Thread.cpp:1393:89: error: no member named 'gregs' in '__mcontext'
  ...%s location %p at %p.", cause, info->si_addr, RIP(context)));
                                                   ^~~~~~~~~~~~
Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP'
#define RIP(c) (*X64REG((c), 16))
                 ^~~~~~~~~~~~~~~
Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG'
#define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]])
                               ~~~~~~~~~~~~~~~~~~~~~~ ^

* Thread: add explict casts for incomplete pthread_t on some platforms

Utilities/Thread.cpp:1467:17: error: no viable overloaded '='
        ctrl->m_thread = thread;
        ~~~~~~~~~~~~~~ ^ ~~~~~~
Utilities/Atomic.h:776:12: note: candidate function not viable: cannot convert argument of
      incomplete type 'pthread_t' (aka 'pthread *') to 'const atomic_t<unsigned long>' for 1st
      argument
        atomic_t& operator =(const atomic_t&) = delete;
                  ^
Utilities/Atomic.h:902:7: note: candidate function not viable: cannot convert argument of
      incomplete type 'pthread_t' (aka 'pthread *') to 'const type' (aka 'const unsigned long') for
      1st argument
        type operator =(const type& rhs)
             ^
Utilities/Thread.cpp:1656:3: error: no matching function for call to 'pthread_detach'
                pthread_detach(m_thread.raw());
                ^~~~~~~~~~~~~~
/usr/include/pthread.h:218:6: note: candidate function not viable: no known conversion from 'type'
      (aka 'unsigned long') to 'pthread_t' (aka 'pthread *') for 1st argument
int             pthread_detach(pthread_t);
                ^

* build: dlopen() maybe in libc

/usr/bin/ld: cannot find -ldl
c++: error: linker command failed with exit code 1 (use -v to see invocation)

* build: iconv() maybe available on some BSDs in libc

/usr/bin/ld: cannot find -liconv
c++: error: linker command failed with exit code 1 (use -v to see invocation)

* build: hidapi-hidraw is only built on Linux

/usr/bin/ld: cannot find -lhidapi-hidraw
c++: error: linker command failed with exit code 1 (use -v to see invocation)

* Thread: use getrusage() on more POSIX-like systems

* Qt: don't return NULL handle on other platforms

rpcs3/rpcs3qt/gs_frame.cpp:120:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

* build: properly disable Vulkan on other platforms

In file included from rpcs3/rpcs3_app.cpp:40:
In file included from rpcs3/Emu/RSX/VK/VKGSRender.h:3:
rpcs3/Emu/RSX/VK/VKHelpers.h:1209:42: error: unknown type name 'device_queues'
                        std::vector<VkBool32> supportsPresent(device_queues);
                                                              ^
rpcs3/Emu/RSX/VK/VKHelpers.h:1211:4: error: expected member name or ';' after declaration specifiers
                        for (u32 index = 0; index < device_queues; index++)
                        ^
rpcs3/Emu/RSX/VK/VKHelpers.h:1221:4: error: expected member name or ';' after declaration specifiers
                        for (u32 i = 0; i < device_queues; i++)
                        ^
rpcs3/Emu/RSX/VK/VKHelpers.h:1256:4: error: expected member name or ';' after declaration specifiers
                        if (graphicsQueueNodeIndex != presentQueueNodeIndex)
                        ^
rpcs3/Emu/RSX/VK/VKHelpers.h:1261:4: error: expected member name or ';' after declaration specifiers
                        CHECK_RESULT(vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surface, &formatCount, nullptr));
                        ^
[...]
/usr/bin/ld: cannot find -lvulkan
c++: error: linker command failed with exit code 1 (use -v to see invocation)

* build: make install/strip work by moving commands

* Qt: create surface for GL context if it wasn't ready

  #0  strlen (str=0x0) at /usr/src/lib/libc/string/strlen.c:100
  #1  0x000000000090f02e in std::__1::char_traits<char>::length (__s=0x0)
      at /usr/include/c++/v1/__string:215
  #2  std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string (__s=0x0, this=<optimized out>) at /usr/include/c++/v1/string:1547
  #3  gl::capabilities::initialize (this=0x2ba32a0 <gl::g_driver_caps>)
      at rpcs3/Emu/RSX/GL/GLHelpers.h:133
  #4  0x000000000090d3dd in gl::get_driver_caps () at rpcs3/Emu/RSX/GL/GLHelpers.cpp:56
  #5  0x00000000008fa511 in GLGSRender::on_init_thread (this=0x838d30018)
      at rpcs3/Emu/RSX/GL/GLGSRender.cpp:484
  #6  0x0000000000938f9e in rsx::thread::on_task (this=0x838d30018)
      at rpcs3/Emu/RSX/RSXThread.cpp:334
  #7  0x0000000000abc329 in task_stack::task_type<named_thread::start_thread(std::__1::shared_ptr<void> const&)::$_10>::invoke() ()
  #8  0x0000000000abc114 in thread_ctrl::start(std::__1::shared_ptr<thread_ctrl> const&, task_stack)::$_7::__invoke(void*) ()
  #9  0x0000000801e60c35 in thread_start (curthread=0x843650a00)
      at /usr/src/lib/libthr/thread/thr_create.c:289
  #10 0x0000000000000000 in ?? ()

* build: don't abort without git metadata

-- Found Git: /usr/local/bin/git (found version "2.13.1")
fatal: Not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Warning at git-version.cmake:12 (message):
  git rev-list failed, unable to include version.

* build: non-parallel needs git-version.h earlier

rpcs3/rpcs3_version.cpp:3:10: fatal error: 'git-version.h' file not found
 #include "git-version.h"
          ^~~~~~~~~~~~~~~
1 error generated.
2017-06-22 21:03:41 +03:00
clienthax ac12fc8b44 HLE cellHttpUtilParseUri, Also initalise networking with windows. (#2879)
TODO: rewrite with <regex>
2017-06-22 20:27:12 +03:00
scribam fe67d51e5e Stub cellMsgDialogOpenSimulViewWarning 2017-06-22 20:08:21 +03:00
scribam 4d294e7a69 Stub sys_rsxaudio_ functions 2017-06-22 20:08:21 +03:00
scribam 45dc7fbac8 Stub some cellHttpAuth* functions 2017-06-22 20:08:21 +03:00
Jake 72590e2c93 cellGem: Fix headers 2017-06-21 19:28:05 +03:00
Jake d3df83a3ea Sprx: loading / reloc fixes 2017-06-21 19:28:05 +03:00
Jake 03268b0838 Trophy: return size for GetRequiredDiskSpace again 2017-06-21 19:28:05 +03:00
Jake f77e9f8bc1 kb/mouse: fix max in init 2017-06-21 19:28:05 +03:00
Nekotekina 9cc52c75e3 Fix hex_to_bytes 2017-06-18 23:47:37 +03:00
Ryan Gonzalez 907c800e87 Fix message shown when Qt 5 is missing (#2884) 2017-06-18 19:05:02 +01:00
Robbie 8c9b816c3d EmuGameDir --> EmuConfigDir.
Give QListWidget a parent to remove a slight memory leak.
2017-06-18 18:09:41 +01:00
Robbie 40d1882db9 Fix refresh by having the save occur on accept instead of during the destructor. 2017-06-18 18:09:41 +01:00
Zangetsu38 152ab8c13d Rename project rpcs3qt in rpcs3. 2017-06-18 00:30:51 +03:00
Zangetsu38 4c8cc7d5c2 Fix icon and exe name for VS.
Rename old rpcs3 project.
Restored original name for rpcs3_.rc to rpcs3.rc.
Delete old wxWidgets/setup.h & FindwxWidgets.cmake.
2017-06-18 00:30:51 +03:00
Ani fe8f6fb48a GUI: List SPRX modules only
Excludes .prx modules from being listed, which prevents user from
downloading random folders from the web that only have .prx modules and
break auto load.
2017-06-17 22:42:23 +03:00
Megamouse 31cedb6192 Reimplement debugger resize & disassembly (#2876)
* Reimplement debugger resize
fix interrupt

* add splitter to disassembly
fix debugger regression of last commit
fix gotoaddr pos

* travis sth sth

* add drag & drop to cg_disasm

* check for invalid address on set breakpoint
reenable debugger controls on Emu.IsReady()

* check for valid address more thoroughly
2017-06-16 21:35:58 +03:00
Megamouse aca5c73fb3 Fix inconsistent selection in gamelist/grid (#2871)
* use userrole instead of missingno

* fix consistent gamelist selection

* fix consistent gamegrid selection

* scroll to selection on refresh

* fix adapters not saved to config
2017-06-16 20:43:22 +03:00
Robbie f84f4ccd38 Include a VFS manipulation dialog (#2863)
* VFS Dialog
* Couple convenience changes. Refresh after dialog in case dev_hdd0 changes.  And, have add directory set which directory you're currently using as well.
2017-06-15 13:22:06 +03:00
Zion Nimchuk d6e4566418 Fix annoying cmake output. 2017-06-14 18:45:14 +01:00
Zion Nimchuk 8872421785 Add automated qt5 tech support in CMake 2017-06-14 18:45:14 +01:00
Zion Nimchuk 3f74bafa70 Disable LLVM option in PPU when RPCS3 is not built with it 2017-06-14 18:45:14 +01:00
Zion Nimchuk e1a78abfc9 Misc organizing and bug fixing 2017-06-14 18:45:14 +01:00
Jake 23d1ddbb8e Dx12/Vulk: Fix KernelBase.dll crash (#2870) 2017-06-13 11:36:42 +03:00
Megamouse 25823a1f66 Update Icons provided by Discord user rutantan (#2862)
* update Icons + remove rightclick on toolbar
* use better data icons
* use better disc icons
* Use better unknown icons
* final adjustment (hdd icons)
2017-06-12 20:23:12 +01:00
Zion Nimchuk 0c4cc34488 Implement strncasecmp and strrchr 2017-06-12 20:25:03 +03:00
Robbie 5c7a4b1405 Add ability to boot elves in command line. (#2859) 2017-06-12 16:47:26 +01:00
Megamouse a3d1f7b7b0 Grid Mode + Tool Bar (#2857)
* Grid layout

* Add Tiny Mode
fix scrolling
fix maxGamesPerRow calculation

* prime empty toolbar

* Add Search Bar, Icon Size and List Mode to ToolBar
Fix some minor glitches

* fix toolbar save and adjust default margin

* fix toolbar regression
minor simplification in Refresh

* Implement search and rename PopulateUI to PopulateGameList

* minor refactoring hehehehehehe

* Fix crash

* refresh speedboost optimizations

* Small refactoring of refresh to have default argument of false.

* add icons to toolbar

* fix scrambed order

* search for serial as well
2017-06-11 15:07:00 +01:00
kd-11 9aa632bcc1 rsx/vk: Fixes for ring buffer allocation and image clipping (#2850) 2017-06-10 23:32:17 +03:00
RipleyTom 0dd10d1457 Command line elf path fix (#2844) 2017-06-10 22:50:10 +03:00
Ani 5dd5323ad0 Revert "Grid Game Layout (#2854)" (#2856)
This reverts commit 3537671cb7.
2017-06-10 16:05:13 +01:00
Robbie 3537671cb7 Grid Game Layout (#2854)
* Grid layout

* Add Tiny Mode
fix scrolling
fix maxGamesPerRow calculation

* prime empty toolbar

* Add Search Bar, Icon Size and List Mode to ToolBar
Fix some minor glitches

* fix toolbar save and adjust default margin
2017-06-10 22:41:14 +08:00
flash-fire 511ff9d12c Fix visual studio build since vulkan changed debug library names in update. 2017-06-10 15:59:22 +03:00
Megamouse d2518caf2e GUI: Hotfix for Boot Recent (#2847)
* fix recent list
check for empty name
only change list enabled at aboutToShow
only AddRecentGame if Boot succeeded

* use stringpairlist instead of two stringlists
fix weird typo line

* fix travis
2017-06-08 19:59:07 +01:00
Areiser e5e95a31f1 Add qt5-base dependency for arch linux (#2841)
Add Qt5 dependency for arch linux and debian/ubuntu
2017-06-08 18:01:30 +01:00
kd-11 fab6951789 Fix dpi awareness error; Enable program debug information on msvc 2017-06-08 19:08:44 +03:00
kd-11 12da498001 vk: API bug fixes - Improve spec conformity
explicitly request anisotropic filtering and BC compression

clean up a leaking framebuffer handle reference when using debug overlay

Wait for device instead of queue to ensure no conflict during renderer shutdown

Clip scissor regions when doing surface clears
2017-06-08 19:08:44 +03:00
kd-11 444c64ae75 update vulkan and glslang submodules
update vulkan.7z
2017-06-08 19:08:44 +03:00
kd-11 2556484c67 fixes to project files and build scripts
cleanup
2017-06-08 19:08:44 +03:00
kd-11 860b76452f vulkan bringup on linux
cleanup: drop unused stuff
2017-06-08 19:08:44 +03:00
Megamouse 6cb7a17814 GUI: Add recent games menu (#2843)
* add recent games menu

* remove invalid paths from list

* push InvalidRecentAction into BootRecentAction

* disable actions on boot
disable clear recent on freeze recent

* fix gamelist games not booting on recent list

* minor fix for list disable error
2017-06-08 13:52:18 +01:00
Megamouse 0f433ea882 use global config as default for game config again (#2845)
this was missing as a result to the previous fix of the game configs
2017-06-07 20:12:19 +01:00
Megamouse affda37d04 fix dpi scaling (for all ?) 2017-06-07 00:01:45 +01:00
Megamouse bda945218d add dpi scaling for windows
fix welcome screen for all platforms (looks slightly different)
2017-06-07 00:01:45 +01:00
Megamouse 01ea3def54 maybe fix about dialog encoding 2017-06-07 00:01:45 +01:00
Megamouse 6ab69012e3 fix game config saving to global if empty 2017-06-07 00:01:45 +01:00
Megamouse 35c80ab9fc fix about dialog icon 2017-06-07 00:01:45 +01:00
Megamouse 8183449fb1 fix shortcuts 2017-06-07 00:01:45 +01:00
Talkashie 761b74ec59 Update game_list_frame.cpp (#2835)
Fix two typos and make message less vague
2017-06-05 18:16:05 +01:00
Ani 1c91dac211 Fix travis (#2832) 2017-06-04 20:52:57 +01:00
Ani 3d284d3c8b Update TravisCI to build+upload AppImage for Linux (#2830)
* Update TravisCI to build+upload AppImage for Linux

Solves #2744 by @probonopd
2017-06-04 19:42:06 +01:00
Ani 11f5f29c87 Update Readme (#2829) 2017-06-04 16:44:48 +01:00
Robbie 6cfb184b1e RPCS3 QT (#2645)
* Fix windows build.  I made sure to do everything with a win32 prefix to not effect linux build.

* Make the window resizable instead of fixed in the corner.

* Ignore moc files and things in the debug/release folder.  I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file.  But, this helps clean out clutter for now.

* Add cmake.  This doesn't interact with the rest of rpcs3 nor the main cmake file.  That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt.

* The build works. I'd like to thank my friends, Google and Stackoverflow.

Setted up by importing rpcs3Qt project using Qt's visual studio plugin.

* Cleanup.  Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files.

* Update readme to reflect getting Qt.

* Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild.

* Add rpcs3_version, few GUI tweaks

* Set defaultSize to 70% of screen size

* Add the view menu (#3)

* Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets.

* Make log visible by default

* Improve UI by making it into a checkbox that's easier to use.

* fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users)

* updated readme for qt

* update appveyor for qt
- cleaned formatting for the post build command

* fix build (#6)

* fix build legit this time i promise

* [Ready] Gamepadsettings (#4)

* WIP Gamepadsettings
pushbutton Eventhandling missing

* GamepadSettings should work except for cfg Init
Some KeyInputs are missing

* Update padsettingsdialog.h

* Update padsettingsdialog.cpp (#5)

* Update padsettingsdialog.cpp

removed silly tabs

* Update padsettingsdialog.cpp

* GetKeyCode simplified

* rename pad settings to keyboard settings o.O

* rename keyboard setting to input settings

* Remvoed the QT_UI defines.

* Readded new line at end of file. Replaced define in padsettings with constant.

* GUI fixes (Settings)

* Stub the logger UI. Nothing special besides a simple stub.

* Unstub the log. I haven't tested TTY but it should work.

Only thing to do, but this is in general, is add persistent settings.

* Minor refactoring to simplify code.

* Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images.

* Made game lists much more functional than it was.

* mainwindow

* gamelist

* Please forgive me for I have lambdaed.

Added the ability to toggle showing columns via a context menu.

* Fix GameList further

* sort by name on init fixed

* Created the baseline refactoring. I'm going to start working on the callbacks now.  May need to implement other classes in the process. Fun stuff, I know.

* adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation
adds RefreshGameList
obliterates 10sec Refresh

* messages

* Rpcs3 gs frame (#16)

* Messing with project settings try to get trails of cold steel to boot.bluh

Definitely one change is needed in linker settings for RPCS3 to not crash immediately.

Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf.

* remove random ! not that it matters much right now

* minor additions

* "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it.  However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call)

Crashes due to needing pad callback to be done.

* With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol)

* Fix release mode.  Fix the Qt debug assert by using ancient occault rituals.  I want to be able to remove the blocking connects but it won't work right now without it.  It isn't perfect but it's good enough for now IMO.

* Add enters to the end of files.

* Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event.  Works, though, it's admittedly probably not optimal by ANY means.

* Fix comment.

* Fix libpng wit zlib.

* Move Qt GUI into RPCS3Qt. (#17)

Restore wx GUI.

* fix install-progressdialogs randomly not showing

* install-progressdialog cosmetics

* add stylesheet file loading

* apply request

* Add stylesheet to git ignore.

* XInput..

* Joystick...

* Rpcs3 qt small fixes (#20)

* Small fixes.  Have emulator stop when x button is pressed on game window.  Have emulator/application stop when the main window is closed.

* If I forget another new line ending for a file.............................................

* Add CgDisasm (#21)

* fix install-progressdialogs randomly not showing

* install-progressdialog cosmetics

* add stylesheet file loading

* apply request

* add CgDisasm
add code to disable contextmenu options
fix gamelist issue

* missing proj changes

* Add ability to open stylesheets from menu.

* Mega searcher (#23)

* add MemoryStringSearcher
set minimum Sizes for mainwindow and CgDisasm

* minor fixes

* Since the system.cpp callbacks for emulator state were unused, I removed them.  Then, I replaced them with callbacks for the Gui.

* added stylesheet options
setfocus on settings fixed
newline added

* added signals and slots for EmuRun and EmuStop

* update ui

update ui now works
added callback onReady
added EnableMenues
added ps3 commands

* added restart logic to menu

* newline

* event header removed

* Added graphic settings class. (#26)

* Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful.  Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets.  But, that'll come in time as I update this class.

* Add view debugger, logger, gamelist to settings and synchronize them.

* Separate initializing actions from connects

* Add invisible fullscreen cursor and double click event.

* Add the UI log settings.

* Add MemoryViewer (#30)

* Add Memoryviewer
Image Button crashes/not fully implemented
focus on some button annoying

minor changes for question dialogs

* GuiSettings Refactoring (#31)

* Add settings for columns shown and which one is saved

* I accidentally refactored the settings class.  Added ability to reset to default GUI.  Added statefulness to column widths.

* add gui tab

* Fix logging at startup.

* Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase.

* Removed dock widget controls.

* Added style sheets. Removed the option from the menu.

* Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right?

* It's remarkable how tricky this is.

* Added convenience button to open up the settings folder in explorer

* Add newlines at end of file

* simplified logic. Fixed a bug.. hopefully not more bugs

* Fix the undocumented feature

* Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol

* Make warning messagebox instead of changing the title of the dialog.

* marking...

* Hcorion suggested changes.

* [WIP] autopause (#32)

* autopause added
needs fixing
headers do not show text

* fix compile stuff

* Add MsgDialog + edge widgets (#33)

* Add MsgDialog
needs magic

* add "Debugger" Buttons to menubar

* Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller.  But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation.

* [Ready] Add KernelExplorer (#36)

* KernelExplorer added

* Fix build.  Connect mainwindow to show explorer.

* qstr formatting added
hid header, fixed button size

* Taskbar Progress for install PUP/PKG (#37)

* Add Taskbar Progress for both PKG and PUP installer

* fix missing ifdefs for windows

* add mainwindow icon + thumbnail toolbar

* add game specific icons to the GSFrame

* fix icon crash

* fix appIcon's aspect ratio in SetAppIconFromPath

* Fix black borders in RGB32 icons

* rename thumbar related buttons

* EmuSettings (#35)

* Core tab done minus doing the library list.

* Graphics tab.

* Audio tab

* Input tab

* Added the other tabs

* LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega)

* add search and add other libraries that aren't checked.

* Finish adding lle selecting things.

* marking my territory (#38)

fixed settingsdialog glitch and width
added groupbox to gui buttons
removed parents from layouts

* add debuggerframe + RSXDebugger (#34)

* Add Debuggerframe

* add RSXDebugger

* add RSXDebugger fo real

* RSXDebugger improved
minor adjustments

* add utf8 conversions like neko told me to
hopefully i did not utf8-ise too many things xD

* fix some variables

* maybe fix image buffers in RSXDebugger

* fixed image view (pretty sure)

* fixed image buffer (hopefully)

*  QT Opengl frame (#41)

* fix RSX Debugger headers (#40)

* fix some debugger layout issues
fix RSX Debugger headers + some comments

* add kd-11's SPU options
fix D3D12 showing on non-compatible systems
tidy up coretab

* improve D3D12 behaviour in graphicstab:
adapter selection and D3D12 render won't show on non-compatible systems
add monospace font to cgDisasm

* enable update only on visibility

* Rpcs3 qt llvm build (#42)

* LLVM pushed so mega can test

* probably is what is needed with Release LLVM

* should probably have RPCS3-Qt be using release-llvm

* include zlib the same way.

* don't talk to me about how I made this happen.

* I applied the magical treatment to debug mode too.  Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant

* hack

* progress bar for LLVM spawns but doesn't close yet.

* fix msgDialog (#43)

fix oskDialog

* Minor bug fixzz

* fix osk and msgdialog for real (#44)

* fix msgDialog
fix oskDialog

* fix OskDialog part 2
fix MsgDialog part 2

* This bug is evil, and it should be ashamed of itself.

* Refactor YAML.  Commented out gui options that aren't added to config yet (add em back later when we merge that in)

* Fix pad stuff.

* add SaveDataUtility (#45)

* add SaveDataUtility

* fix slots

* fix slots again
fix lists not showing stuff
fix dialogs not showing
add colClicked
refactor stuff and polish some layouts

* add SaveDataDialog.h and SaveDataDialog.cpp

* tidy up mainwindow

* add callback

* fix RegisterEditor (#47)

* fix RegisterEditor

* fix other dialogs' immortality (gasp...vampires)

* remove debug leftovers

* fix InstructionEditor (#46)

* fix InstructionEditor

* fix typo

* Fix MouseClickEvents in RSXDebugger (#50)

* Fix MouseClickEvents in RSXDebugger
Fix focus on MemoryViewer and RSXDebugger
Adjust PadButtonWidth

* fix another comment

* fix debuggerframe events (#49)

* Fix pad settings bro (#48)

* Fix pad settings bro

* fix comment

* Icons and Menu-Additions (#39)

* Add Icons and iconlogic to cornerWidget and actions

* add cornerWidget toggle
fix dockwidget action state on start
remove DoSettings

* fix game removal bug
remove tableitem focus rectangle
therefore add TableItemDelegate.h

* remove grid and focus rectangle from autopausedialog

* add fullscreen checkbox to misctab
minor padsettings layout improvements

* Add show category submenu to view menu
Add gamelist filter accordingly
fix minor bug where play icon was displayed despite pause label
add boolean b_fullscreen to mainwindow for later use in GSFrame

* fix headers in autopausesettings
fix remove bug in autopausesettings
add delete keypressevent in autopausesettings
fix missing tr() and minor refactoring in gamelist

* add default Icons for play/pause/stop/restart

* Fix fullscreen start.  Some stuff was wrong with settings, just trust me.

* remove fullscreen leftovers and fix merge

* SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build)

* please neko's lambda fetishes (#53)

* please neko's lambda fetish in mainwindow

* please neko's lambda fetish in gamelistframe

* please neko's lambda fetish in logframe

* fix neko's lambda fetish in debuggerframe

* pleasefixdofetishsomething in Autopausesettingsdialog

* fix sth sth lambda in cg disasm

* lambda stuff in instructioneditor

* lambda kernelexplorer

* lambda-ise memoryviewer

* lambda rsxdebugger

* lambda savedatautil
this could be done even more, but the functions are not implemented

* Rpcs3 qt fixes -- shadow taskbar bug (#52)

* SShadow's bug of taskbar progress staying fixed on cancelling pkg install.

* other taskbar

* i'm still a baka

* Fix a warning

* qtQt refactoring (#54)

* fix neko's snake fetish

* File names should match headers. Are these the names I want?  Not necessarily.  But, this is much less confusing.

* i thought I committed everything with stage all.........................

* remove unused utilities

* The most important commit of them all.

* Disable legacy opengl buffers when not using opengl.

* fix code review comment

* Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab

* Merge lovely things from master (#55)

* Configuration simplified

* untrivial parts of the merge

* no need for these options anymore

* Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever)

* here ya go

* FIx hitting okay in settings causing graphics to messup (#57)

* fixes + msgdialog taskbarprogress (#56)

* fix ok button in taskbar
add taskicon progressbar for msgdialog
add tablewidgetitem to rsxdebugger
fix comments in save_data_utility.cpp

* fix d3d adapter default

* fix taskicon progressbar not being destroyed properly

* add last_path to filedialogs

* fix msgdialog crash on ok (#58)

* fix thread stopping in debbugerFrame (#59)

* Move Emu.init to be first.  This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60)

* Fix full screen opening on double RIGHT click.

* fix other instances of double click ...

* Fix locaiton of gui config. (#61)

* fix d3d bug (#62)

* fix d3d bug

* small utf8 addition

* Fix cmake for qt (#64)

* Initial CMake fix

* Fix compilation with GCC

* Get rid of awful hack

* Update cotire with qt support

* Maybe fix travis

* Emergency Hack Relief Program Activated

* Fix travis build (#65)

* make about dialog great again (#67)

and add previous additions

* Fix library sort / smart gamelist context menu (#63)

* fix library sort

* add Title to custom game config dialog

* disable options on gamelist context menu

* use namespace for category Strings

* introduce sstr

* fix some tr nonsense

* Rpcs3qt Appveyor (#68)

Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* possible fix for gamelist icons (#69)

add warning for appicon

* Fix clang build (#66)

Hcorion, the build savior.

* Rpcs3 qt resources (#70)

* Resource files attempt 1

* Autorcc should probably be on?

* forgot the most important file lol

* Forgot an instance of the icon in the code...

* Patch fix for clang build.

* vulkan/d3d12 combobox merge (#71)

* add vulkan adapterbox and merge with d3d12 box

* fix adapter text on other renderer

* gather render strings

* attempt fix on gamelist row height

* adjust adapter behaviour to new guideline

* Compiler of Peace.

* High critical hit rate.

* Mugi eating strawberries is savage.

* Apply KD-11 Hotfix (#73)

* Most of Ani Adjusts (#72)

* Most of the adjustments are made here.

* fix gamelist rowheight

* fix msg dialog layout and disable_cancel

* cleanup

* fix disable cancle again

* fix debuggerframe buttons and doubleclick

* Add a fun little bonus feature :) (#74)

* category filters simplyfied (#75)

* Cleaning up cmake a bit.

* fixezzzzzz (#76)

* upgrade Info Boxes

* upgrade file explorer

* refactor GetSettings and SetSettings

* second refactoring

* cleanup

* travis is a grammar nazi

* second travis shenanigans

* third travis weirdo thingy

* travis 4 mega fun

* travis 5 default to def

* finish refactoring for settings
fix gamelist headers

* hotfix msgdialog and infobox (#77)

* msgdialog fix 1

* fix zombie infobox

* Rpcs3 Qt Welcome Page (#78)

* Add a welcome dialog.

* Add enter to end of file

* i'm an idiot

* last mistake i hope

* sponsored via --> funded by

* RPCS3 does not condone piracy.

* Mega Adjusts

* Ani Adjustments and a few refactorings

* Yay

* Add Gamelist Icon Sizes (#79)

* Reverting Mega's suggestion.  If people can use alt-f4 to get around this dialog, they can probably use an emulator too.

* Fix firmware file choice dialog in QT GUI (#80)

* ani adjusts 2 + minor icon size simplifications (#81)

FPS Additions

* Update Travis to Qt 5.9 (#82)
2017-06-04 17:48:33 +03:00
Jake 195f24507b cellPad: Clear info structs before setting 2017-06-02 19:40:22 +03:00
Jake 56b21fd411 cellPadPeriphGetData impl 2017-06-02 19:40:22 +03:00
kd-11 d5df4a4616 rsx/fp/gl: Minor fixes (#2823)
* rsx/fp: expand glsl unpack instructions to vec4

* rsx/fp: Ignore BRK outside LOOP/REP

* fix string compare typo
2017-06-01 15:53:25 +03:00
kd-11 e6d55a6692 ui/vk: Reimplement vulkan GS selection; minor fixes for broken contexts on unsupported devices 2017-05-26 18:26:10 +03:00
John-Gee 63cadab042 Need to link to libatomic for objects with sizes that aren't supported natively by the CPU 2017-05-26 13:11:41 +03:00
xperia64 05b9575981 Add option to select Vulkan device (#2814) 2017-05-25 18:46:28 +03:00
kd-11 e82163bfb9 cmake: Link libllvm-4.0.so dynamically to avoid conflict with system libs (#2811)
* cmake: Link libllvm dynamically to avoid conflict with other system libs
2017-05-24 18:33:16 +03:00
Trevor a5874d76d1 Add caching for dependencies in appveyor.yml (#2804)
* Add caching for dependencies in appveyor.yml

* Add cache clearing support for Appveyor

Clears the cached files if appveyor.yml changes
2017-05-23 17:18:49 +03:00
Zion Nimchuk 83ffd7c9fb Add installation for linux 2017-05-22 20:53:59 +03:00
Zion Nimchuk 7f2e87580f Update .xpm based on new .ico 2017-05-22 20:53:59 +03:00
kd-11 18df292f90 rsx/fp: Better handling of flow control ops 2017-05-22 14:28:33 +03:00
kd-11 ccb23d70a5 vk: Improve flush queue sync between cell threads 2017-05-22 14:28:33 +03:00
kd-11 786bcb0d1b rsx: bugfix - avoid a divide by zero 2017-05-22 14:28:33 +03:00
kd-11 0efc3c1c6c rsx: Relax restriction on vertex register data fetch 2017-05-22 14:28:33 +03:00
kd-11 d4ddc40988 rsx: Add support for repeated data streams (broken attrib divisor?) 2017-05-22 14:28:33 +03:00
kd-11 e8b4d332eb rsx: Use faster upload path when conditions allow
Fix aligned memory access (SSE)

rsx: BufferUtils; always use optimized paths
2017-05-22 14:28:33 +03:00
Jake 674acd8431 ds4: use controller calibration values for accel/gyro 2017-05-21 18:07:43 +03:00
Jake 80fc471067 Ignore LLE savedata modules 2017-05-21 18:07:43 +03:00
Jake 4bcafb3e75 Fix C00 SPRX loading 2017-05-21 18:07:43 +03:00
Jake 7ccc5d3910 Set TrophyRequiredSize to 0 2017-05-21 18:07:43 +03:00
Nekotekina 1c2a423b14 Config fix 2017-05-20 19:26:22 +03:00
Nekotekina f010b5b235 Configuration simplified 2017-05-20 16:01:48 +03:00
Nekotekina d5107aab47 cfmt improved 2017-05-19 01:13:23 +03:00
Nekotekina bd8dfac713 ALSA: decrease buffer 2017-05-19 01:13:23 +03:00
Nekotekina b613fb70f1 Fix MFC_WrTagUpdate 2017-05-19 01:13:23 +03:00
Zangetsu38 43b06c2a9c Fix compilation asmjit for VS. (#2791) 2017-05-18 19:31:39 +03:00
Zion c133db6721 Update asmjit submodule (Testers wanted!) (#2782)
* Update asmjit submodule

* Add myself as a contributor 	😉
2017-05-18 14:22:45 +03:00
raven02 f54628fcfd Stub cellGcmSetWaitFlipUnsafe() (#2786) 2017-05-16 07:33:37 +08:00
Nekotekina 7ac64a6725 CELL_OK cleanup 2017-05-15 14:58:32 +03:00
Nekotekina 45908b9dd8 fs::statfs fixed 2017-05-15 14:37:05 +03:00
Nekotekina 81c8d3f27a Added CELL_CANCEL 2017-05-15 14:37:05 +03:00
Nekotekina 3a1f1dbc1a Minor StrFmt fix
Added fmt_unveil<f16>
Added enum helper (experimental)
2017-05-15 14:37:05 +03:00
Nekotekina 88fef183a3 config.yml: Log section optimized 2017-05-15 14:37:05 +03:00
scribam 299f627321 Stub cell (#2785)
* Update cellGcmSys

* Update cellStorage

* Update cellSubdisplay

* Update sceNpTrophy
- Use error_code as return type
- Add few checks

* Update cellKey2char

* Update cellKb:
- Use error_code as return type
- Replace UNIMPLEMENTED_FUNC by .todo

* Update cellNetCtl

* Update cellSpudll

* Update cellSysutilAp

* Update cellUserInfo

* Stub sys_mempool_allocate_block (bad idea)
2017-05-15 14:30:14 +03:00
kd-11 c26607de08 gl: Strict export of diff_color and spec_color for mesa compatibility (#2779)
* gl: Strict export of diff_color and spec_color for mesa compatibility

* gl: Relax the front_diff/spec rules a little
2017-05-14 11:50:24 +03:00
shameful e93c4c42b6 fix for shader fog mode exponential2_abs (#2781)
* Update VKFragmentProgram.cpp

added missing exponent parameter

* fixed misplaced exponent in VKFragmentProgram.cpp

parameter that belonged to pow() was being passed to exp() instead, causing the shader compilation to fail

* fix for opengl fog_mode exponential2

same fix as the vulkan version

* directx fog_mode exponential2 fix

misplaced parameter

* directx fog_mode exponential2_abs fix

* vulkan fog_mode exponential2_abs fix

* opengl fog_mode exponential2 fix
2017-05-14 12:56:24 +08:00
kd-11 d24ba0da90 gl: Workaround to detect opengl driver caps for intel 2017-05-12 20:10:03 +03:00
kd-11 7460bdfb1b gl: Use strict vertex output declaration for better compatibility with mesa 2017-05-12 20:10:03 +03:00
kd-11 c5975d5f66 rsx: Vertex program output fixes 2017-05-12 20:10:03 +03:00
Nekotekina 07f0c7b4a5 Update yaml-cpp 2017-05-11 19:19:10 +03:00
Nekotekina 8df95dbe39 Stub sys_fs syscalls 2017-05-11 19:05:41 +03:00
Nekotekina 75017345be cellFsGetPath implemented 2017-05-11 19:05:41 +03:00
Nekotekina 08c955d177 Remove AutoPause.cpp 2017-05-11 19:05:41 +03:00
Nekotekina 8209e6c1e3 ppu_initialize_syscalls draft 2017-05-11 19:05:41 +03:00
Nekotekina 3a5efe9809 sys_ppu_thread_register_atexit implemented 2017-05-11 19:05:41 +03:00
Nekotekina d4146e4e68 Disable /host_root/ by default 2017-05-11 19:05:41 +03:00
Nekotekina 5ffb4766b0 sys_ppu_thread_once rewritten
sys_initialize_tls moved
sys_interrupt_thread_disestablish moved
2017-05-11 19:05:41 +03:00
kd-11 450d45354c rsx: Enable GPU texture scaling by default 2017-05-10 21:50:14 +03:00
kd-11 df7b466656 spu: Speed hacks - Do not starve PPU threads
optionally hint to the OS scheduler to give less attention to SPUs

ui: Add speed 'hacks' as configurable options
2017-05-10 21:50:14 +03:00
kd-11 4b5a30f53d vulkan: Do not bother with cache checks if buffer sync is not managed
introduce pause intrin
2017-05-10 21:50:14 +03:00
kd-11 0ec88bb65d vulkan: Mark of critical code from allowing cb split in exception handler
vk: Shader loads are sacred
2017-05-10 21:50:14 +03:00
kd-11 3b27b3c182 vk: Buffer sync timing tweaks
vulkan: more sync timing fixes
2017-05-10 21:50:14 +03:00
kd-11 e1a75deb25 rsx: Refactor image scaling code; Scale downloaded surfaces with vulkan 2017-05-10 21:50:14 +03:00
kd-11 c7db322873 vulkan: Use non-blocking list of lists (WIP)
whitespace fix only

facepalm
2017-05-10 21:50:14 +03:00
kd-11 b78c6f7127 clear up a spec misunderstanding 2017-05-10 21:50:14 +03:00
kd-11 2b19031206 vulkan: Use a parallel cb for texture cache ops; bug fixes
vk: More surface fixes and debug stuff

vk: Crude thread sync implementation to prevent cb desync crashes due to resource usage

fix build

more fixes

vulkan: Do not flush command queue if address cannot be flushed

vk: More fixes for accuracy. Needs optimizations

vk: Batch all flush-to-buffer operations in the non-critical path
- More work is needed to make queue submission asynchronous
2017-05-10 21:50:14 +03:00
kd-11 fd754a4ddc vulkan: Start work on buffer synchronization
addendum - fix build

vulkan: separate cached section lifetime management

bug fixes
2017-05-10 21:50:14 +03:00
Nekotekina b1e8eefad0 cellFs fixes
cellFsAllocateFileAreaWithoutZeroFill implemented
2017-05-07 15:24:07 +03:00
Nekotekina e8d76ede14 sys_fs_fsync fix 2017-05-05 00:11:57 +03:00
Nekotekina e2478902c9 Update supporters 2017-05-05 00:11:57 +03:00
Jake b9ebf595e6 XInput vibrate support 2017-05-04 23:35:09 +03:00
Jake 6bb32e4e80 DS4 Support. Supports sixaxis and vibrate 2017-05-04 23:35:09 +03:00
Jake 6d7419be0e Add hidapi submodule, build updates / readme 2017-05-04 23:35:09 +03:00
Xemnoras bef67c8a2d Fix FAQ link (#2748) 2017-05-02 18:03:03 +01:00
scribam e33c01131e Update sceNpSns (#2732) 2017-05-01 21:35:49 +03:00
Nekotekina 2845617053 Hide cursor in GSFrame
Implements #2054
2017-04-30 21:10:27 +03:00
Nekotekina 95c6278863 Organize cellDaisy 2017-04-30 21:10:27 +03:00
Nekotekina eba44261c7 Preserve original function names 2017-04-30 21:10:27 +03:00
Nekotekina b349100d9d Stack overflow detection
Added a gap between stack allocations
PPU callstack improved
2017-04-30 21:10:27 +03:00
Wilfried Rabouin 7ab210432e PPU interpreter (precise): SAT bit implemented (#2736) 2017-04-30 21:05:50 +03:00
Pierre Vezien f40dcbfa30 Stub sceNp functions to return an offline status until further developement is done. 2017-04-30 18:21:34 +03:00
scribam 84ba7c3e73 Stub cellFiber module (#2704) 2017-04-29 02:44:42 +03:00
Jake ff366f4e4e Partially implement cellPadGetDataExtra 2017-04-29 01:26:03 +03:00
Jake 5f470b316a Fix cellPadGetData button reports 2017-04-29 01:26:03 +03:00
Jake c8252d2b28 Fix cellGameContentErrorDialog freeze 2017-04-29 01:26:03 +03:00
Jake ac58953276 Fix typo/spacing from userclip 2017-04-29 01:26:03 +03:00
Jake f064a26382 Settings Fix 2017-04-29 01:26:03 +03:00
Jake 16d7eb4f55 [Crypto] Edat cleanup 2017-04-29 01:26:03 +03:00
Nekotekina 5f26c2fc8f REG_FUNC+ macro improved
This includes REG_FNID, REG_VAR, REG_VNID
Allows to specify alternative function name
2017-04-26 23:38:24 +03:00
Nekotekina f6383f6e06 cellAudioAdd2chData fixed
cellAudioAdd6chData fixed
Speculatively.
2017-04-26 23:05:49 +03:00
Nekotekina 8055d83da2 sys_fs_fget_block_size improved 2017-04-26 20:31:39 +03:00
Nekotekina b0a83cdb56 sys_fs_lsn_get_cda_size stub 2017-04-26 20:26:29 +03:00
Nekotekina 3f5951c9f8 sys_fs_fcntl update 2017-04-26 16:10:26 +03:00
Nekotekina c3c442ccb1 cellFsGetFreeSize implemented 2017-04-26 02:27:35 +03:00
Nekotekina a95a63a58a sys_fs_lsn_lock implemented 2017-04-26 02:27:35 +03:00
Nekotekina 1bbb76fa20 sys_fs_test implemented 2017-04-26 02:27:35 +03:00
Nekotekina f42b830ce9 fs::statfs implemented 2017-04-26 02:27:35 +03:00
Nekotekina 256dfc5729 sys_fs_fsync implemented
sys_fs_fdatasync implemented as equal function
2017-04-26 02:27:34 +03:00
Nekotekina 19fd8c109e cellFsSdataOpenByFd fixed 2017-04-26 02:27:34 +03:00
Nekotekina 634f353ed4 Fix module initialization 2017-04-26 02:27:34 +03:00
Nekotekina d7c3d1ce12 sys_fs: 0xc0000006 stub 2017-04-26 02:27:34 +03:00
Nekotekina a626bbf635 PPU Debug fix 2017-04-26 02:27:34 +03:00
Nekotekina 0f95736c36 cellFsGetDirectoryEntries rewritten 2017-04-26 02:27:34 +03:00
Nekotekina d05b6135c6 Use libfs.sprx (LLE) 2017-04-26 02:27:34 +03:00
Jake 60ce85f840 [Render] Userclip for d12/vk/ogl (#2719) 2017-04-25 18:32:39 +08:00
scribam 8b2473251d Stub new modules
- cellGamePs1Emu
- cellSysconfPs1emu
- sysBdMediaId (which included sys_get_bd_media_id)
- sysConsoleId (which included sys_get_console_id)
- sysPs2Disc
2017-04-23 16:02:57 +03:00
raven02 24fc1027ea vk: add source alpha saturate blend factor (#2724) 2017-04-22 22:35:36 +08:00
Nekotekina 463e18f893 Disable SPUJIT.log (opt-in) 2017-04-20 00:52:31 +03:00
Nekotekina f7cb1aea64 Fix Lib Loading 2017-04-20 00:52:11 +03:00
Nekotekina 9b43203111 offset32(): pointer-to-member arithmetic 2017-04-20 00:17:16 +03:00
Megamouse ff5295de32 Lib Loader Radiobutton (#2689) 2017-04-20 00:16:55 +03:00
scribam 8060cf9b19 Add cellRtcAlarm module (#2703) 2017-04-19 21:24:52 +03:00
scribam ba9fdfa802 Add cellFsAccess function 2017-04-19 03:42:44 +03:00
scribam df8a0517dc Add FT_Done_Library function 2017-04-19 03:42:44 +03:00
scribam d27c3eee24 Add FTFaceH_GetMaxVerticalAdvance function 2017-04-19 03:42:44 +03:00
Ryan Gonzalez e447f071ce Misc compile fixes 2017-04-18 22:37:17 +03:00
Nicolas Werner cc12302dd4 Fix crash on linux when opening the settings dialog in debug mode
D3D12 is not in the list of supported renderes on platforms other than windows.
Deleting an item, that can't be found, triggers an assert in debug builds, so let's
avoid that.
2017-04-18 21:37:17 +03:00
scribam 30eb680c9d Check variable before to execute remove, in GLGSRender::on_exit (#2682) 2017-04-18 00:30:34 +03:00
Ani fa782046f9 Add CONTRIBUTING.md guidelines (#2706)
Due to the big amount of invalid issues being submitted later, I think we need to activate those.
2017-04-16 21:32:58 +01:00
Nekotekina f0f8f50e12 Error filtering updated 2017-04-16 17:44:20 +03:00
Nekotekina 4ceaab10a5 _mxr000 hack moved 2017-04-16 17:44:20 +03:00
Nekotekina 402df68235 sys_spu_image loading rewritten 2017-04-16 17:44:20 +03:00
Nekotekina db1b012a26 SPU fix 2017-04-16 17:44:20 +03:00
Nekotekina b1f1a5885b PPU LLVM improved 2017-04-16 17:44:19 +03:00
Nekotekina 2fd58dc7e8 sys_prx updated 2017-04-16 17:44:19 +03:00
Nekotekina 7428bb3025 HLE linkage rewritten 2017-04-16 17:44:19 +03:00
Jeremiah 14f02b23c2 Properly overwrite param.sfo in savedata (#2690) 2017-04-16 01:45:50 +03:00
Ofek 617746606d Trophy fixed (#2687) 2017-04-14 13:08:17 +03:00
kd-11 65bdcaed29 spu: Check exponent bits in FMA ops (#2683) 2017-04-13 23:02:51 +03:00
Ofek a5fd7abcf7 Trophy update (#2655)
* Added checksum check to TROPHY.TRP loader

* Implemented sceNpTrophyGetGameProgress, sceNpTrophyGetGameIcon & sceNpTrophyGetTrophyIcon

* Updates to up to date APIs and tiny changes

* Code style fixes for checksum verifier, and another fix for trophy functions

* Format fix
2017-04-13 20:29:47 +03:00
Ani 94ab3ae7cf Misc (#2614)
* cellSysmodule: Register libad modules

Register libad_core, libad_async, libad_billboard_util

* Misc

sys_ss_get_console_open_psid (Called on Project Diva F 2nd),
sys_ss_get_console_id
Stub cellWebBrowserGetUsrdataOnGameExit for Professional Baseball
Spirits 2015
Fix two logs on GcmSys
2017-04-13 19:30:25 +03:00
Jeremiah 370c2ecac5 Update cellSaveDataGetListItem 2017-04-13 18:42:38 +03:00
Nekotekina af8d7b9e4e Travis fix 2017-04-12 12:58:03 +03:00
kd-11 3ce7947dd3 rsx: Throw if user attempts to use Vulkan/DX12 without driver support 2017-04-11 13:19:31 +03:00
Nekotekina 3f20e0c5a8 Fix zip cmd 2017-04-11 00:48:27 +03:00
Nekotekina a01398eda0 Travis fix 2017-04-10 23:30:35 +03:00
Nekotekina 78080fd782 Fix token 2017-04-10 17:29:41 +03:00
kd-11 d3e3e10b7d Update libglew-dev for travis
Update libglew as well
2017-04-10 17:24:30 +03:00
kd-11 ac3b22902a gl: Autodetect supported OpenGL extensions
cleanup
2017-04-10 17:24:30 +03:00
Nekotekina ea098a920e Fix 2017-04-10 16:41:14 +03:00
Nekotekina e786192766 Upload Travis builds 2017-04-10 16:08:10 +03:00
raven02 9b48074389 GL: fix wireframe in Catherine (#2660) 2017-04-10 09:28:46 +08:00
scribam 9ba0a9189b Update sys_spu
- Implement sys_spu_thread_group_set_priority
- Implement sys_spu_thread_group_get_priority
2017-04-10 04:08:55 +03:00
scribam 7cd15a6202 Add functions to cellSsl 2017-04-10 03:25:45 +03:00
scribam 49ba4bbfb5 Typo 2017-04-10 02:39:52 +03:00
Nekotekina 77aa3142a9 Audio: downmix to stereo 2017-04-10 00:18:12 +03:00
Nekotekina 4c741e93c3 ALSA Audio Renderer (Linux) 2017-04-09 19:45:12 +03:00
Nekotekina dc3d38c255 PPU Analyser: TOC detection
Improved TOC detection logic
Added "PPU Debug" option
2017-04-09 00:16:53 +03:00
Nekotekina fb9b09d004 PPU disasm: print HLE index 2017-04-08 23:51:54 +03:00
Nekotekina d7c66fc949 ppu_analyse: use entry point 2017-04-08 23:51:54 +03:00
kd-11 adefd1fd63 rsx/ui: Add config toggle for GPU texture scaling/blit 2017-04-08 23:12:09 +03:00
kd-11 6d6d0e4e36 gl: Use the GPU to scale textures; use ARB_sampler_object
Improve scaling and separate sampler state from texture state

gl: Unify all texture cache objects under one structure separate by use case
gl: Texture cache fixes

- Acquire lock when finding matching textures
- Account for swizzled surfaces when deciding whether to cpu memcpy
- Handle swizzled images on the GPU
2017-04-08 23:12:09 +03:00
kd-11 d94986ff0d rsx: Set up hw accelerated blit 2017-04-08 23:12:09 +03:00
Zangetsu38 b3cb827526 Registers more functions missing.
Implement and stub cell_FreeType2.
Reorder cellRtc.
2017-04-08 22:32:59 +03:00
Nekotekina ac79654d1b Warn about libfiber.sprx
It's currently incompatible with LLVM
Also fixed breakpoint bug
2017-04-08 00:56:38 +03:00
Nekotekina 69d86e39b9 Fixed auto LLE 2017-04-08 00:56:38 +03:00
Nekotekina 49daecc4ea Update supporters 2017-04-08 00:56:38 +03:00
Nekotekina 8f0b55c2cb Update rpcs3.ico 2017-04-08 00:56:38 +03:00
Nekotekina ed7883ba07 PPU Analyser fix 2017-04-08 00:56:38 +03:00
scribam 7a1fd27ecc Update cellSpudll
- Stub cellSpudllGetImageSize
- Implement cellSpudllHandleConfigSetDefaultValues
2017-04-08 00:09:06 +03:00
scribam d160c862c7 Stub cellScreenshot module 2017-04-07 22:40:23 +03:00
scribam 4c4b353766 Stub cellVideoUpload module (#2642) 2017-04-07 19:45:38 +03:00
scribam 22ec8c4dd2 Stub cellSysconf module 2017-04-07 18:53:00 +03:00
scribam 219dba8aae Stub cellBgdl module 2017-04-07 16:36:51 +03:00
scribam 7c2af5ceae Register cellSpursRemoveSystemWorkloadForUtility
Before
! LDR: **** cellSpurs export: [0x31F5196B] at 0x13ab56c

After
! LDR: **** cellSpurs export: [cellSpursRemoveSystemWorkloadForUtility] at 0x13ab56c
2017-04-07 16:13:14 +03:00
scribam a1cc40e7b1 Add cellLibprof module (#2637) 2017-04-07 15:48:59 +03:00
ikki84 27ea4285ef Imejp: cellImeJpEnterChar (#2600) 2017-04-07 15:30:07 +03:00
Yukariin 74e806810d [WIP] Update Qt interface (#2336)
* Fix rpcs3qt Linux build

* Files clean up

* Add base MainWindow class

* Add slot stubs

* Update MainWindow::DecryptSPRXLibraries

* Add SettingsDialog base class and tab stubs

* Add CoreTab base layout

* Add compile guards

* Minor fixes

* Add GraphicsTab base layout

* Add OK button signal

* Remove QML stuff

* Fix indentation

* Add AudioTab base layout

* Add InputTab base layout

* Fix layouts

* Add MiscTab base layout

* Fix layouts

* Add NetworkingTab base layout

* Add SystemTab base layout

* Fix button layout in SettingsDialog

* Make SettingsDialog resizable

* Add base dock widget stubs

* Add very base PadSettingsDialog layout

* Add combo box entries

* Abb LogFrame base layout

* Fix indent

* Abb GameListFrame base layout

* Minor fixes

* Add AutoPauseSettingsDialog base layout
2017-04-07 01:12:15 +03:00
jjsat d8dc4f4474 Fix isdenormal() for MS VC. 2017-04-06 20:58:02 +03:00
scribam ba8aa580a1 Add few functions in cellSysutil. 2017-04-06 14:58:03 +03:00
scribam c863da278f Add cellRtc functions 2017-04-06 12:55:33 +03:00
Inviuz 22e679e23e cellSave fix plus bugfixes (#2631)
* cellSave fix plus bugfixes

allows allocation of last byte in memory block
prevents rpcs3 from crashing when closing non existent socket

* Fix overflow

* add more socket options
fix typo

prevent sys_net from operating on nullptr sockets
2017-04-05 16:08:58 +03:00
Ivan 1ae334e500 Fix freezes on Linux (#2632) 2017-04-04 23:27:16 +03:00
Nekotekina 65488078a4 cellSaveData workaround 2017-04-03 16:02:43 +03:00
kd-11 2d99f3556e rsx: Fix line_loop -> line_strip indexing 2017-04-03 13:50:58 +03:00
kd-11 d33bc540bc rsx/vk: Re-enable layout transitions in vulkan. Vulkan drivers take this hint seriously
- Fix enum typo
2017-04-03 13:50:58 +03:00
Jochen Schleu ce7d62968e Only pass positive values to sqrt and log2 in the fragment program. (#2624) 2017-04-03 13:17:20 +03:00
Andrey 215a9f9e11 Gdb debug server (#2542) 2017-04-02 21:10:06 +03:00
scribam b54ba47870 Stub cellHttpUtil (#2611) 2017-04-02 15:32:53 +03:00
Cornee Traas 901f503a3a Fix mounting bdvd when elf in subdirectory
Causes MGS4 to boot further
2017-04-01 19:29:49 +03:00
kd-11 0fba38f691 gl: Fix legacy clamp mode (#2612) 2017-03-30 19:37:49 +03:00
Nekotekina c4066b924b Restore GD in game viewer 2017-03-30 13:17:34 +03:00
Nekotekina 3ec156b2f2 Enable patch engine for SPU images 2017-03-30 12:04:59 +03:00
Nekotekina 78b9c64f67 Simple patch engine 2017-03-30 12:04:59 +03:00
Nekotekina 77e88741bc Alternative TLS allocation
Should fix "out of TLS memory"
2017-03-30 12:04:59 +03:00
Nekotekina 4c789faea4 RemoveGameConfig improved 2017-03-30 12:04:59 +03:00
kd-11 66835cf083 rsx: Fix mipmap count calculation 2017-03-29 23:06:17 +03:00
kd-11 ad12900397 gl: Force alignment of DXT textures 2017-03-29 23:06:17 +03:00
kd-11 909f3e9b3e rsx: Support indexed immediate draw via ArrayElement method 2017-03-29 23:06:17 +03:00
Inviuz 632287afe7 Add simple divide to get kbytes
integer division
2017-03-28 23:13:25 +03:00
Inviuz 08c9a7c184 Check for invalid arguments
Caused crash when recvfrom was using null buffer
2017-03-28 23:13:25 +03:00
Inviuz 149c08ba78 implement getSizeKB functions
bugfix in sys_net. id 0 is acceptable socket id
2017-03-28 23:13:25 +03:00
Nekotekina cec75e8567 OpenConfigFolder 2017-03-27 13:19:53 +03:00
Nekotekina c1a98f76cd OpenGameFolder simplified
Added menu separators
2017-03-27 12:44:00 +03:00
Nekotekina 6b471d50eb libmedi fix 2017-03-27 01:15:41 +03:00
Nekotekina e8984d976c _sys_sprintf implemented
_sys_printf, _sys_snprintf fixed
2017-03-27 01:15:41 +03:00
Nekotekina 8590b66b4b Fix cpu_thread pause 2017-03-27 01:15:41 +03:00
Nekotekina 98d96fd649 util::memory_reserve fixed 2017-03-27 01:15:41 +03:00
Nekotekina 37a97a71e3 vm::g_exec_addr added
s_ppu_compiled renamed
Exception handling enabled
2017-03-27 01:15:41 +03:00
Nekotekina e4d1bdef07 Fix check_addr arg 2017-03-27 01:15:41 +03:00
Nekotekina f1f53de24b PPU analyser fix 2017-03-27 01:15:41 +03:00
Nekotekina cd9bd79639 AutoLLE: libhttp.sprx added 2017-03-27 01:15:41 +03:00
Nekotekina 4bbe1b6bf3 fs::write_file aux 2017-03-27 01:15:41 +03:00
Nekotekina 0393c7f52c fs:: handle negative seek 2017-03-27 01:15:41 +03:00
Nekotekina e12a708036 LLVM: fix for mingw 2017-03-27 01:15:41 +03:00
Megamouse 51cd98c9f4 Add "Open Game Folder" Option" (#2595) 2017-03-27 01:11:08 +03:00
kd-11 3ec1fe9ee7 rsx: Fix depth clears on z16 surfaces without stencil
remove some debug code
2017-03-26 16:22:53 +03:00
kd-11 70d3a6d840 rsx: Support more base types for immediate rendering
fix alignment
2017-03-26 16:22:53 +03:00
kd-11 ba968048c9 vk: Minor fixes to vertex counting and lower exception to notice if var does not exist 2017-03-26 16:22:53 +03:00
kd-11 79d114cc06 rsx: Support immediate mode rendering 2017-03-26 16:22:53 +03:00
Zangetsu38 0f9f787a55 Move module in correct path 2017-03-26 01:50:22 +03:00
Ani 7ae2a8840b Register HLE libmedi, cellCrossController, cellSysutilNpEula
Motorstorm Apocalypse calls for cellMediatorGetSignatureLength,
cellMediatorCreateContext, cellMediatorGetProviderUrl,
cellMediatorGetStatus

LittleBigPlanet 2 and 3 may call for 0x37E1F502 (unknown name) on
cellCrossController

Resistance 3 and Uncharted 2 may call for the functions registered
on cellSysutilNpEula
2017-03-26 01:04:39 +03:00
Ani 7d59f7e69c cellSysmodule: Register 0xF044, 0x0054, 0x005C modules
cellSysmodule: Register 0xF044 module (cellSysutilNpEula)
Found by debugging Uncharted 2 Demo (NPEA90055)
Helps in all games that register sys module configuration 'multi-player'

cellSysmodule: Register 0x0054 module (libmedi)
Found on Motorstorm Apocalypse [NPEA00315] (thanks Zangetsu for the log)

cellSysmodule: Register 0x005C module (cellCrossController)
Found on LittleBigPlanet 2 [BCES00850] (thanks Zangetsu for the log)
2017-03-26 01:04:39 +03:00
kd-11 5b0fddd3e8 gl/vk: Fix stencil ops 2017-03-25 15:07:43 +03:00
Jake f4a0ff19d5 Xinput/MMjoy: Fix connection status 2017-03-25 14:26:27 +03:00
Jake 65696bf6a3 Crypto: fix sprx/self check in npDrm and edata fixes 2017-03-25 14:26:27 +03:00
clienthax 44e62c5c92 Fixs for klics 2017-03-25 14:26:27 +03:00
Svyatoslav 620ec7ef25 PVS-Studio: fix V547 (#2543) 2017-03-25 13:27:42 +03:00
kd-11 34c2b8a55e rsx: recover from FIFO parse errors
- Validate FIFO registers before access

-- Validate the args ptr separate from the get ptr
2017-03-24 09:30:23 +03:00
kd-11 ef822d785e rsx/fp: src3 workaround 2017-03-24 09:30:23 +03:00
kd-11 f7d767d0e8 gl/vk: Fix projected coordinate lookup on a cubemap sampler 2017-03-24 09:30:23 +03:00
kd-11 8fa3f0721e fix false alphakill flags when texture fetch is optimized away 2017-03-24 09:30:23 +03:00
Mårten Nordheim 458e5fa4e1 Multithreaded compile on Windows for llvm, glsl, vulkan 2017-03-23 20:50:22 +03:00
twdarkeh ee8fecea21 remove custom config (#2574)
Add remove custom config to right click
2017-03-23 11:27:33 +03:00
Nekotekina 3bfe17a14f PPU: HACK instruction removed
Breakpoints fixed
2017-03-22 23:23:47 +03:00
Nekotekina ddd6ebc58d LLVM: Bump obj version 2017-03-22 01:33:50 +03:00
Nekotekina 1b5c0c68dd LLVM: enable New GVN Pass 2017-03-22 01:21:19 +03:00
Nekotekina 3e6f9faf71 Use LLVM 4.0 2017-03-21 23:32:14 +03:00
Nekotekina ad72168143 LLVM: load .pdata section 2017-03-21 20:16:41 +03:00
Nekotekina 4fc8276f0f LLVM: fix FCTIW, FCTID 2017-03-21 20:16:41 +03:00
Nekotekina aad035c4b5 LLVM: fix FCTIWZ, FCTIDZ 2017-03-21 20:16:41 +03:00
Nekotekina 560d6776af LLVM: generate trampolines
Must fix issues with older CPUs
JIT.cpp refactored to use utils::memory*
2017-03-21 20:16:41 +03:00
Nekotekina c7a9a8e8f1 utils::memory update 2017-03-21 20:16:41 +03:00
Nekotekina c2cd0c994f LLVM: volatile load for state 2017-03-21 20:16:41 +03:00
Inviuz c729d6d65a Use sys_vm_memory_map plus add default value for sys_allocate (#2560)
for different memory map(unconfirmed) also handle default action.
Fixes unknown syscall 313 error
Issue 2510
2017-03-21 16:02:00 +03:00
scribam 5785ebb384 Update cellOvis
- Add parameters to cellOvisInitializeOverlayTable, cellOvisFixSpuSegments and cellOvisInvalidateOverlappedSegments functions
- Modify return type for cellOvisFixSpuSegments and cellOvisInvalidateOverlappedSegments functions
- Replace UNIMPLEMENTED_FUNC by cellOvis.todo
2017-03-20 16:40:44 +03:00
scribam b32ad80c23 Update PPUFunction.cpp
Source:
- http://www.psdevwiki.com/ps3/LV2_Functions_and_Syscalls
- http://www.psdevwiki.com/ps3/VSH_Exports
2017-03-19 20:12:11 +03:00
Nekotekina 2b79a3691f cellVdec: default FRC workaround 2017-03-17 20:51:06 +03:00
Nekotekina cff39ec3a9 Fix override warning 2017-03-17 20:23:21 +03:00
Nekotekina c4bdc930ca Fix UB in PPU interpreter 2017-03-17 20:23:03 +03:00
Nekotekina 14b9b12211 Fix UB in BitField.h 2017-03-17 20:22:47 +03:00
Nekotekina d45d8eb4bc Stub sys_crash_dump_set_user_log_area 2017-03-17 20:08:00 +03:00
al0xf c5e6665010 Fix async OSK loading (#2531) 2017-03-16 12:34:47 +03:00
Nekotekina 1b5a479bbd Auto LLE: cellSsl 2017-03-14 19:21:03 +03:00
Nekotekina fc92040d7f About dialog updated 2017-03-14 19:13:01 +03:00
Nekotekina b3073bbf1e Gui: TTY log fix 2017-03-14 16:29:58 +03:00
Nekotekina 63a107acbc Small fix 2017-03-14 16:12:03 +03:00
Nekotekina 07646c2124 LLVM CPU override option 2017-03-14 16:12:03 +03:00
Nekotekina b45cea1434 Opt-in LLVM logs 2017-03-14 16:12:03 +03:00
Nekotekina 3648a058d1 Auto LLE update
libdtslbrdec.sprx removed
Some encoders added
2017-03-14 16:12:03 +03:00
Nekotekina 90479eaad6 sys_lv2coredump, sys_crashdump modules 2017-03-14 16:12:03 +03:00
kd-11 1de2ceca9b rsx/vp: Fixes (#2533)
* rsx/vp: Fix rsq opcode broken in previous commit

* fix ms compiler error

* fix another possible conflict with ms d3d compiler
2017-03-14 16:05:59 +03:00
kd-11 8fc281e034 gl: Separate scale offset, fragment constants and transform constants uploads 2017-03-13 23:40:34 +03:00
kd-11 2093134420 gl: Do not attempt to re-flush an address if another thread flushes it first 2017-03-13 23:40:34 +03:00
kd-11 818dd88390 gl/vk: Ignore invalid texture uploads 2017-03-13 23:40:34 +03:00
kd-11 be4bb48476 rsx/fp: Fix some decompiler bugs 2017-03-13 23:40:34 +03:00
Nekotekina 1c8cb3b7d3 Boot messages 2017-03-13 18:03:38 +03:00
Nekotekina 1ede0f4706 Minor optimization 2017-03-13 15:02:18 +03:00
Nekotekina 78703cfe47 Use utils::memory_protect 2017-03-13 13:16:22 +03:00
Nekotekina c72a5a5775 thread_ctrl::finalize crash fix 2017-03-13 13:16:22 +03:00
Nekotekina d09dd29054 utils::memory_protect 2017-03-13 13:16:22 +03:00
kd-11 ed711c0e59 Merge pull request #2522 from kd-11/experiments
gl: Lower restriction on render target pitch
2017-03-13 13:06:49 +03:00
kd-11 fa6114719d gl: Lower restriction on render target pitch 2017-03-13 12:44:28 +03:00
ikki84 c8b9cc9fe5 Stub cellAvconfExt
Changed "fmt::throw_exception("Unimplemented" HERE); "
into:
"UNIMPLEMENTED_FUNC(cellAvconfExt); "
"return CELL_OK;"

Allow NPEB01283 to go further in boot (pass the intro and reaches the menu)...
2017-03-13 12:19:38 +03:00
Inviuz b70a1edbc7 Mmapper with Neko's review fixes (#2503) 2017-03-12 03:15:22 +03:00
Nekotekina 14e5aa57c8 wx: UTF8 path fix 2017-03-12 00:41:48 +03:00
Nekotekina cdc49d166e Appveyor version fix 2017-03-11 22:06:12 +03:00
Nekotekina 7b65f93953 SPU ch69 2017-03-11 21:55:50 +03:00
Nekotekina d878a286bc 0.0.2 Alpha 2017-03-11 21:38:49 +03:00
Nekotekina ce35554a55 Fixes (sys_memory, sys_mmapper)
DeS
2017-03-11 21:37:18 +03:00
Nekotekina 1f17109203 __chkstk workaround 2017-03-11 19:49:32 +03:00
Nekotekina 4739eb3601 Reservation fix 2017-03-11 15:48:43 +03:00
Inviuz 40a84dd477 Handles directory creation in cellGameDataCheckCreate2 (#2488)
* Handle directory creation in cellGameDataCheckCreate2

Stops some games from displaying information about not enough memory on
hdd

* Returning CELL_OK causes some games to loop on sceNp functions

for "shaman magic"

* cellGameDataCheckCreate2 added param.sfo creating/rewriting

* fix fs::file null

and one readability change

* For debugging purposes

When fs::file problem is located will be improved

* Fixed wrong operators

* Conversion from vfs to fs

Should take care of fs::null

* Cleanup

removed some unnecessary logging

* Fix successive function calls

second call was always ending in error since it didn't create the conent
permission

* Changes according to Neko's review

* Change to use u32 value
2017-03-11 11:59:50 +03:00
Jake 309f409554 Fixes: cellMsgDialog, cellPad 2017-03-11 01:13:53 -06:00
Jake a6f8e4f6b3 Edat / Sdata: On the fly decryption for edat, fix EDAT_FLAG_0x20 decryption 2017-03-10 19:39:01 -06:00
kd-11 596db2c29c Merge pull request #2490 from kd-11/texture_cache_fix
gl: Fix texture cache bugs
2017-03-10 23:57:47 +03:00
kd-11 1fd33f611c gl: Fix texture cache bugs
Fix endianness bug
Fix r/w when real pitch is <= 64
2017-03-10 19:11:53 +03:00
Nekotekina 5e3bacbd9b New reservations
Memory system cleanup
sys_memory_get_page_attribute
2017-03-10 15:51:40 +03:00
Ani 7cdb5f3123 Add missing system languages
Adds Portuguese (BR) which was introduced in firmware 4.00 alongside
with English (UK)
Adds Turkish which was introduced in firmware 4.30
2017-03-08 19:59:34 +03:00
raven02 a168aa2df3 DX12: fix DRGB8 texture format (#2480)
* DX12: set native sampler format to BGRA8

* DX12: fix DRGB8 texture format
2017-03-07 19:34:09 +08:00
Jake 87fe93ee9a Mself / Sdata: on the fly partial decoding support (#2468) 2017-03-07 08:59:05 +08:00
kd-11 039e295e53 Merge pull request #2477 from kd-11/master
gl/vk/dx12: Implement forced channel remapping
2017-03-06 20:13:54 +03:00
kd-11 0fd888a42e vk: Fix DRGB8 format 2017-03-06 18:56:46 +03:00
kd-11 1e71285de8 gl/vk/dx12: Implement forced channel remapping
gcc fix
2017-03-06 14:34:29 +03:00
Nekotekina a2200bd01e Speculative fix for fmt::format 2017-03-05 21:42:54 +03:00
Nekotekina 9a9455a696 Fix #2462 2017-03-05 21:42:27 +03:00
Nekotekina 19a698682b Compilation fix (mingw) 2017-03-05 19:00:08 +03:00
Nekotekina 3baf79f929 ror64 added 2017-03-04 17:34:59 +03:00
Nekotekina 74d47943e9 sceNpDrmVerifyUpgradeLicense fixed 2017-03-04 17:14:51 +03:00
Nekotekina d9c78cf495 bf_t fix 2017-03-04 17:01:31 +03:00
Nekotekina 8e4a09d9e5 cellFsSdataOpenByFd draft
LLE-compatible implementation
lv2_file::make_view implemented
2017-03-04 16:54:49 +03:00
Wilfried Rabouin 67ac8bf070 PPUInterpreter: Fix undefined behavior of left rotate functions (#2469)
* PPUInterpreter: Fix undefined behavior of rol8 and rol16 with inline assembly

* PPUInterpreter: Fix undefined behavior of rol32 and rol64

* PPUInterpreter: Change left rotate functions to inline functions and move to types.h
2017-03-04 16:41:40 +03:00
Chocobo1 ef5225b776 TravisCI improvements (#2460)
* TravisCI: cleanup indentation

2 spaces for indentation

* TravisCI: make jobs drop to 3

TravisCI allocates 2 cpus per build instance

* TravisCI: move package installation to apt addon block

* TravisCI: make pip install to user directory

Also disable sudo for faster bootup

* TravisCI: expand if condition to multiple lines

Also remove outdated comment
2017-03-04 16:22:46 +03:00
Nekotekina 48b0583866 Default LLE option 2017-03-03 01:40:27 +03:00
Chocobo1 f528aada24 TravisCI: use ccache (#2448) 2017-03-03 00:49:42 +03:00
kd-11 1f45f05f8d Merge pull request #2447 from kd-11/cache_invalidation_fix
gl/vk/cache: Fix invalidating intersecting and overlapping memory regions
2017-03-01 14:44:14 +03:00
kd-11 b8fcbb68b0 gl/vk/cache: Fix invalidating intersecting and overlapping memory regions
whitespace fix
2017-03-01 14:00:06 +03:00
kd-11 4ab9a2a3a8 Merge pull request #2391 from kd-11/rsx_surface_tests
gl/vk/rsx: Improve texture cache
2017-03-01 10:36:03 +03:00
kd-11 85c0219aed vk: Fix cache range computation 2017-03-01 00:40:53 +03:00
kd-11 10e218e224 Fix linux build (travis-ci) 2017-03-01 00:40:52 +03:00
kd-11 69d044cd8d gl: Relax requirement to EXT_DSA from ARB_DSA to better support linux 2017-03-01 00:40:51 +03:00
kd-11 7062efeb3e gl: Fix a fence deadlock in fence::wait_for_signal
gl: Fix potential race condition when executing local work queue
2017-03-01 00:38:22 +03:00
kd-11 cee53fcecf gl: Ensure correct sized pbo is created upon reset 2017-03-01 00:16:55 +03:00
kd-11 ef8e92cbe3 gl: Change clear timing to immediate
gl: Handle cell write to locked RTT region

addendum: Fix buffer locking (personal 4)
2017-03-01 00:16:55 +03:00
kd-11 7c73c3b75c rsx/gl: Minor refactoring; prepare vulkan backend 2017-03-01 00:16:55 +03:00
kd-11 1e826f5ccf rsx: Minor optimization (tangible boost) 2017-03-01 00:16:55 +03:00
kd-11 96561c16ad gl: Rewrite texture cache
gl: scale downloaded RTT images
2017-03-01 00:16:55 +03:00
clienthax bd85f23ed9 Stub sys_gamepad ycon interface (#2435)
* Attempt to add sys_gamepad...

* Stub ycon methods

Signed-off-by: clienthax <clienthax@gmail.com>
2017-02-28 19:15:11 +03:00
Ani 557e1c3694 Fix cellDiscGameGetBootDiscInfo (#2430)
cellDiscGameGetBootDiscInfo is called by non-disc games for some reason.
That wasn't accounted for and therefore it would try to read PARAM.SFO
from an unmounted path and throw an access violation.

Tested with NBA Live 08 Demo NPUB90029, probably fixes similar games as
well
2017-02-28 18:42:45 +03:00
Nekotekina c785b14c18 LLVM fix 2017-02-28 17:16:32 +03:00
Nekotekina 3751d5d5c1 Fixed VFS initialization order
Fixed RAP location for SELF
Fixed custom config loading
2017-02-28 16:18:49 +03:00
Nekotekina 45bb51ded8 unpkg improved
Initial content_type parsing
Added PSP2 support
2017-02-28 16:18:48 +03:00
Jake c3b424eb11 rsx: image_in fix for clipx/y (#2440) 2017-02-28 16:21:07 +08:00
Ani 01ef9ecca4 sceNp: Fix ExitSpawn, Implement VerifyUpgradeLicense (#2428)
* sceNp: Fix ExitSpawn and ExitSpawn2

Fixes sceNpDrmProcessExitSpawn and sceNpDrmProcessExitSpawn2
functions

The problem was that first argument klicensee was missing, therefore
shifting every other argument out of place and throwing an access
violation at the end.

* Use npDrmIsAvailable on sceNpDrmProcessExitSpawn

Tries to decrypt DRM file with provided klicensee

* Implement sceNpDrmVerifyUpgradeLicense

Implements sceNpDrmVerifyUpgradeLicense / sceNpDrmVerifyUpgradeLicense2
2017-02-26 23:44:48 +03:00
Nekotekina 0eb6bf6a67 LLVM: splitting and caching 2017-02-26 20:14:18 +03:00
kd-11 4aab8db420 Merge pull request #2426 from kd-11/gl_rsx_wip
Implement BRB opcode
2017-02-26 14:42:01 +03:00
kd-11 9263999ad1 [rsx/vp] Improve BRB opcode implementation
fix merge issues
2017-02-26 10:17:34 +03:00
Ani 4d9b56c7f1 libnet: recvfrom() fix (#2427)
Prevents emulator crash when invalid socket is provided to the function
2017-02-25 23:27:31 +00:00
Nekotekina d0afef47f8 LLVM: block borders fixed 2017-02-25 21:30:28 +03:00
Nekotekina af53ce6f76 Stack overflow constrained 2017-02-25 19:29:31 +03:00
Nekotekina c0589cab05 Minor fix (linux) 2017-02-24 19:56:59 +03:00
Nekotekina f35babad98 shared_mutex fix (linux) 2017-02-24 18:48:53 +03:00
Nekotekina 8369cb2af6 Complex STOP 0x0 hack 2017-02-24 16:57:09 +03:00
Nekotekina 07d49b1bd8 sys_spu_thread_send_event fix 2017-02-24 16:57:09 +03:00
Nekotekina 5c8aab7917 Disable PPU interpreter (precise) 2017-02-24 16:57:09 +03:00
georgemoralis 14093c86a9 load config.yaml settings in a new configpergame 2017-02-24 16:55:27 +03:00
georgemoralis e153df4d5b pergameconfig : create directory if not exists 2017-02-24 16:55:27 +03:00
georgemoralis 3e0c356b0b per game config.yml (#2418) 2017-02-23 18:08:52 +03:00
Ani 5fce74a2a6 Hides D3D12 renderer on not supported OSes (#2416)
Since Windows 10 is the only system supporting it there's no point in it being listed on other OSes. 
Should prevent users reporting D3D12 isn't working on their non-w10 OSes.
2017-02-22 22:27:35 +00:00
Nekotekina 7c418f7ea5 PPU: block info fix 2017-02-23 00:35:29 +03:00
Nekotekina dac72ff371 Automatic dev_* dir creation 2017-02-22 17:29:10 +03:00
Nekotekina baf22527b0 Ditch fs::get_executable_dir 2017-02-22 17:17:26 +03:00
Nekotekina 4cba60b27f Cache decrypted EBOOT.BIN 2017-02-22 15:21:30 +03:00
Nekotekina 5e539f71e6 Prefer EBOOT.BIN 2017-02-22 13:23:21 +03:00
Nekotekina 9000407a77 cpu_thread::test_state added
lv2_obj::sleep adjustment
synchronization fixes
2017-02-22 13:23:21 +03:00
Nekotekina 4b6f8d2f62 fxm::check_unlocked added 2017-02-22 12:57:39 +03:00
Nekotekina 688097faa9 lf_spsc, lf_mpsc added 2017-02-22 12:57:08 +03:00
Nekotekina f08579d201 Log timestamp added 2017-02-22 12:56:34 +03:00
Jake 47fdaf6902 Improve cellPngDec (#2394)
* Improve cellPngDec
- ReadHeader and SetParam corrected
- Partial loading Implemented
- Interlace Support added
- Improve error handling

* Use custom exception

* Change to catch ref
2017-02-19 14:59:49 +03:00
kd-11 22c0f0d635 Merge pull request #2405 from jarveson/imagein-fix
Fix nv3089_image_in
2017-02-18 15:36:45 +03:00
Jake a886e28f87 Fix nv3089_image_in
- Restrict clip_x/y
- Remove double offset addition
2017-02-17 18:33:56 -06:00
Ani 65104b5909 Rough implementation of GCM_CONTEXT_DMA methods
Rough implementation of GCM_CONTEXT_DMA methods.
Fixes #1487
2017-02-17 22:35:28 +03:00
Ani 5605b4ee70 Fixes #2399
Defaults dGPU on NVIDIA Optimus systems and requests High Performance
mode on AMD systems.
2017-02-17 02:07:42 +03:00
Nekotekina 3ecba8e57f Fix #2397 2017-02-16 17:14:29 +03:00
flash-fire 0c8bda4f41 Simplify the popup menu. You can reuse the popup menu. So, no need to create/delete each time. Also, deleting stuff from a for each iterator is generally a bad idea. 2017-02-16 12:14:54 +03:00
Cornee Traas 458dbbd15d PS3UPDAT.PUP installer (#2386)
* Add PUP loader

* Add .tar loader and update .pup loader

* Add extract method + offset to TAR loader

Also adds error checking + operator bool overload

* Add firmware decryption keys to key vault

* Initial seperation of SELFDecrypter

This seperates SELFDecrypter into itself and SCEDecrypter.
SCEDecrypter contains the logic to decrypt any file with an SCE Header.
SELFDecrypter inherits from SCEDecrypter and contains the code
specifically to do with ELF. DecryptData could be deduplicated more.

* Add "Install Firmware" option to tools menu

* SCEDecrypter: put each segment in own file

Also, const-correctness, adjusted buffer size and better error handling

* More SELFDecrypter refactoring

* Compile fix

* Add messageboxes to firmware install

* Add progress bar to firmware install
2017-02-16 10:15:00 +08:00
Nekotekina b1aa87b515 Busy waiting added 2017-02-16 00:13:55 +03:00
B1ackDaemon b637bd3866 Merge pull request #2390 from georgemoralis/master
Implemented cellDiscGameGetBootDiscInfo
2017-02-15 12:57:31 +02:00
gmoralis b4557789f8 Implemented cellDiscGameGetBootDiscInfo 2017-02-15 10:49:18 +02:00
Ani 63169d7679 Nekotekina: Fix loading nonexistent libs
Nekotekina's fix for preventing loading nonexistent libs
2017-02-15 02:47:54 +03:00
georgemoralis 5d705c0e9c fix up an issue with sceNpTrophyCreateContext (#2382) 2017-02-14 20:46:56 +03:00
Zangetsu38 682924b51a D3D12: add DXGI_FORMAT_B8G8R8A8_UNORM missing (#2385) 2017-02-15 00:29:43 +08:00
Nekotekina 598c90f376 PPU thread scheduler 2017-02-13 22:26:11 +03:00
Nekotekina e4962054a4 LLVM: add check state 2017-02-13 20:51:56 +03:00
Nekotekina 436c245d13 Remove unused code 2017-02-13 18:33:31 +03:00
Nekotekina 8891d85f75 Hack for 0x0 2017-02-13 18:32:54 +03:00
Nekotekina 763550c472 0x2c8..0x2fc 2017-02-13 17:50:04 +03:00
Nekotekina d2ddb9882f SPU: IRET, SN event 2017-02-13 16:29:32 +03:00
Nekotekina 64ac6a59c4 REG_FUNC simplified 2017-02-13 16:29:32 +03:00
Nekotekina acd9d6ff24 Stub some modules 2017-02-12 21:35:55 +03:00
Nekotekina f4b95c0226 PPU analyser improved 2017-02-12 21:12:08 +03:00
Nekotekina 177084b1f4 cellSysutil functions
E1EC7B6A implemented
2017-02-12 21:03:08 +03:00
Nekotekina aff0484ea2 Stub some functions 2017-02-12 02:55:09 +03:00
Nekotekina ef1eff6d48 File: handle EACCES 2017-02-12 02:55:09 +03:00
clienthax b407d12ed1 Make APP packages bootable - from BlackDaemon (#2368) 2017-02-11 22:11:04 +03:00
Nekotekina e8bfce4ebd decrypt_self() function
Fixed SPU self decryption
Fixed PSV debug self load
2017-02-11 21:36:48 +03:00
Nekotekina be5f780977 fs::memory_stream fixed
seek() allows any offset
read() cannot overflow
2017-02-11 19:27:49 +03:00
Nekotekina 9e39c8cd64 fs::make_stream template 2017-02-11 19:05:35 +03:00
Nekotekina 3356a76c9b PPU fix 2017-02-11 17:17:07 +03:00
kd-11 e29747170f Merge pull request #2357 from kd-11/master
RTT shader access fix
2017-02-11 15:58:26 +03:00
kd-11 d6159a35aa gl/vk/dx12: Fix texture scaling on unnormalized rtt access 2017-02-11 15:45:59 +03:00
raven02 0019ea28c3 GUI: not displaying _INSTALL , _DATA and _GAMEDATA in gameviewer (#2364) 2017-02-11 16:50:48 +08:00
Nekotekina e899de88ff Log empty functions 2017-02-11 02:43:31 +03:00
Nekotekina bb111d325f memory fix 2017-02-10 23:27:58 +03:00
Zangetsu38 73906f9f29 d3d12: add x1r5g5b5_z1r5g5b5 and cleanup in D3D12Formats.
Add info in BufferUtils for log.
2017-02-10 22:04:45 +03:00
Nekotekina b20d7ff48c PPU breakpoints resurrected
Now with zero overhead
2017-02-10 16:33:22 +03:00
Nekotekina 8262d56574 PPU interpreter improved 2017-02-10 16:33:22 +03:00
Nekotekina 257b9a2015 Debugger fix
Crash fixes
GUI fixes
Debug enhancements
2017-02-10 16:33:22 +03:00
magiruuvelvet ff07595519 CMake: fix linkage on Linux, missing libdl 2017-02-10 16:24:31 +03:00
georgemoralis 6023794081 Joystick support using mmsystem library on windows (#2355)
* Joystick support using mmsystem library on windows

* fixed signed/unsigned issues with axes

* joystick buttons are now configurable
2017-02-10 15:28:00 +03:00
raven02 a1189fa37a finding from @3141card on PS3 console 2017-02-08 23:33:43 +03:00
raven02 5a2a2f49ed add missing LV2 error code 2017-02-08 23:33:43 +03:00
Ani 6c372d1781 cellL10n: Small adjustements (#2320)
l10n: Partial jstrnchk
l10n: SBCSstoUTF8s
l10n: Replace fmt::throw_exception() for cellL10n.todo() and
return ConversionOK for String methods, 0 for character methods
and the character itself for specific methods;
2017-02-08 03:25:10 +03:00
Oil 1669d0fdbd Minor changes (#2352)
* More initial values for rsx method registers

* Implemented spu decrementer event

* Remove u32 cast
2017-02-07 23:59:59 +03:00
Nekotekina 47b4c649f1 PPU fixes 2017-02-07 16:37:30 +03:00
Nekotekina ead67d8e67 Minor changes
Fix psv loader
2017-02-07 16:37:30 +03:00
☠Emulator_Team☠ 8c4ba3257c Some changes (#2350)
cellSysutilAvc2: Use UNIMPLEMENTED_FUNC macro instead of fmt::throw_exception.
2017-02-07 15:28:19 +03:00
ikki84 05c4aa5017 cellMsgDialogOpen: Go further using cellMsgDialogOpen2. (#2345)
Notes:
Needs proper implementation (!)
The functions shows similarities but the bits in argument "type" may vary a little.
Comparing both functions but testing in NPJA00014 I believe it could be acceptable until it be implemented properly

Feel free to reject if it´s not allowed

Update cellMsgDialog.cpp
2017-02-07 13:00:19 +03:00
raven02 f84b2f072f D3D12: add missing logic set 2017-02-06 12:34:20 +03:00
ikki84 9b122e5449 cellMusic.cpp Change Throw Exception into UNIMPLEMENTED_FUNC
Also return CELL_OK in function until the it become properly developed.
2017-02-05 19:39:21 +03:00
Nekotekina 246b9f3182 CHECK_EMU_STATUS removal 2017-02-05 17:35:27 +03:00
Nekotekina bf6854d121 LV2_LOCK removed 2017-02-05 16:35:10 +03:00
Nekotekina eebd48e51d cellHddGameGetSizeKB w/a 2017-02-05 16:07:26 +03:00
Nekotekina 9767cc84b0 16b atomic load fix 2017-02-05 15:49:51 +03:00
Nekotekina 11b0b6958f sys_spu diag 2017-02-05 15:48:11 +03:00
Nekotekina cb1f30e9d2 Report fixup 2017-02-05 03:06:05 +03:00
Nekotekina ec943b38a2 sys_spu... 2017-02-05 02:26:57 +03:00
Nekotekina 68f0393cf3 sys_interrupt... 2017-02-04 20:39:04 +03:00
Nekotekina fe26db4d36 idm::last_id cleanup 2017-02-04 20:39:04 +03:00
Nekotekina e3e4decabf sys_timer... 2017-02-04 20:39:04 +03:00
Nekotekina 6537909fd2 sys_event_queue... 2017-02-04 20:39:04 +03:00
Nekotekina 26ced19e18 sys_event_flag... 2017-02-04 20:39:03 +03:00
Nekotekina 3d85a89cc9 sys_lwcond, sys_lwmutex 2017-02-04 20:39:03 +03:00
Nekotekina 16944b0c4c sys_cond, sys_mutex 2017-02-04 20:39:03 +03:00
Nekotekina c4cc3ad81e sys_rwlock... 2017-02-04 20:39:03 +03:00
Nekotekina 0674a58502 idm::check extended
idm::check_unlocked
idm::find_unlocked
idm::get_unlocked
2017-02-04 20:39:03 +03:00
O1L a809f33418 GL: try to skip incorrectly prepared FBO's. 2017-02-04 19:32:54 +03:00
O1L bf33a1827c Set default values for NV4097_SET_SURFACE_FORMAT register 2017-02-04 19:32:54 +03:00
O1L 57ef6dae91 Implemented cellGcmSetDefaultCommandBufferAndSegmentWordSize 2017-02-04 19:32:54 +03:00
Yukarin 758f1bcdee Files clean up 2017-02-03 21:15:46 +03:00
Yukarin fa6fd5980e Fix rpcs3qt Linux build 2017-02-03 21:15:46 +03:00
Robbie 3762f1e50d Make RPCS3 compatible with QT5.8 (#2330) 2017-02-03 11:20:23 +03:00
ikki84 5aaee670d1 Update ErrorCodes.h (#2332) 2017-02-03 02:10:16 +03:00
Ani 9916f0e5c5 [O1L] cellVideoOut: X8B8G8R8 fix
O1L's fix for cellVideoOut.
2017-02-02 21:15:40 +03:00
gmoralis 9eba0ac58c proper error code when file not found . This should fix issue #1923 at least bomberman works 2017-02-01 14:22:30 +03:00
Zangetsu38 13493ec051 Add Patreon link on about dialog (#2310) 2017-02-01 12:37:59 +08:00
Nekotekina b7a7a5c582 #2314 fix 2017-01-31 20:37:02 +03:00
Nekotekina 213527ca71 sys_semaphore... 2017-01-31 19:36:17 +03:00
Nekotekina dc7ac22f84 sys_ppu
LV2_LOCK removal
error_code introduction
2017-01-31 18:03:09 +03:00
kd-11 16d1577722 Merge pull request #2312 from Zangetsu38/d3d12
rsx: Add support for CELL_GCM_CONTEXT_DMA_MEMORY_HOST_BUFFER
2017-01-31 17:09:46 +03:00
Zangetsu38 bd6a7dea7e rsx: Fix error context dma 2017-01-31 14:37:31 +01:00
Nekotekina 6433eebe1e IdManager fix 2017-01-31 15:57:32 +03:00
Ani 35b7cf4c98 Misc changes (#2309)
AppVeyor: Improve artifact name
Travis: Update notification email
README: Fix forum link and remove coveralls
sceNp2: Use UNIMPLEMENTED_FUNC macro instead of fmt::throw_exception
VK: Fix pathing for linux
AboutDialog: Fix forum link
2017-01-31 01:16:47 +03:00
Nekotekina c733d03525 cellVdec mem limit 2017-01-30 01:50:20 +03:00
Nekotekina aef5113d49 Fix #2300 2017-01-29 22:52:07 +03:00
Nekotekina b21fce4d6f IdManager improved
lv2_obj for kernel objects
Simple lookup (vector)
Another idm API refactoring
2017-01-29 21:37:04 +03:00
Nekotekina be8d8ded3f replace high_resolution_clock 2017-01-29 19:52:19 +03:00
Nekotekina a5a2d43d7c Thread.cpp refinement
Hide thread mutex
Safe notify() method
Other refactoring
2017-01-29 19:52:19 +03:00
Zangetsu38 da878c36bd fix osk dialog (#2302) 2017-01-29 13:21:58 +08:00
Ryan Gonzalez 11e2965b5c Switch to always using a steady clock (closes #2200) 2017-01-29 03:07:08 +03:00
Nekotekina 4203f53b67 IdManager bugfixed 2017-01-28 17:59:43 +03:00
Nekotekina d4c3905355 Debug build fix 2017-01-28 15:32:45 +03:00
Nekotekina 307da1fe39 Fixed fs::file::open 2017-01-28 13:11:06 +03:00
Nekotekina 44b2df27ea FPS counter fix 2017-01-28 03:21:11 +03:00
Nekotekina 5ee0cea672 cellAudio fix 2017-01-28 03:21:11 +03:00
Nekotekina df6607e236 Minor fixes 2017-01-28 03:21:11 +03:00
Nekotekina e32c49c12c vcxproj fix 2017-01-28 03:21:11 +03:00
Nekotekina 8693031b06 cellVdec: minor fix 2017-01-28 03:21:10 +03:00
Ryan Gonzalez b644d5b2ae Add logic_set support to VKGSRender 2017-01-28 03:20:30 +03:00
Ani 5e8852af80 sceNp: Register missing functions (#2291)
Registers missing named functions exported from sceNp on firmware 4.76
2017-01-27 20:17:34 +03:00
Zangetsu38 b6f8eface7 Register missing cellSysutil and sysPrxForUser function. 2017-01-27 17:27:22 +03:00
Cornee Traas fe23e0cc6e Un-malloc Crypto 2017-01-27 00:38:58 +03:00
Nekotekina bdca52a95d cellVdec: 2997/50 support 2017-01-26 20:01:16 +03:00
Nekotekina 33d2618e5b cellOskDialog fixes 2017-01-26 20:01:16 +03:00
Nekotekina 2bc8723824 cellVdecDecodeAu mode implemented 2017-01-26 20:01:16 +03:00
Nekotekina 4ecf05aa13 cellFsUtime implemented 2017-01-26 20:01:16 +03:00
Nekotekina 1705638e25 MFVSCR error removed 2017-01-26 20:01:16 +03:00
Nekotekina 5db0f47710 lv2_fs_object fix 2017-01-26 04:22:15 +03:00
Nekotekina ee173dc3a2 IdManager fix 2017-01-26 04:22:15 +03:00
Nekotekina 591a6c8671 IdManager improved 2017-01-25 23:29:36 +03:00
Zangetsu38 6c189511af Fix corect number branch release llvm (#2285) 2017-01-25 20:32:55 +03:00
Nekotekina a06223b844 IdManager sugar 2017-01-25 04:43:12 +03:00
Nekotekina 9232ddf0ab Minor changes 2017-01-25 04:43:12 +03:00
Nekotekina 1c14d872a8 New shared_mutex
Experimental sync utils
New semaphore<>
New cond_variable
New owned_mutex
2017-01-25 00:38:07 +03:00
Nekotekina 98fc131d47 util::dynamic_import
Futex implementation
2017-01-25 00:38:07 +03:00
Nekotekina 8ad31d2559 Test 2017-01-25 00:38:07 +03:00
Ivan 46dde3f8f7 Fixes (#2279)
Fixed appveyor icon
PPUAnalyser fix
OSK dialog fix
2017-01-24 00:56:27 +03:00
O1L 8318eed068 Seems like sfunc and zfunc comparison constants used by NV4097_SET_DEPTH_FUNC and NV4097_SET_STENCIL_FUNC 2017-01-23 23:49:17 +03:00
O1L 778199ceb1 Added missing stencil op 2017-01-23 23:49:17 +03:00
O1L 6b48a72d42 GL: fixed user clip implementation 2017-01-23 23:49:17 +03:00
O1L 07a366b608 VP decompiler: fixed condition update flags using 2017-01-23 23:49:17 +03:00
Nekotekina d07ea31400 cellOskDialog fix 2017-01-23 21:25:29 +03:00
al0xf aa357b9ae8 Add OSK GUI (#2275)
* Initial commit of OSK GUI

Also handles character encoding, you can for instance input in Chinese.

* Fixes for osk gui
2017-01-23 20:14:12 +03:00
Nekotekina 78ecb115f3 LLVM: progress dialog 2017-01-22 22:44:26 +03:00
Nekotekina 6cf006b02b Linux build fix + instructions 2017-01-22 18:50:55 +03:00
Nekotekina 7a356d3294 is_leaf_function fix (Linux) 2017-01-22 18:50:55 +03:00
Ivan fb56c14853 LLVM fix (skylake) (#2269) 2017-01-21 23:40:37 +03:00
Ivan fbf8231642 PKG Installer fix (#2268)
Fix homebrew pkg
2017-01-21 16:06:28 +03:00
Ivan f881282a8b Update README.md (#2267)
Added discord server address
Added patreon link
2017-01-21 14:57:23 +03:00
Cornee Traas 435ef04c34 Bind SET_POLYGON_STIPPLE_PATTERN (#2259)
Causes MGS4 to boot a little bit further
2017-01-20 10:48:17 +08:00
al0xf f2ba41af46 Stub cellOsk (#2264)
* Stub cellOsk

Returns the word "rpcs3" as OSK input for now. Tested and working in
Terraria, Nier, and some homebrew. The next step would be to hook it up
to the GUI so the user can enter any text.

* Fix commit

* Fix formatting

* cellOsk improvements

* cellOsk improvements
2017-01-19 01:01:25 +03:00
AnnieL b4c77afdc4 Update LLVM on Travis
Should fix the issue with Travis (No available formula with the name "llvm36"). 
We're using 3.8 so there's no reason for Travis to use 3.6.
2017-01-18 18:23:52 +03:00
AnnieL 2d9e02b0a7 Check if gcc version is below 5.1 or equal to 6.1
Outputs a fatal_error if a version of gcc below 5.1 or 6.1 is being used.
#2236
2016-12-30 14:27:38 +03:00
kd-11 9e84804eb0 Merge pull request #2237 from kd-11/gl_rsx_wip
RSX/GL: Fix common vertex program decompiler bug; fix broken dxt mipmaps on openGL
2016-12-15 20:26:13 +03:00
kd-11 fb5df32990 rsx/vs: decode sca ops after vec ops 2016-12-15 14:36:28 +03:00
kd-11 a1e725ffeb gl: Decode dxt textures to a staging buffer 2016-12-15 14:36:28 +03:00
kd-11 9cbecbd8cb Merge pull request #2234 from itmo153277/master
Allow UE3 games to startup
2016-12-15 14:34:30 +03:00
Viktor Ivanov 1a4b5413bd Log call to cellGameDataGetSizeKB 2016-12-05 21:47:23 +03:00
itmo153277 124f5d0097 Allow UE3 games to startup 2016-12-05 20:35:05 +03:00
Ivan 684089ba81 Relicense sceVideodec.h 2016-12-02 21:16:31 +03:00
Ivan b6bd02daf0 Add "License" section 2016-12-02 21:16:31 +03:00
kd-11 973bf5abdf gl: Disable overlay if required extension is not supported (#2212) 2016-10-20 11:20:45 +08:00
Yishuai Li 80a9abcfc8 fix type conflict with macOS (#2157) 2016-10-20 03:42:14 +03:00
kd-11 2c803dbe66 gl/vk: Bug fixes and improvements (#2206)
* gl: Only bind attrib textures on thread startup

* gl: Persistent mapped buffers

* gl: Fix emulated primitives in an inlined array

* gl: Do not re-update program information every draw call

* gl/vk: s1 type is signed normalized not unsigned normalized

* gl/rsx: Allow disabling of persistent buffers for debugging

gl: Large heap size is more practical

gl: Fix a bug with legacy opengl buffers

* gl/rsx: Allow emulation of unsupported attribute formats

* gl: Fix typos and remove dprints

gl: cleanup debug prints

* ui: Move the GL legacy buffer toggle to the left pane

* vk/gl: Fix cmp type, its range is [-1,1] not [0,1] SNORM_INT
2016-10-18 15:57:28 +08:00
kd-11 8454949eea gl/vk/rsx: Add a cross-platform overlay text; Minor perf improvements and rsx bugfixes (#2196)
* gl/rsx: Implement platform-agnostic text overlays

gl: Restore performance metrics using new text out helper

gl/rsx: Refactor text generation class

* vk: Enable text overlay

gl/vk: Polish overlay counters implementation

gl: Better resource shutdown for text writer

* gl: Optimization, do not rebind TIUs every frame. Speedup

* gl: Optimizations and improvements to vertex upload code

* gl/vk: Texture format swizzles

vk: Texture format fix

vk: Fix YX format swizzles

* rsx: Decode vertex texture index
2016-10-11 08:55:42 +08:00
kd-11 7a9841bb2a gl/vk/dx12: Fix depth reconstruction bug; Fix sampler parameters (#2188)
vulkan: Fix duplicated code bug

fix rebase
2016-10-04 21:51:40 +08:00
Melissa Goad 22b1400018 Revamp PFIFO command submission emulation (#2179) 2016-10-01 22:13:15 +03:00
raven02 44b8556dc6 Vulkan: fix G8B8 texture swizzle (#2181) 2016-10-01 17:02:10 +08:00
Ivan a342107021 Paypal link removed 2016-10-01 01:21:43 +03:00
kd-11 1c9718389f gl/vk: Vertex attribute uploading and texture swizzle fixes (#2174)
* gl/vk: Properly upload vertex attributes

* vk: Fix cmp type

* vk: Remap all texture formats
2016-09-29 15:16:00 +08:00
kd-11 5430e1d310 rsx/gl/vk/dx12: Add emulated texture fetch for depth read (#2173)
* rsx/gl/vk/dx12: Add emulated texture fetch for depth read

gl/vk/dx12: Simplify reinterpretation equation

* gl: Remove unnecessary re-swizzle

* glsl: explicitly cast uint to float
2016-09-29 14:54:32 +08:00
kd-11 9abb908226 vk: Add a subpass dependancy (#2172) 2016-09-28 22:12:52 +08:00
kd-11 38562155d4 gl/vk: Flip wpos if origin != top 2016-09-28 07:22:45 +08:00
kd-11 4f74cbe510 gl: Reverse cull face when origin == top (#2161) 2016-09-27 15:34:01 +08:00
raven02 528b2d6c7b GL/Vulkan: not discard fragment when hits NEVER comparsion (#2156)
GL/Vulkan: return no operation when comparison is never
2016-09-26 21:59:38 +08:00
kd-11 7884356e90 gl/vk: Bug fixes and improvements (#2155)
* gl: Fix broken buffer reserve computation

* gl: Texture format fixes

* gl: Two sided lighting

* gl: Always update glsl output registers

* gl: Simplify vertex input declaration

* vk: Always write output registers

* vk/gl: swizzle component read on depth textures

* gl/vk: Use proper MVP matrix

gl: fix broken mvp when window_origin=top

* vk/gl: Move fragment operations block into the proxy function
2016-09-26 20:21:17 +08:00
raven02 38f35df7b6 DX12: enable alpha kill (#2158) 2016-09-26 18:38:52 +08:00
raven02 fcb853792d Typo fix (#2153) 2016-09-25 16:53:57 +08:00
Oil b72f6da853 Porting of DH's user clip implementation in gl (#2139)
* Porting of DH's user clip implementation in gl

* Tweak clang-format

* rsx: Move inline array to draw_clause structure.

* rsx: Use variant based draw commands.

* rsx: Dump DRAW_ARRAYS and DRAW_INDEX_ARRAYS.

* GL: old recompiler clean up (#2142)

* RSX texture refactor (#2144)

* gl/vk: Enable vertex texture fetch (#2127)

* gl: Enable vertex textures

* rsx: use textureLod instead of generic texture sample

* rsx: handle uploading of W32_X32_Y32_Z32

* gl: Re-enable proper shader logging

remove old logging method that overwrites single file

* gl: Declare texture_coord_scale for vertex samplers

* gl: texture remap fixes; enable remap for vertex textures

* gl: offset texture indices to base layer 16

* rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout

* vk: Enable vertex textures

* rsx: define special calls for vertex texture fetch

* gl: improved vertex texture fetch setup

* vk: Fix texture formats and component mapping

* vk: Implement vertex texture fetch functions properly

* vk/gl: proper fix for primitive restart index

revert inadvertent decompiler update

* gl: Disable filtering for vertex textures

* Hopefully fix appveyor build (#2148)

* GL/Vulkan: Bug fixes and improvements; alphakill for vulkan (#2146)

* vk: Zero-initialize some more structs

* gl: Clean up fragment program generation code

* vk: Enable alpha kill

* vk: Fix surface clear; redirect output for surface_type:b

* vk: Tie renderpass to program object to avoid incompatible passes

* vk: Properly compute descriptor pool size (#2150)

* rsx: Set default attribute format to float.

* rsx: vertex attribute size is 1 again for CMP, let backend handles this formats properties.

* rsx: Move printing function in a separate header/cpp

* Porting of DH's user clip implementation in gl
2016-09-24 18:21:41 +08:00
vlj 623ddd966c Merge pull request #2140 from vlj/rsx-refactor
Rsx refactor
2016-09-22 16:25:33 +02:00
vlj 9ff52cf063 rsx: Move printing function in a separate header/cpp 2016-09-22 15:44:59 +02:00
vlj 8f5e94c155 rsx: Set default attribute format to float. 2016-09-22 15:44:59 +02:00
vlj 6b7ce37374 rsx: vertex attribute size is 1 again for CMP, let backend handles this formats properties. 2016-09-22 15:44:59 +02:00
kd-11 66e57ae19b vk: Properly compute descriptor pool size (#2150) 2016-09-22 16:06:57 +08:00
kd-11 0d207a6c0d GL/Vulkan: Bug fixes and improvements; alphakill for vulkan (#2146)
* vk: Zero-initialize some more structs

* gl: Clean up fragment program generation code

* vk: Enable alpha kill

* vk: Fix surface clear; redirect output for surface_type:b

* vk: Tie renderpass to program object to avoid incompatible passes
2016-09-21 21:41:29 +08:00
Danila Malyutin 0b080aeefc Hopefully fix appveyor build (#2148) 2016-09-21 17:34:38 +08:00
kd-11 867e9210d7 gl/vk: Enable vertex texture fetch (#2127)
* gl: Enable vertex textures

* rsx: use textureLod instead of generic texture sample

* rsx: handle uploading of W32_X32_Y32_Z32

* gl: Re-enable proper shader logging

remove old logging method that overwrites single file

* gl: Declare texture_coord_scale for vertex samplers

* gl: texture remap fixes; enable remap for vertex textures

* gl: offset texture indices to base layer 16

* rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout

* vk: Enable vertex textures

* rsx: define special calls for vertex texture fetch

* gl: improved vertex texture fetch setup

* vk: Fix texture formats and component mapping

* vk: Implement vertex texture fetch functions properly

* vk/gl: proper fix for primitive restart index

revert inadvertent decompiler update

* gl: Disable filtering for vertex textures
2016-09-20 22:23:56 +08:00
raven02 77f8ce503d RSX texture refactor (#2144) 2016-09-19 09:25:49 +08:00
raven02 530ea688e4 GL: old recompiler clean up (#2142) 2016-09-18 13:19:26 +08:00
vlj 11a442272d Merge pull request #2112 from vlj/rsx-refactor
Rsx refactor: Use variant for draw commands.
2016-09-17 23:53:59 +02:00
vlj f87e396958 rsx: Dump DRAW_ARRAYS and DRAW_INDEX_ARRAYS. 2016-09-17 23:37:52 +02:00
vlj 8d54bcbc0d rsx: Use variant based draw commands. 2016-09-17 23:37:52 +02:00
vlj 03c86ae43b rsx: Move inline array to draw_clause structure. 2016-09-17 23:37:52 +02:00
vlj ce21db2ce3 Tweak clang-format 2016-09-17 23:37:52 +02:00
Oil 153a2d2b40 Fixed fog and alphakill implementation in glsl (based on DH's old commits) (#2137)
* Fixed NV4097_SET_COLOR_CLEAR_VALUE

* Fixed fog and alphakill implementation in glsl (based on DH's old commits)
2016-09-14 22:47:53 +08:00
Oil e73fce2d60 Fixed NV4097_SET_COLOR_CLEAR_VALUE (#2135) 2016-09-13 02:28:34 +03:00
vlj d43edb19d2 Merge pull request #2134 from vlj/dx12-fix
Dx12 fixes
2016-09-12 20:38:56 +02:00
vlj 14205d3d1c d3d12: CMP vertex format has 4 members.
Fix 1878
2016-09-12 00:20:11 +02:00
vlj 30b804e0bc d3d12: Fix a potential race condition. 2016-09-12 00:20:10 +02:00
vlj 153f1cc50a d3d12: Always set transform constant when debug output is enabled. 2016-09-12 00:20:10 +02:00
raven02 fc3179b698 DX12: temporary disable vertex base index check (#2128) 2016-09-07 09:26:01 +08:00
raven02 d4a55f4b06 Vulkan: enable cull face again (#2124)
* Vulkan: enable cull face again

* minor fix
2016-09-06 09:43:27 +08:00
raven02 03a5b5be1a DX12: Align to multiple of 4 block for DXTC format (#2125) 2016-09-05 08:47:45 +08:00
raven02 ad39615141 Revert "RSX: fix unknown vertex base type" (#2122) 2016-09-04 18:29:21 +08:00
raven02 691d87978b RSX: fix wrong format 0x9b (#2121) 2016-09-04 15:23:43 +08:00
raven02 ebf54d6acd RSX: fix unknown vertex base type (#2120) 2016-09-04 14:36:37 +08:00
Nekotekina 5f15c661c6 .clang-format restored 2016-08-28 12:35:56 +03:00
vlj c0ab0dee6b Merge pull request #2101 from vlj/rsx-refactor
Rsx refactor: Some cleanups
2016-08-27 18:21:16 +02:00
vlj 73e50b970d Remove settings UI change that accidently slipped in. 2016-08-27 15:40:41 +02:00
vlj 11858dce1a rsx: Vertex array attributes don't need to be stored outside of regs. 2016-08-27 15:40:41 +02:00
vlj a64053fd68 rsx: Remove some unused code. 2016-08-27 15:40:41 +02:00
vlj 1ede5cbc4c Add a git pre-commit hook running clang-format 2016-08-27 15:40:41 +02:00
raven02 bb66b97251 GL: minor fixes (#2105)
* Minor fixes

* temporary disable 2-sided lighting

* Disable user clip planes until they are properly handled
2016-08-27 14:12:44 +08:00
raven02 6e07e07cd0 GL: enable 2-sided lighting (#2103) 2016-08-27 00:26:23 +08:00
raven02 a270ac7f02 GL: re-use common fp/vp decompiler (#2100) 2016-08-26 22:23:23 +08:00
vlj 7f3cb4d3c9 Merge pull request #2084 from vlj/rsx-refactor
RSX: Puts vertex buffer in array and in register in a variant type.
2016-08-25 21:14:51 +02:00
Vincent Lejeune 42b518cf7e rsx: use range for vertex buffer attribute. 2016-08-24 21:58:59 +02:00
Vincent Lejeune c24fba89e8 Add variant.hpp from mapbox 2016-08-24 21:58:59 +02:00
raven02 5b225ad59f GL: ignore texture upload if invalid dimension found (#2097) 2016-08-24 21:19:16 +08:00
kd-11 8ebe9d7dc2 gl: Dont use hard assertions on error, driver reporting is so much better (#2094) 2016-08-24 17:31:27 +08:00
kd-11 9beb2d8ae0 vk/rsx: Bug fixes (#2092)
* vk: fix separate front and back lighting

* vk: Inlined arrays can have emulated primitives too!

* vk: Use float input attribs for better compatibility

* vk: Free resources during shutdown
2016-08-24 08:50:07 +08:00
raven02 12099b3144 RSX: fix invalid format (0x1) (#2088) 2016-08-24 02:08:05 +08:00
raven02 2aa2c1811f Vulkan : add structure type for color blend state (#2091) 2016-08-23 19:07:51 +08:00
raven02 af1ff4439d RSX: fix wrong format 0x9c (#2087) 2016-08-23 16:18:58 +08:00
raven02 51bdf1e3ed DX12: fix invalid dimension (#2086)
DX12: workaround invalid texture dimension
2016-08-23 11:06:01 +08:00
raven02 d7a899f984 Vulkan : refine 2-sided lighting approach (#2083) 2016-08-23 08:24:22 +08:00
raven02 707523c679 Vulkan: set ColorBlendState info (used by logicOp) (#2080)
* Vulkan: set ColorBlendState info (used by logicOp)

* fix attachmentCount
2016-08-22 23:14:32 +08:00
raven02 e04de77f82 Vulkan : Ignore clear if surface target is set to CELL_GCM_SURFACE_TARGET_NONE (#2081) 2016-08-21 18:18:26 +08:00
raven02 be9cebbc8f Workaround id_min/max (#2079) 2016-08-20 21:27:50 +08:00
Nekotekina e3bc2273d3 fs::dir improved
FindFirstFileExW used
Immediate directory read
2016-08-18 15:14:08 +03:00
Nekotekina c20756136a Minor diagnostic added 2016-08-18 13:29:53 +03:00
Nekotekina 066e3006bf cellGameCreateGameData fixed
cellGameDataCheck fixed
PARAM.SFO creation fixed
2016-08-17 21:59:42 +03:00
Nekotekina bbb0effe23 Minor fixes
cellSyncMutexTryLock fixed
2016-08-17 19:50:20 +03:00
Nekotekina ad174eb12c error_code implemented
Reports based on formatting system
ppu_error_code removed
arm_error_code removed
2016-08-16 18:57:44 +03:00
Nekotekina 1c33c012ad ERROR_CODE macro removed 2016-08-15 19:18:05 +03:00
Nekotekina 3c82e1a58d Silly macro removed-3 2016-08-15 18:30:33 +03:00
Nekotekina dbcb5df172 WRAP_EXPR macro removed 2016-08-15 17:11:45 +03:00
Nekotekina dafb6b5c92 %p fmt fix 2016-08-15 16:57:51 +03:00
Nekotekina 84d0d396ed EXPECTS usage removed 2016-08-15 16:29:38 +03:00
Nekotekina 56b9b38c9c verify() fix 2016-08-15 14:59:19 +03:00
Nekotekina 05fb57baff VERIFY macro removed 2016-08-15 03:13:31 +03:00
Nekotekina cc46f2d7e6 LOG macro improved 2016-08-15 00:04:42 +03:00
Nekotekina 1f3433464c ENSURES usage removed 2016-08-14 22:41:01 +03:00
Nekotekina b0f5796c90 New narrow() implementation 2016-08-14 20:28:56 +03:00
Nekotekina 0f87c4485d Silly macro removed-2 2016-08-14 18:19:42 +03:00
Nekotekina 5e0489dcc0 cpu_init removed 2016-08-14 18:07:34 +03:00
Nekotekina 949200cd3e Type hacks removed 2016-08-14 18:07:32 +03:00
Nekotekina 2d512121f1 XAudio2.8+ fix 2016-08-12 23:45:02 +03:00
Nekotekina 7a2802a5e0 Silly macro removed 2016-08-12 19:31:28 +03:00
Nekotekina f0459e3891 .editorconfig added 2016-08-12 17:13:25 +03:00
Nekotekina 1fd8c50d95 .clang-format added 2016-08-12 14:32:57 +03:00
vlj 65fe9b0927 Merge pull request #2037 from vlj/rsx-refactor
Rsx: Remove vertex_draw_count (WIP)
2016-08-11 20:20:07 +02:00
Vincent Lejeune 619d605a9e rsx: remove vertex_draw_count 2016-08-11 19:47:14 +02:00
Vincent Lejeune b8721b6475 gl: Refactor vertex_buffer.cpp 2016-08-11 19:47:14 +02:00
Vincent Lejeune a94b9d38b0 vk: refactor VKVertexBuffers. 2016-08-11 19:47:14 +02:00
Vincent Lejeune c382ce5260 Add optional files. 2016-08-11 19:47:14 +02:00
Nekotekina fc56e70172 vm::ptr<char> formatting 2016-08-11 16:47:20 +03:00
Nekotekina 8c8242345e bts/btr/btc support improved 2016-08-10 16:12:34 +03:00
Nekotekina 130f7905ba Error report fix 2016-08-10 14:17:07 +03:00
Nekotekina 912072e60c LLVM: minor fixes (JIT.cpp) 2016-08-10 13:09:11 +03:00
Nekotekina bdeccd889f cpu_type removed, system_type added
cpu_state -> cpu_flag
vm::stack_allocator template improved
ppu_cmd type changed to enum, cmd64 type added
2016-08-09 17:14:41 +03:00
raven02 009ac37a7d XAudio : reorder versioning 2.9>2.7>2.8 (#2048) 2016-08-09 15:55:11 +08:00
kd-11 44ae306e6b vk: delay texture removal when cache is clobbered (#2045) 2016-08-09 08:47:42 +08:00
Nekotekina a7e808b35b EXCEPTION macro removed
fmt::throw_exception<> implemented
::narrow improved
Minor fixes
2016-08-08 19:19:32 +03:00
Nekotekina 46735d6b3d New bitsets (experimental) 2016-08-08 16:29:37 +03:00
Nekotekina 71441819e5 multicast<> rewritten 2016-08-07 17:06:37 +03:00
Nekotekina 1a7ea2d235 fmt_unveil<> fix 2016-08-07 17:05:35 +03:00
Nekotekina 4438163da1 Gui log bugfix 2016-08-07 14:39:29 +03:00
Nekotekina b7eda71673 XAudio2.7 bug workaround 2016-08-06 18:19:38 +03:00
Nekotekina 0fcbd43db9 Specify XAudio sample rate and ch num 2016-08-06 16:21:29 +03:00
Nekotekina 4de513eb01 Increase XAudio thread priority 2016-08-06 15:40:51 +03:00
Nekotekina 9245308ff2 Improve fatal error report 2016-08-06 15:09:44 +03:00
Nekotekina 7be259217a Error loading image fix 2016-08-06 13:39:05 +03:00
Nekotekina c9a789bf76 PPU LLVM fix 2016-08-06 13:39:03 +03:00
Nekotekina 3cd2f735a7 Fmt fix 2016-08-06 13:39:01 +03:00
vlj b61ac15c47 Merge pull request #2034 from vlj/rsx-refactor
rsx: Returns u32 instead of size_t for get_index_count/type_size
2016-08-06 00:51:23 +02:00
Vincent Lejeune fb47945930 rsx: Returns u32 instead of size_t for get_index_count/type_size 2016-08-06 00:25:23 +02:00
vlj 247c776a1b Merge pull request #2033 from vlj/rsx-refactor
rsx: Use a "draw clause" object in rsx_state.
2016-08-05 23:48:48 +02:00
Vincent Lejeune eb1d4811de rsx: Use a "draw clause" object in rsx_state. 2016-08-05 23:33:40 +02:00
Nekotekina d646fbb94f Fmt/Log fixes 2016-08-05 20:59:25 +03:00
vlj 98f09e4f27 Merge pull request #2021 from vlj/rsx-refactor
rsx: Move index pointer generation in rsx::thread
2016-08-05 18:08:03 +02:00
Vincent Lejeune 7a6f5b6ee5 rsx: Move index pointer generation in rsx::thread. 2016-08-05 17:54:44 +02:00
raven02 8ff155a2c9 Regression fix #2029 (#2030) 2016-08-05 14:38:58 +08:00
Nekotekina f7dcaa4a68 cellSysutilCheckCallback fix 2016-08-04 22:36:41 +03:00
DHrpcs3 dcd2bbaa3d Added DHrpcs3 to mention-bot ignore list (#2026) 2016-08-04 22:36:10 +03:00
Nekotekina 5a36c57c57 Formatting system improved
`unveil<>` renamed to `fmt_unveil<>`, now packs args to u64 imitating va_args
`bijective...` removed, `cfg::enum_entry` now uses formatting system
`fmt_class_string<>` added, providing type-specific "%s" handler function
Added `fmt::append`, removed `fmt::narrow` (too obscure)
Utilities/cfmt.h: C-style format template function (WIP)
Minor formatting fixes and cleanup
2016-08-04 21:34:00 +03:00
vlj 662fce38bd Merge pull request #2023 from raven02/texture
Ignore texture upload if texture width > pitch
2016-08-04 17:39:27 +02:00
raven02 4dd67cdd54 texture: ignore when texture width > pitch 2016-08-04 17:54:34 +08:00
kd-11 47a9c8d731 vk/gl: bug fixes (#2018)
* vk: use null sampler for invalid/broken texture configurations

* gl: Do not consider 32_BIT_EXPORTS flag for depth writes
2016-08-04 03:33:52 +08:00
raven02 9a081369c8 update submodule rsx_program_decompiler (#2020) 2016-08-03 09:45:10 +08:00
raven02 208f4c3e27 vk: front_diff_color typo fix (#2016)
* vk: typo fix

* continue in for loop
2016-08-02 23:54:49 +08:00
raven02 c618e02695 update submodule rsx_program_decompiler (#2015) 2016-08-02 10:45:08 +08:00
raven02 61c6f82f74 Regression fix #1995 (#2014) 2016-08-01 19:47:14 +08:00
Nekotekina e6bd91ada0 id_manager: embedded RTTI 2016-08-01 12:51:47 +03:00
Nekotekina e585939ac2 id_manager::id_key implemented 2016-08-01 01:35:53 +03:00
Nekotekina 3576e13e9a emucore.vcxproj fix 2016-08-01 01:35:37 +03:00
vlj 470ed777c2 Merge pull request #2011 from vlj/rsx-dbg2
rsx-debug: Add a separate qt app
2016-07-31 22:44:03 +02:00
Vincent Lejeune 7195b2e907 rsx-debug: Add a separate qt app 2016-07-31 22:27:00 +02:00
vlj 32a03344b3 Merge pull request #2010 from vlj/rsx-refactor
rsx: Fix warning because of unused arguments
2016-07-31 19:32:30 +02:00
Vincent Lejeune 9e7902455d rsx: Fix warning because of unused arguments 2016-07-31 19:19:21 +02:00
Nekotekina 68cf570b58 Implemented rsx::invalid_method 2016-07-31 18:16:51 +03:00
Nekotekina 1c69eb2b73 rsx_method_t extended
rsx_methods.cpp cleanup
2016-07-31 18:16:49 +03:00
Nekotekina 6a9f3040e1 rsx_methods.cpp fix 2016-07-31 18:16:48 +03:00
vlj 190fc4301e Merge pull request #2008 from vlj/rsx-refactor
Rsx: Inline some rsx_state member and split some headers.
2016-07-31 17:16:04 +02:00
Vincent Lejeune 22a89a272e Move all gcm enums into separate header/cpp. 2016-07-31 17:04:30 +02:00
Vincent Lejeune 4c46bde315 rsx: Inline rsx_state and texture constructors. 2016-07-31 16:48:09 +02:00
Nekotekina 0578430fd0 XAudio2 version priority 2016-07-30 20:25:46 +03:00
vlj 33e13aa7e7 Merge pull request #1994 from vlj/rsx-refactor
Rsx refactor: Implement serialisation of debug data
2016-07-30 18:52:39 +02:00
Vincent Lejeune b9f4c15ec0 vm: Add missing headers.
vm.h relies on memory (std::shared_ptr) and functionnal (std::function).
2016-07-30 18:39:26 +02:00
Vincent Lejeune 15500d4ee9 rsx: implement serialization of rsx states. 2016-07-30 18:39:26 +02:00
Vincent Lejeune 2528fc4555 Add cereal dependency 2016-07-30 18:39:26 +02:00
Nekotekina f8719c1230 PPUThread refactoring
`CallbackManager` removed, added _gcm_intr_thread for cellGcmSys
`PPUThread` renamed to `ppu_thread`, inheritance allowed
Added lightweight command queue for `ppu_thread`
Implemented call stack dump for PPU
`get_current_thread_mutex` removed
`thread_ctrl::spawn`: minor initialization fix
`thread_ctrl::wait_for` added
`named_thread`: some methods added
`cpu_thread::run` added
Some bugs fixes, including SPU channels
2016-07-30 16:35:02 +03:00
kd-11 33c59fa51b vk: optionally center/offset images when scaling (#1998) 2016-07-30 10:07:39 +08:00
vlj 2b6f8a075e Merge pull request #1993 from vlj/rsx-refactor
rsx: Copy state in capture frame call
2016-07-27 22:54:16 +02:00
Vincent Lejeune ac771f951d rsx: Copy state in capture frame call 2016-07-27 20:20:35 +02:00
vlj e297984e59 Merge pull request #1982 from vlj/rsx-refactor
rsx: Use bitfield template to decode values.
2016-07-27 19:12:59 +02:00
Vincent Lejeune 8b12379eb3 rsx: Use bitfield template to decode values. 2016-07-27 18:38:36 +02:00
jypem 2064f1cb80 Handle error when loading game icon (#1687) 2016-07-26 14:39:12 +03:00
Lena e377199e41 Ensure the 'shaderlog' directory exists (#1986)
Should fix #1984
2016-07-26 00:15:14 +03:00
Nekotekina a8f977ed9e XAudio 2.8 test fix 2016-07-25 19:30:21 +03:00
Nekotekina 44bee7d0ba LLVM: Use small code model
Global variables modified:
__mptr: pointer to memory base addr
__cptr: pointer to function map addr

Use 32 bit pointers in function map
2016-07-25 18:26:02 +03:00
Benjamin Hodgetts c100328a6f Clarify working GCC versions (#1851)
GCC 6.1 cannot compile RPCS3 due to a regression within GCC itself, so note that here as it's the current version that a lot of people are likely to be using, with a link to the bug that contains further information.
2016-07-25 17:48:25 +03:00
raven02 1672c93a2d Revert "Audio : allow XAudio2 to run its own thread" (#1988) 2016-07-25 09:09:14 +08:00
raven02 2a3029a62c PPU: register undocumented functions in cellSysmodule (#1987) 2016-07-25 08:43:02 +08:00
raven02 53b2e19d96 Audio : allow XAudio2 to run its own thread (#1980) 2016-07-25 08:25:02 +08:00
Danila Malyutin 132093c80e update rsx_program_decompiler submodule (#1983) 2016-07-25 07:39:09 +08:00
Nekotekina 5c9f83c3a8 PPU LLVM: New "stack" strategy
Minor pessimization: all memory accesses are volatile
Special handling of prologues and epilogues
Minor optimizing assumption for SP
2016-07-24 21:47:45 +03:00
Nekotekina 712c04b2ad PPU Analyser update
WIP, nothing changed
2016-07-24 21:06:10 +03:00
Nekotekina 39dadad534 PPU executable memory protection
Experimental commit, not improved for PRX
Also fixed minor bug in PRX loader
2016-07-24 21:06:09 +03:00
Nekotekina a026d35c97 sys_interrupt_thread_eoi fixed
thread_ctrl::interrupt improved
BIND_FUNC improved: preparations
2016-07-24 21:06:07 +03:00
Nekotekina 7ccdea7822 Removed std::enable_shared_from_this
Minor ID manager refactoring
2016-07-24 21:06:05 +03:00
kd-11 09ae45c566 vk: Conform to current spec (#1981)
* vk: define rtt images with transfer_dst set

* vk: Bind a buffer view for attribs with undefined data

* vk: Properly define renderpass clip region to fit the framebuffer

* vk: respect type bits from returned memory requirements
2016-07-25 00:28:49 +08:00
Nekotekina deeb4acbe5 Partial revert of 6ae54ae27b 2016-07-22 19:26:58 +03:00
Nekotekina 5eb98b745f cellVdec fixed (requires LLE dmux)
Basic MPEG2 support
2016-07-22 18:29:05 +03:00
kd-11 74fec275c7 gl: Clear depth surfaces before use; Vulkan cleanup (#1957)
* vk: Clean up a few trap messages

vk: silence a few compile errors

* gl: Clear new depth surfaces to max_depth

gl: use glClear to clear depth buffers
2016-07-22 07:31:58 +08:00
Nekotekina a0c0df6e9d Dynamic XAudio version detection 2016-07-21 17:46:46 +03:00
raven02 0ae8cc4467 D3D12: revert heap size back to 896M (#1960)
* D3D12: revert heap size back to 896M

* Update D3D12GSRender.h
2016-07-21 14:50:06 +08:00
raven02 f36f478281 vk: refactor compare_op (#1959) 2016-07-21 13:35:06 +08:00
Nekotekina 0227c03366 GUI logging improved
logs::listener resurrected
rpcs3 version: constexpr
2016-07-21 01:54:39 +03:00
raven02 8157e7cac8 Obsolete 3D monitor (#1955) 2016-07-20 23:45:26 +08:00
Nekotekina ae634bb87e RSX exception fix
VBlank thread management fix
2016-07-20 15:16:19 +03:00
vlj 2af86e363c Merge pull request #1941 from vlj/rsx-refactor
rsx: Use register_decoder for vertex attributes.
2016-07-19 22:12:20 +02:00
Vincent Lejeune e9bee80f4b rsx: Use register_decoder for vertex attributes. 2016-07-19 20:28:32 +02:00
vlj cc30e1aa47 Merge pull request #1940 from kd-11/master
dx12: Constant color/alpha blending
2016-07-19 20:27:55 +02:00
kd-11 854bc1db60 dx12: simplify constant color blend equation/algorithm checks 2016-07-19 19:20:57 +03:00
kd-11 d3837de571 dx12: Constant color/alpha blending 2016-07-19 19:20:57 +03:00
raven02 e1ff3f4674 rsx: use fragment_textures_count (#1948)
* rsx:  use fragment_textures_count

* Typo: unknow -> unknown
2016-07-19 22:50:40 +08:00
Nekotekina ceb4cb59ac Typo fix: comparaison->comparison 2016-07-19 14:17:25 +03:00
Nekotekina fc9fdca3f6 Make TLS great again
And clean System.h a bit
2016-07-19 14:06:39 +03:00
raven02 6296453ef3 D3D12: inline stencil test as GL and Vulkan backend (#1945) 2016-07-19 16:52:14 +08:00
Nekotekina 04926374f7 PKG installer fix 2016-07-18 21:28:58 +03:00
Nekotekina a186af32ec Fixed thread interrupt and accvio 2016-07-18 17:54:31 +03:00
raven02 7ac9d3b679 D3D12/Vulkan : swizzle texture format G8B8 (#1931)
* D3D12: swizzle texture format G8B8

* Vulkan: swizzle texture format G8B8
2016-07-18 20:16:11 +08:00
kd-11 2e5b01faca vk: Fix vertex winding (#1934)
* vk: do not flip face winding based on shader origin

* vk: disable face culling
2016-07-17 22:55:59 +03:00
kd-11 2337bf204c vk/dx12: Enable/fix separate back and front lighting (#1927)
* vk: separate specular color

rsx: separate front color output from back color output

re-enable front-back diffuse lighting

vk: fix front face selection and actually enable face culling

* dx12: Hide constant-key blended visuals (by common use of factor, 1-factor)

* dx12: Fix 2 sided lighting when the shader does not compute both outputs

* vk/dx12: confirm that src register exists before copying for 2-sided lighting
2016-07-18 00:57:50 +08:00
vlj b2a7dac11b Merge pull request #1916 from vlj/rsx-refactor
rsx: Gather most rsx commands pretty printing and state modification …
2016-07-17 17:56:36 +02:00
Vincent Lejeune c6ed5a8e6b gl: Fix direct call to rsx::method_registers array. 2016-07-17 17:31:53 +02:00
Vincent Lejeune d97cdb9fbf rsx: Gather most rsx commands pretty printing and state modification function in a single file.
rsx_decode.h implements a "rsx_decoders" template class that is specialized for most GCM command
found in rsx command buffer. 3 static members are defined : a "decode" function that turns command
value into a more meaninfull type if applicable (for instance bool for _enabled* command, surface
formats for set_surface_format command...), a "commit_rsx_state" that modifies a given rsx_state
structure when the command is parsed, and a "dump" function used in rsx_debugger for pretty printing.
Hopefully having the 3 functions in a single place for every command will act as a self documenting
list of rsx command buffer opcode.

rsx_state is also expanded into several explicit variables instead of being stored into a u32 array.
This should makes debugging easier (Visual Studio will display the exact value of these member for instance)
as well as preparing rsx_state for serialisation/deserialisation.

The vertex array and textures opcode are not concerned atm for bisecting purpose.
2016-07-17 17:31:53 +02:00
Nekotekina 692d9dd4ae NV0039_OFFSET_IN fix 2016-07-17 15:03:13 +03:00
Ivan 260865de6d Merge pull request #1925 from Nekotekina/master
Commit collection
2016-07-17 03:44:28 +03:00
Nekotekina 438e057dc8 Partial commit: sys_fs 2016-07-17 02:27:52 +03:00
Nekotekina 59433bfcd5 Implemented thread_ctrl::interrupt 2016-07-17 02:23:45 +03:00
Nekotekina 96728a83f6 Partial commit: sys_memory, sys_mmapper 2016-07-16 14:46:01 +03:00
Nekotekina f5e65e4ad9 Partial commit: sys_tty 2016-07-16 14:45:59 +03:00
Nekotekina c95f6c8c56 Partial commit: sys_vm 2016-07-16 14:45:58 +03:00
Nekotekina 73c2115968 BEType: explicit alignment specifier 2016-07-16 14:45:57 +03:00
Ivan 5d6aecc599 Update donation link 2016-07-16 02:20:58 +03:00
raven02 2085d318bb rsx: typo fix (#1921) 2016-07-15 20:19:15 +03:00
Nekotekina c77dec6d6a PPU Analyser improved
Fix for old homebrews
2016-07-15 13:42:22 +03:00
AnnieL dc34d5b350 cell: add several error (return) codes and definitions (#1914)
* cellHttp: add error codes

Adds error codes for cellHttp and cellHttps

* libDaisy: adds error codes and definitions

Adds error codes, assertations and definitions for cellDaisy.

* cellHttpUtil: add error codes

Adds error codes for cellHttpUtil.

* cellCelp8Enc: moves error codes, adds definitions

Moves error codes to cellCelp8Enc.h, adds some definitions.

* cellCelpEnc: moves error codes, adds definitions

* cellJpgEnc: adds error codes and definitions

Moves the existant error codes to cellJpgEnc.h and adds more error codes
/ definitions.

* cellVoice: moves error codes, adds definitions

Moves error codes to cellVoice.h, adds most cellVoice definitions

* Fix typos
2016-07-15 00:02:07 +03:00
AnnieL ca835ba68a cellGame: unknown category temporary fix (hack) (#1909)
All the games I've been trying to load from outside RPCS3's bin directory are returning me empty directories
```
{PPU[0x3] Thread (main_thread) [0x011223d8]} class fmt::exception thrown: cellGameBootCheck(): Unknown CATEGORY: 
```

This is a hack for when the category is empty or unknown. 
We assume it's a disk game and proceed with the emulation.
2016-07-14 23:12:26 +03:00
kd-11 ce56351554 gl: Fix fragment constants streaming (#1907) 2016-07-15 02:25:38 +08:00
raven02 d60b292ef1 Modules: savedata fix (#1910) 2016-07-15 00:28:26 +08:00
Nekotekina eb377f425c PPU LLVM: Analyser fix
ppu_branch_target removed
2016-07-14 16:27:14 +03:00
Ivan 4c4e4fc772 Merge pull request #1902 from kd-11/master
gl: bug fixes
2016-07-14 00:01:22 +03:00
kd-11 6401eefb26 gl: reset texture scaling factor during bind
reset vertex textures as well
2016-07-13 21:01:16 +03:00
kd-11 ea6f3ff5ed gl: Properly determine front face winding 2016-07-13 21:01:16 +03:00
kd-11 97581d8635 gl: Fix primitive type checks 2016-07-13 21:01:16 +03:00
Nekotekina 6bac4a535b Vulkan: glslang workaround 2016-07-13 18:10:35 +03:00
Nekotekina 0a5b518aea PPU Analyser fix 2016-07-13 02:54:34 +03:00
Nekotekina 94da0dbd4d PPU LLVM improvements
Removed interpreter dependencies
Reciprocal instructions improved
2016-07-12 17:33:13 +03:00
raven02 87e38118a5 Ignore clear if surface target is set to CELL_GCM_SURFACE_TARGET_NONE (#1898) 2016-07-12 21:52:11 +08:00
Nekotekina ba8fd825ec fs::get_data_dir implemented 2016-07-11 22:12:39 +03:00
kd-11 2c981cf940 rsx: mark register access with divider op enabled and frequency 1 (#1892) 2016-07-12 02:53:52 +08:00
Nekotekina 11f7b167ae Update Vulkan submodules
Temporarily disabled Vulkan build for Linux
2016-07-11 19:27:50 +03:00
Nekotekina 06c6c8212d Minor fixes
elf_object
Loader fix
Analyser fix
2016-07-11 16:30:11 +03:00
raven02 b89961f01d rsx: set frame limiter before rsx->flip() (#1885) 2016-07-11 21:00:04 +08:00
kd-11 59df7e7104 glsl: not all shaders write to col0 (#1884)
fix typo
2016-07-11 09:05:13 +08:00
kd-11 bbf7e6332c glsl; dump shaderlog (#1883)
fix typo
2016-07-11 01:16:31 +08:00
Lena 8c3b3f7ab4 CMake: improve compiler checks (#1847)
Moves the compiler check out of rpcs3/CMakeLists.txt and adds them
into rpcs3/cmake_modules/ConfigureCompiler.cmake
Add better compiler checks and eliminate a TODO
2016-07-10 16:15:56 +08:00
raven02 47987efb75 rsx: add default case for to_front_face() (#1879) 2016-07-10 08:33:20 +08:00
raven02 ed8ebda804 vk: add missing compare func not_equal (#1876) 2016-07-10 04:32:09 +08:00
raven02 d4da0e052d sys_net: add few socket options (#1874) 2016-07-10 02:30:56 +08:00
kd-11 6705a6ecc9 rsx: properly check for inlined array before discarding draw (#1877) 2016-07-09 22:54:44 +08:00
raven02 dfa968863a DX12: get_scissor() fix (#1868) 2016-07-09 01:00:15 +08:00
raven02 70885ada67 RSX: throw exception removal for user_command() (#1872) 2016-07-09 00:22:10 +08:00
vlj 71b21fe793 Merge pull request #1869 from raven02/vertex
RSX: check vertex_draw_count
2016-07-08 15:54:33 +02:00
raven02 1f4ebf1501 RSX: check vertex_draw_count 2016-07-08 16:56:12 +08:00
vlj dcb3169f56 Merge pull request #1865 from vlj/rsx-refactor
Factorize rsx state
2016-07-07 22:49:23 +02:00
Vincent Lejeune 772706ca4c Factorize rsx state 2016-07-07 21:38:57 +02:00
Ivan 77594dc66c PPU LLVM: New analyser (#1858)
Minor fixes
VEX prefix support
2016-07-07 21:42:39 +03:00
Ivan 0dc00b8104 Merge pull request #1866 from GhettoGirl/gui-fixes
GUI: improve prx library selection
2016-07-06 23:22:21 +03:00
GhettoGirl 758897a929 GUI: add prx library search functionality in settings dialog
Add the possibility too lookup specific libraries in the settings dialog.
2016-07-05 20:46:51 +02:00
GhettoGirl 5c4af45bf5 GUI: improve prx library selection
Sorts the libraries in the settings dialog alphabetically, so they are easier to find.
Sorts selected and unselected modules alphabetically seperatly.
2016-07-05 00:00:46 +02:00
892 changed files with 132655 additions and 66981 deletions
+33
View File
@@ -0,0 +1,33 @@
Standard: Cpp11
UseTab: ForIndentation
TabWidth: 1
IndentWidth: 1
AccessModifierOffset: -1
PointerAlignment: Left
NamespaceIndentation: All
ColumnLimit: 200
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
AlwaysBreakTemplateDeclarations: true
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
Cpp11BracedListStyle: true
IndentCaseLabels: false
SortIncludes: false
ReflowComments: true
AlignConsecutiveAssignments: true
AlignTrailingComments: true
AlignAfterOpenBracket: DontAlign
ConstructorInitializerAllOnOneLineOrOnePerLine: false
BinPackArguments: true
BinPackParameters: true
AlwaysBreakAfterReturnType: None
KeepEmptyLinesAtTheStartOfBlocks: true
IndentWrappedFunctionNames: false
#SpaceAfterTemplateKeyword: false
+7
View File
@@ -0,0 +1,7 @@
root = true
[*.{h,cpp,hpp}]
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
+24
View File
@@ -0,0 +1,24 @@
<!---
THIS IS NOT A SUPPORT FORUM, FOR SUPPORT GO TO:
https://forums.rpcs3.net
or our discord:
https://discord.me/RPCS3
PLEASE READ THE GUIDELINES BEFORE OPENING AN ISSUE:
https://github.com/RPCS3/rpcs3/blob/master/CONTRIBUTING.md
====================================================
When submitting an issue, please check the following:
- You have read the above.
- You have provided the version (commit hash) of RPCS3 you are using.
- You have provided sufficient detail for the issue to be reproduced.
- You have provided system specs.
- Please also provide:
- For crashes, a backtrace.
- For graphical issues, comparison screenshots with real hardware.
Remember that the GitHub Issue Tracker is not the place to ask for support or to submit Game Compatibility reports. You must use our forums for that.
--->
+14 -1
View File
@@ -41,7 +41,10 @@
/Vulkan/Vulkan-build
/Vulkan/glslang-build
/wxWidgets/lib
# Themes
!/bin/GuiConfigs/
/bin/GuiConfigs/*.ini
/bin/rpcs3.ini
/bin/rpcs3.ipdb
/bin/rpcs3.iobj
@@ -55,9 +58,12 @@
rpcs3/git-version.h
# Visual Studio Files
.vs/*
*.ipch
*.vspx
*.psess
*.VC.*
*.vcxproj.user
# Copyrighted files
/bin/data/
@@ -69,6 +75,7 @@ rpcs3/git-version.h
!/bin/dev_hdd0/game/
/bin/dev_hdd0/game/*
!/bin/dev_hdd0/game/TEST12345/
/bin/dev_hdd0/disc/*
# Ignore other system generated files
bin/dev_hdd0/*.txt
@@ -85,3 +92,9 @@ CMakeCache.txt
# cotire
rpcs3/cotire/*
rpcs3/rpcs3_*_cotire.cmake
# Qt
moc_*.cpp
qrc_resources.cpp
rpcs3_automoc.cpp
ui_*.h
+12 -9
View File
@@ -1,7 +1,3 @@
[submodule "wxWidgets"]
path = wxWidgets
url = https://github.com/wxWidgets/wxWidgets
ignore = dirty
[submodule "rpcs3-ffmpeg"]
path = 3rdparty/ffmpeg
url = https://github.com/hrydgard/ppsspp-ffmpeg
@@ -12,16 +8,13 @@
[submodule "llvm"]
path = llvm
url = https://github.com/llvm-mirror/llvm
branch = release_36
[submodule "rsx_program_decompiler"]
path = rsx_program_decompiler
url = https://github.com/RPCS3/rsx_program_decompiler
branch = release_50
[submodule "GSL"]
path = 3rdparty/GSL
url = https://github.com/Microsoft/GSL.git
[submodule "libpng"]
path = 3rdparty/libpng
url = https://github.com/RPCS3/libpng
url = https://github.com/Zangetsu38/libpng
ignore = dirty
[submodule "Vulkan/glslang"]
path = Vulkan/glslang
@@ -35,3 +28,13 @@
[submodule "3rdparty/pugixml"]
path = 3rdparty/pugixml
url = https://github.com/RPCS3/pugixml
[submodule "3rdparty/cereal"]
path = 3rdparty/cereal
url = https://github.com/USCiLab/cereal.git
[submodule "3rdparty/zlib"]
path = 3rdparty/zlib
url = https://github.com/madler/zlib
[submodule "3rdparty/hidapi"]
path = 3rdparty/hidapi
url = https://github.com/Zangetsu38/hidapi
branch = master
+1 -1
View File
@@ -1,3 +1,3 @@
{
"userBlacklist": ["AlexAltea", "tambry"]
"userBlacklist": ["AlexAltea", "tambry", "DHrpcs3"]
}
+92 -60
View File
@@ -1,90 +1,122 @@
language: cpp
sudo: required
dist: trusty
os:
- linux
- osx
- linux
#- osx
osx_image: xcode6.4
# osx_image: xcode6.4
compiler:
- clang
- gcc
- clang
- gcc
env:
global:
- secure: "Vf+FY48nip9JppMnq11105NealdErSWsoUhHo63/V3V+LKfA9guenxCp93/qoSIdSGC/sJwb0yIIMGvkTT/rxDJNh6Z+BWUTb2E0WEIIQbvTJNOSUzoq7dfF1LT61XjVjByFzcbC2xjtaBowmcAYEs1jGUUuEjYVCMmD5lY8hUg="
# Which Travis environment to run Coverity on
- coverity_scan_run_condition='"$TRAVIS_OS_NAME" = linux -a "$CC" = gcc'
# Test mode is for testing if it's working with Coverity. Change to true if testing, to avoid reaching the quota.
- coverity_scan_script_test_mode=false
cache:
ccache: true
directories:
- $HOME/hombebrew_cache
matrix:
exclude:
- os: osx
compiler: gcc
exclude:
- os: osx
compiler: gcc
git:
submodules: false
before_install:
# shutdown services on Travis, which may have a memory impact
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -y libwxgtk3.0-dev;
fi;
- if [ "$CC" = "clang" ]; then
export CXX="clang++-4.0" CC="clang-4.0";
fi;
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then
export CXX="g++-5" CC="gcc-5" CXXFLAGS="-Wno-format-security";
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01';
fi;
# Add coverall for C++ so coverall.io could be triggered. Even it should be --coverage and gcov.
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo pip install cpp-coveralls requests[security];
wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run ;
chmod a+x ./qt-unified-linux-x64-online.run ;
export QT_QPA_PLATFORM=minimal ;
./qt-unified-linux-x64-online.run --script qt-installer-noninteractive.qs --no-force-installations ;
fi;
# Install updated libglew-dev since the version provided by trusty is outdated
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
wget http://mirrors.kernel.org/ubuntu/pool/main/g/glew/libglew-dev_1.13.0-2_amd64.deb;
wget http://mirrors.kernel.org/ubuntu/pool/main/g/glew/libglew1.13_1.13.0-2_amd64.deb;
wget http://mirrors.kernel.org/ubuntu/pool/universe/v/vulkan/libvulkan1_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb;
wget http://mirrors.kernel.org/ubuntu/pool/universe/v/vulkan/libvulkan-dev_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb;
sudo dpkg -i libglew1.13_1.13.0-2_amd64.deb libglew-dev_1.13.0-2_amd64.deb libvulkan1_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb libvulkan-dev_1.0.42.0+dfsg1-1ubuntu1~16.04.1_amd64.deb;
else
brew update; brew update;
brew install glew wxwidgets llvm36;
brew update;
brew install ccache glew llvm40;
fi;
before_script:
- git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp
- mkdir build
- cd build
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake ..; else cmake .. -DLLVM_DIR=/usr/local/opt/llvm36/lib/llvm-3.6/share/llvm/cmake; fi
- git submodule update --init asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal 3rdparty/hidapi Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers
- mkdir build
- cd build
- export CMAKE_PREFIX_PATH=~/Qt/5.9.1/gcc_64/lib/cmake
- if [ "$TRAVIS_PULL_REQUEST" = false ]; then
export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH";
else
export CXXFLAGS="$CXXFLAGS -DBRANCH=$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/#$TRAVIS_PULL_REQUEST";
fi;
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
- make -j 3
- # AppImage generation
- if [ "$TRAVIS_BRANCH" = "master" ] && [ "$CC" = "clang-4.0" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
export LD_LIBRARY_PATH=~/Qt/5.9.1/gcc_64/lib;
make DESTDIR=appdir install ; find appdir/ ;
find ../bin ;
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" ;
chmod a+x linuxdeployqt*.AppImage ;
export PATH=~/Qt/5.9.1/gcc_64/bin/:${PATH} ;
./linuxdeployqt*.AppImage --appimage-extract ;
./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs ;
mkdir ./appdir/usr/plugins/xcbglintegrations/ ;
mkdir ./appdir/usr/plugins/imageformats/ ;
cp ~/Qt/5.9.1/gcc_64/lib/libQt5Svg.so.5 ./appdir/usr/lib/ ;
cp ~/Qt/5.9.1/gcc_64/plugins/xcbglintegrations/* ./appdir/usr/plugins/xcbglintegrations/ ;
cp ~/Qt/5.9.1/gcc_64/plugins/imageformats/* ./appdir/usr/plugins/imageformats/ ;
cp ~/Qt/5.9.1/gcc_64/plugins/platforms/* ./appdir/usr/plugins/platforms/ ;
export PATH=${TRAVIS_BUILD_DIR}/build/squashfs-root/usr/bin/:${PATH} ;
./squashfs-root/usr/bin/appimagetool ${TRAVIS_BUILD_DIR}/build/appdir ;
find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq ;
curl ${UPLOAD_URL}${TRAVIS_COMMIT:0:7}-${TRAVIS_BUILD_NUMBER}_linux64 --upload-file ./RPCS3*.AppImage;
fi;
script:
# Add a command to show all the variables. May be useful for debugging Travis.
# - echo "--Shell Export Lists START--" ; export -p; echo "--Shell Export Lists STOP--";
# And to ensure the versions of toolchain
- echo "--CXX version?"; "$CXX" --version; echo "--CXX version confirmed";
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then make -j 4; fi
# Add a command to show all the variables. May be useful for debugging Travis.
#- echo "--Shell Export Lists START--" ; export -p; echo "--Shell Export Lists STOP--";
# And to ensure the versions of toolchain
- echo "--CXX version?"; "$CXX" --version; echo "--CXX version confirmed";
addons:
apt:
sources:
- ubuntu-toolchain-r-test
# - llvm-toolchain-trusty-3.6 temporarily disabled
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:jonathonf/binutils' # We need to update binutils to a newer version to link against the ffmpeg libs on.
packages:
- cmake
- libopenal-dev
- freeglut3-dev
- libglew-dev
- libc6-dev
# - llvm-3.6
# - llvm-3.6-dev
- libedit-dev
- g++-5
- gcc-5
# - clang-3.6
- libstdc++-5-dev
- lib32stdc++6
- zlib1g-dev
coverity_scan:
project:
name: $TRAVIS_REPO_SLUG
description: "PS3 emulator/debugger"
notification_email: raul.tambre@gmail.com
build_command: "make -j 4"
branch_pattern: coverity_scan
after_success:
- if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "$TRAVIS_OS_NAME" = linux ]; then coveralls --extension .c --extension .cpp --extension .h; fi
- binutils
- cmake
- libasound2-dev
- libopenal-dev
- freeglut3-dev
#- libglew-dev
#- libvulkan1
#- libvulkan-dev
- libc6-dev
- llvm-4.0
- llvm-4.0-dev
- clang-4.0
- libedit-dev
- g++-5
- gcc-5
- libstdc++-5-dev
- lib32stdc++6
- zlib1g-dev
# We need to install qt 5.9.1 manually because the version trusty provides is too old.
#- qtbase5-dev
- libudev-dev
- libevdev-dev
- libpulse-dev
+406 -12
View File
@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2014 The Khronos Group Inc.
** Copyright (c) 2013-2017 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -31,9 +31,7 @@ extern "C" {
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 31191 $ on $Date: 2015-05-14 06:31:39 -0400 (Thu, 14 May 2015) $
** https://github.com/KhronosGroup/OpenGL-Registry
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -53,7 +51,7 @@ extern "C" {
#define GLAPI extern
#endif
#define GL_GLEXT_VERSION 20150514
#define GL_GLEXT_VERSION 20170305
/* Generated C header for:
* API: gl
@@ -2654,7 +2652,7 @@ typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint fram
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target);
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param);
@@ -2777,7 +2775,7 @@ GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLs
GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value);
GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value);
GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value);
GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil);
GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target);
GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param);
@@ -2875,6 +2873,17 @@ GLAPI void APIENTRY glTextureBarrier (void);
#define GL_ARB_ES3_1_compatibility 1
#endif /* GL_ARB_ES3_1_compatibility */
#ifndef GL_ARB_ES3_2_compatibility
#define GL_ARB_ES3_2_compatibility 1
#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE
#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381
#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382
typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPrimitiveBoundingBoxARB (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
#endif
#endif /* GL_ARB_ES3_2_compatibility */
#ifndef GL_ARB_ES3_compatibility
#define GL_ARB_ES3_compatibility 1
#endif /* GL_ARB_ES3_compatibility */
@@ -3288,6 +3297,10 @@ GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program);
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
#endif /* GL_ARB_fragment_shader */
#ifndef GL_ARB_fragment_shader_interlock
#define GL_ARB_fragment_shader_interlock 1
#endif /* GL_ARB_fragment_shader_interlock */
#ifndef GL_ARB_framebuffer_no_attachments
#define GL_ARB_framebuffer_no_attachments 1
#endif /* GL_ARB_framebuffer_no_attachments */
@@ -3340,6 +3353,16 @@ GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachmen
#define GL_ARB_get_texture_sub_image 1
#endif /* GL_ARB_get_texture_sub_image */
#ifndef GL_ARB_gl_spirv
#define GL_ARB_gl_spirv 1
#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551
#define GL_SPIR_V_BINARY_ARB 0x9552
typedef void (APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSpecializeShaderARB (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue);
#endif
#endif /* GL_ARB_gl_spirv */
#ifndef GL_ARB_gpu_shader5
#define GL_ARB_gpu_shader5 1
#endif /* GL_ARB_gpu_shader5 */
@@ -3348,6 +3371,91 @@ GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachmen
#define GL_ARB_gpu_shader_fp64 1
#endif /* GL_ARB_gpu_shader_fp64 */
#ifndef GL_ARB_gpu_shader_int64
#define GL_ARB_gpu_shader_int64 1
#define GL_INT64_ARB 0x140E
#define GL_INT64_VEC2_ARB 0x8FE9
#define GL_INT64_VEC3_ARB 0x8FEA
#define GL_INT64_VEC4_ARB 0x8FEB
#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5
#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6
#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7
typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x);
typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y);
typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z);
typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x);
typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y);
typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64 *params);
typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64 *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64 *params);
typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUniform1i64ARB (GLint location, GLint64 x);
GLAPI void APIENTRY glUniform2i64ARB (GLint location, GLint64 x, GLint64 y);
GLAPI void APIENTRY glUniform3i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z);
GLAPI void APIENTRY glUniform4i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
GLAPI void APIENTRY glUniform1i64vARB (GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glUniform2i64vARB (GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glUniform3i64vARB (GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glUniform4i64vARB (GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glUniform1ui64ARB (GLint location, GLuint64 x);
GLAPI void APIENTRY glUniform2ui64ARB (GLint location, GLuint64 x, GLuint64 y);
GLAPI void APIENTRY glUniform3ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
GLAPI void APIENTRY glUniform4ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
GLAPI void APIENTRY glUniform1ui64vARB (GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glUniform2ui64vARB (GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glUniform3ui64vARB (GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glUniform4ui64vARB (GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glGetUniformi64vARB (GLuint program, GLint location, GLint64 *params);
GLAPI void APIENTRY glGetUniformui64vARB (GLuint program, GLint location, GLuint64 *params);
GLAPI void APIENTRY glGetnUniformi64vARB (GLuint program, GLint location, GLsizei bufSize, GLint64 *params);
GLAPI void APIENTRY glGetnUniformui64vARB (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params);
GLAPI void APIENTRY glProgramUniform1i64ARB (GLuint program, GLint location, GLint64 x);
GLAPI void APIENTRY glProgramUniform2i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y);
GLAPI void APIENTRY glProgramUniform3i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z);
GLAPI void APIENTRY glProgramUniform4i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
GLAPI void APIENTRY glProgramUniform1i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glProgramUniform2i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glProgramUniform3i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glProgramUniform4i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value);
GLAPI void APIENTRY glProgramUniform1ui64ARB (GLuint program, GLint location, GLuint64 x);
GLAPI void APIENTRY glProgramUniform2ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y);
GLAPI void APIENTRY glProgramUniform3ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
GLAPI void APIENTRY glProgramUniform4ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
GLAPI void APIENTRY glProgramUniform1ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glProgramUniform2ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glProgramUniform3ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
GLAPI void APIENTRY glProgramUniform4ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value);
#endif
#endif /* GL_ARB_gpu_shader_int64 */
#ifndef GL_ARB_half_float_pixel
#define GL_ARB_half_float_pixel 1
typedef unsigned short GLhalfARB;
@@ -3727,6 +3835,16 @@ GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *par
#define GL_ARB_occlusion_query2 1
#endif /* GL_ARB_occlusion_query2 */
#ifndef GL_ARB_parallel_shader_compile
#define GL_ARB_parallel_shader_compile 1
#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0
#define GL_COMPLETION_STATUS_ARB 0x91B1
typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMaxShaderCompilerThreadsARB (GLuint count);
#endif
#endif /* GL_ARB_parallel_shader_compile */
#ifndef GL_ARB_pipeline_statistics_query
#define GL_ARB_pipeline_statistics_query 1
#define GL_VERTICES_SUBMITTED_ARB 0x82EE
@@ -3769,6 +3887,10 @@ GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
#define GL_COORD_REPLACE_ARB 0x8862
#endif /* GL_ARB_point_sprite */
#ifndef GL_ARB_post_depth_coverage
#define GL_ARB_post_depth_coverage 1
#endif /* GL_ARB_post_depth_coverage */
#ifndef GL_ARB_program_interface_query
#define GL_ARB_program_interface_query 1
#endif /* GL_ARB_program_interface_query */
@@ -3842,6 +3964,26 @@ GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum form
#define GL_ARB_robustness_isolation 1
#endif /* GL_ARB_robustness_isolation */
#ifndef GL_ARB_sample_locations
#define GL_ARB_sample_locations 1
#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D
#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E
#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F
#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340
#define GL_SAMPLE_LOCATION_ARB 0x8E50
#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341
#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342
#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343
typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferSampleLocationsfvARB (GLenum target, GLuint start, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvARB (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glEvaluateDepthValuesARB (void);
#endif
#endif /* GL_ARB_sample_locations */
#ifndef GL_ARB_sample_shading
#define GL_ARB_sample_shading 1
#define GL_SAMPLE_SHADING_ARB 0x8C36
@@ -3868,14 +4010,26 @@ GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value);
#define GL_ARB_separate_shader_objects 1
#endif /* GL_ARB_separate_shader_objects */
#ifndef GL_ARB_shader_atomic_counter_ops
#define GL_ARB_shader_atomic_counter_ops 1
#endif /* GL_ARB_shader_atomic_counter_ops */
#ifndef GL_ARB_shader_atomic_counters
#define GL_ARB_shader_atomic_counters 1
#endif /* GL_ARB_shader_atomic_counters */
#ifndef GL_ARB_shader_ballot
#define GL_ARB_shader_ballot 1
#endif /* GL_ARB_shader_ballot */
#ifndef GL_ARB_shader_bit_encoding
#define GL_ARB_shader_bit_encoding 1
#endif /* GL_ARB_shader_bit_encoding */
#ifndef GL_ARB_shader_clock
#define GL_ARB_shader_clock 1
#endif /* GL_ARB_shader_clock */
#ifndef GL_ARB_shader_draw_parameters
#define GL_ARB_shader_draw_parameters 1
#endif /* GL_ARB_shader_draw_parameters */
@@ -4040,6 +4194,10 @@ GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GL
#define GL_ARB_shader_texture_lod 1
#endif /* GL_ARB_shader_texture_lod */
#ifndef GL_ARB_shader_viewport_layer_array
#define GL_ARB_shader_viewport_layer_array 1
#endif /* GL_ARB_shader_viewport_layer_array */
#ifndef GL_ARB_shading_language_100
#define GL_ARB_shading_language_100 1
#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
@@ -4119,6 +4277,14 @@ GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xo
#endif
#endif /* GL_ARB_sparse_texture */
#ifndef GL_ARB_sparse_texture2
#define GL_ARB_sparse_texture2 1
#endif /* GL_ARB_sparse_texture2 */
#ifndef GL_ARB_sparse_texture_clamp
#define GL_ARB_sparse_texture_clamp 1
#endif /* GL_ARB_sparse_texture_clamp */
#ifndef GL_ARB_stencil_texturing
#define GL_ARB_stencil_texturing 1
#endif /* GL_ARB_stencil_texturing */
@@ -4271,6 +4437,12 @@ GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void
#define GL_DOT3_RGBA_ARB 0x86AF
#endif /* GL_ARB_texture_env_dot3 */
#ifndef GL_ARB_texture_filter_minmax
#define GL_ARB_texture_filter_minmax 1
#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366
#define GL_WEIGHTED_AVERAGE_ARB 0x9367
#endif /* GL_ARB_texture_filter_minmax */
#ifndef GL_ARB_texture_float
#define GL_ARB_texture_float 1
#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
@@ -4815,6 +4987,10 @@ GLAPI void APIENTRY glBlendBarrierKHR (void);
#define GL_KHR_texture_compression_astc_ldr 1
#endif /* GL_KHR_texture_compression_astc_ldr */
#ifndef GL_KHR_texture_compression_astc_sliced_3d
#define GL_KHR_texture_compression_astc_sliced_3d 1
#endif /* GL_KHR_texture_compression_astc_sliced_3d */
#ifndef GL_OES_byte_coordinates
#define GL_OES_byte_coordinates 1
typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s);
@@ -5206,10 +5382,45 @@ GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRG
#endif
#endif /* GL_AMD_draw_buffers_blend */
#ifndef GL_AMD_framebuffer_sample_positions
#define GL_AMD_framebuffer_sample_positions 1
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE
#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF
#define GL_ALL_PIXELS_AMD 0xFFFFFFFF
typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values);
typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values);
typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferSamplePositionsfvAMD (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values);
GLAPI void APIENTRY glNamedFramebufferSamplePositionsfvAMD (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values);
GLAPI void APIENTRY glGetFramebufferParameterfvAMD (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values);
GLAPI void APIENTRY glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values);
#endif
#endif /* GL_AMD_framebuffer_sample_positions */
#ifndef GL_AMD_gcn_shader
#define GL_AMD_gcn_shader 1
#endif /* GL_AMD_gcn_shader */
#ifndef GL_AMD_gpu_shader_half_float
#define GL_AMD_gpu_shader_half_float 1
#define GL_FLOAT16_NV 0x8FF8
#define GL_FLOAT16_VEC2_NV 0x8FF9
#define GL_FLOAT16_VEC3_NV 0x8FFA
#define GL_FLOAT16_VEC4_NV 0x8FFB
#define GL_FLOAT16_MAT2_AMD 0x91C5
#define GL_FLOAT16_MAT3_AMD 0x91C6
#define GL_FLOAT16_MAT4_AMD 0x91C7
#define GL_FLOAT16_MAT2x3_AMD 0x91C8
#define GL_FLOAT16_MAT2x4_AMD 0x91C9
#define GL_FLOAT16_MAT3x2_AMD 0x91CA
#define GL_FLOAT16_MAT3x4_AMD 0x91CB
#define GL_FLOAT16_MAT4x2_AMD 0x91CC
#define GL_FLOAT16_MAT4x3_AMD 0x91CD
#endif /* GL_AMD_gpu_shader_half_float */
#ifndef GL_AMD_gpu_shader_int64
#define GL_AMD_gpu_shader_int64 1
typedef int64_t GLint64EXT;
@@ -5237,10 +5448,6 @@ typedef int64_t GLint64EXT;
#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
#define GL_FLOAT16_NV 0x8FF8
#define GL_FLOAT16_VEC2_NV 0x8FF9
#define GL_FLOAT16_VEC3_NV 0x8FFA
#define GL_FLOAT16_VEC4_NV 0x8FFB
typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
@@ -5413,7 +5620,6 @@ GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname
#ifndef GL_AMD_sample_positions
#define GL_AMD_sample_positions 1
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
@@ -5428,6 +5634,14 @@ GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLf
#define GL_AMD_shader_atomic_counter_ops 1
#endif /* GL_AMD_shader_atomic_counter_ops */
#ifndef GL_AMD_shader_ballot
#define GL_AMD_shader_ballot 1
#endif /* GL_AMD_shader_ballot */
#ifndef GL_AMD_shader_explicit_vertex_parameter
#define GL_AMD_shader_explicit_vertex_parameter 1
#endif /* GL_AMD_shader_explicit_vertex_parameter */
#ifndef GL_AMD_shader_stencil_export
#define GL_AMD_shader_stencil_export 1
#endif /* GL_AMD_shader_stencil_export */
@@ -8468,6 +8682,20 @@ GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei s
#endif
#endif /* GL_EXT_vertex_weighting */
#ifndef GL_EXT_window_rectangles
#define GL_EXT_window_rectangles 1
#define GL_INCLUSIVE_EXT 0x8F10
#define GL_EXCLUSIVE_EXT 0x8F11
#define GL_WINDOW_RECTANGLE_EXT 0x8F12
#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13
#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14
#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15
typedef void (APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box);
#endif
#endif /* GL_EXT_window_rectangles */
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#define GL_SYNC_X11_FENCE_EXT 0x90E1
@@ -8645,10 +8873,23 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG
#define GL_INTERLACE_READ_INGR 0x8568
#endif /* GL_INGR_interlace_read */
#ifndef GL_INTEL_conservative_rasterization
#define GL_INTEL_conservative_rasterization 1
#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
#endif /* GL_INTEL_conservative_rasterization */
#ifndef GL_INTEL_fragment_shader_ordering
#define GL_INTEL_fragment_shader_ordering 1
#endif /* GL_INTEL_fragment_shader_ordering */
#ifndef GL_INTEL_framebuffer_CMAA
#define GL_INTEL_framebuffer_CMAA 1
typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void);
#endif
#endif /* GL_INTEL_framebuffer_CMAA */
#ifndef GL_INTEL_map_texture
#define GL_INTEL_map_texture 1
#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF
@@ -8753,6 +8994,10 @@ GLAPI void APIENTRY glResizeBuffersMESA (void);
#endif
#endif /* GL_MESA_resize_buffers */
#ifndef GL_MESA_shader_integer_functions
#define GL_MESA_shader_integer_functions 1
#endif /* GL_MESA_shader_integer_functions */
#ifndef GL_MESA_window_pos
#define GL_MESA_window_pos 1
typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
@@ -8814,6 +9059,10 @@ GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v);
#define GL_YCBCR_MESA 0x8757
#endif /* GL_MESA_ycbcr_texture */
#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers
#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1
#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */
#ifndef GL_NVX_conditional_render
#define GL_NVX_conditional_render 1
typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id);
@@ -8833,6 +9082,32 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void);
#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
#endif /* GL_NVX_gpu_memory_info */
#ifndef GL_NVX_linked_gpu_multicast
#define GL_NVX_linked_gpu_multicast 1
#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800
#define GL_MAX_LGPU_GPUS_NVX 0x92BA
typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glLGPUInterlockNVX (void);
#endif
#endif /* GL_NVX_linked_gpu_multicast */
#ifndef GL_NV_alpha_to_coverage_dither_control
#define GL_NV_alpha_to_coverage_dither_control 1
#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D
#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E
#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F
#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF
typedef void (APIENTRYP PFNGLALPHATOCOVERAGEDITHERCONTROLNVPROC) (GLenum mode);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glAlphaToCoverageDitherControlNV (GLenum mode);
#endif
#endif /* GL_NV_alpha_to_coverage_dither_control */
#ifndef GL_NV_bindless_multi_draw_indirect
#define GL_NV_bindless_multi_draw_indirect 1
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
@@ -8953,6 +9228,17 @@ GLAPI void APIENTRY glBlendBarrierNV (void);
#define GL_NV_blend_square 1
#endif /* GL_NV_blend_square */
#ifndef GL_NV_clip_space_w_scaling
#define GL_NV_clip_space_w_scaling 1
#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C
#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D
#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E
typedef void (APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
#endif
#endif /* GL_NV_clip_space_w_scaling */
#ifndef GL_NV_command_list
#define GL_NV_command_list 1
#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000
@@ -9044,6 +9330,28 @@ GLAPI void APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits);
#endif
#endif /* GL_NV_conservative_raster */
#ifndef GL_NV_conservative_raster_dilate
#define GL_NV_conservative_raster_dilate 1
#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379
#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A
#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B
typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat value);
#endif
#endif /* GL_NV_conservative_raster_dilate */
#ifndef GL_NV_conservative_raster_pre_snap_triangles
#define GL_NV_conservative_raster_pre_snap_triangles 1
#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D
#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E
#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F
typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param);
#endif
#endif /* GL_NV_conservative_raster_pre_snap_triangles */
#ifndef GL_NV_copy_depth_to_color
#define GL_NV_copy_depth_to_color 1
#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
@@ -9093,6 +9401,23 @@ GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0,
#endif
#endif /* GL_NV_draw_texture */
#ifndef GL_NV_draw_vulkan_image
#define GL_NV_draw_vulkan_image 1
typedef void (APIENTRY *GLVULKANPROCNV)(void);
typedef void (APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
typedef GLVULKANPROCNV (APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name);
typedef void (APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore);
typedef void (APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore);
typedef void (APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
GLAPI GLVULKANPROCNV APIENTRY glGetVkProcAddrNV (const GLchar *name);
GLAPI void APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore);
GLAPI void APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore);
GLAPI void APIENTRY glSignalVkFenceNV (GLuint64 vkFence);
#endif
#endif /* GL_NV_draw_vulkan_image */
#ifndef GL_NV_evaluators
#define GL_NV_evaluators 1
#define GL_EVAL_2D_NV 0x86C0
@@ -9327,6 +9652,41 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen
#define GL_NV_geometry_shader_passthrough 1
#endif /* GL_NV_geometry_shader_passthrough */
#ifndef GL_NV_gpu_multicast
#define GL_NV_gpu_multicast 1
#define GL_PER_GPU_STORAGE_BIT_NV 0x0800
#define GL_MULTICAST_GPUS_NV 0x92BA
#define GL_RENDER_GPU_MASK_NV 0x9558
#define GL_PER_GPU_STORAGE_NV 0x9548
#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549
typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask);
typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void);
typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params);
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask);
GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glMulticastBarrierNV (void);
GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask);
GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params);
GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params);
GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params);
GLAPI void APIENTRY glMulticastGetQueryObjectui64vNV (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params);
#endif
#endif /* GL_NV_gpu_multicast */
#ifndef GL_NV_gpu_program4
#define GL_NV_gpu_program4 1
#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
@@ -10036,6 +10396,11 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname,
#endif
#endif /* GL_NV_register_combiners2 */
#ifndef GL_NV_robustness_video_memory_purge
#define GL_NV_robustness_video_memory_purge 1
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
#endif /* GL_NV_robustness_video_memory_purge */
#ifndef GL_NV_sample_locations
#define GL_NV_sample_locations 1
#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D
@@ -10068,6 +10433,10 @@ GLAPI void APIENTRY glResolveDepthValuesNV (void);
#define GL_NV_shader_atomic_float 1
#endif /* GL_NV_shader_atomic_float */
#ifndef GL_NV_shader_atomic_float64
#define GL_NV_shader_atomic_float64 1
#endif /* GL_NV_shader_atomic_float64 */
#ifndef GL_NV_shader_atomic_fp16_vector
#define GL_NV_shader_atomic_fp16_vector 1
#endif /* GL_NV_shader_atomic_fp16_vector */
@@ -10131,6 +10500,10 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_thread_shuffle 1
#endif /* GL_NV_shader_thread_shuffle */
#ifndef GL_NV_stereo_view_rendering
#define GL_NV_stereo_view_rendering 1
#endif /* GL_NV_stereo_view_rendering */
#ifndef GL_NV_tessellation_program5
#define GL_NV_tessellation_program5 1
#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
@@ -10901,6 +11274,26 @@ GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot
#define GL_NV_viewport_array2 1
#endif /* GL_NV_viewport_array2 */
#ifndef GL_NV_viewport_swizzle
#define GL_NV_viewport_swizzle 1
#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351
#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353
#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355
#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357
#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358
#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359
#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A
#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B
typedef void (APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
#endif
#endif /* GL_NV_viewport_swizzle */
#ifndef GL_OML_interlace
#define GL_OML_interlace 1
#define GL_INTERLACE_OML 0x8980
@@ -10928,6 +11321,7 @@ GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632
#define GL_MAX_VIEWS_OVR 0x9631
#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+1 -1
Vendored Submodule
+1
Submodule 3rdparty/cereal added at 42a45b6e15
Vendored Submodule
+1
Submodule 3rdparty/hidapi added at 4c2750112e
+25
View File
@@ -0,0 +1,25 @@
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2DBaseTypes.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2DBASETYPES_INCLUDED
#define _D2DBASETYPES_INCLUDED
#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#endif // #ifndef COM_NO_WINDOWS_H
#ifndef __dxgitype_h__
#include <dxgitype.h>
#endif // #ifndef __dxgitype_h__
#ifndef DCOMMON_H_INCLUDED
#include <dcommon.h>
#endif // #ifndef DCOMMON_H_INCLUDED
typedef D3DCOLORVALUE D2D_COLOR_F;
#endif // #ifndef _D2DBASETYPES_INCLUDED
+1204 -4619
View File
File diff suppressed because it is too large Load Diff
+799 -3159
View File
File diff suppressed because it is too large Load Diff
+53 -658
View File
@@ -33,53 +33,47 @@ typedef interface ID2D1Device1 ID2D1Device1;
#endif
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_RENDERING_PRIORITY
//
// Synopsis:
// Specifies the extent to which D2D will throttle work sent to the GPU.
//
//------------------------------------------------------------------------------
/// <summary>
/// Specifies the extent to which D2D will throttle work sent to the GPU.
/// </summary>
typedef enum D2D1_RENDERING_PRIORITY
{
D2D1_RENDERING_PRIORITY_NORMAL = 0,
D2D1_RENDERING_PRIORITY_LOW = 1,
D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff
D2D1_RENDERING_PRIORITY_NORMAL = 0,
D2D1_RENDERING_PRIORITY_LOW = 1,
D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff
} D2D1_RENDERING_PRIORITY;
EXTERN_C CONST IID IID_ID2D1GeometryRealization;
EXTERN_C CONST IID IID_ID2D1DeviceContext1;
EXTERN_C CONST IID IID_ID2D1Device1;
EXTERN_C CONST IID IID_ID2D1Factory2;
EXTERN_C CONST IID IID_ID2D1CommandSink1;
#ifndef D2D_USE_C_DEFINITIONS
//+-----------------------------------------------------------------------------
//
// Interface:
// ID2D1GeometryRealization
//
//------------------------------------------------------------------------------
/// <summary>
/// Encapsulates a device- and transform-dependent representation of a filled or
/// stroked geometry.
/// </summary>
interface DX_DECLARE_INTERFACE("a16907d7-bc02-4801-99e8-8cf7f485f774") ID2D1GeometryRealization : public ID2D1Resource
{
}; // interface ID2D1GeometryRealization
//+-----------------------------------------------------------------------------
//
// Interface:
// ID2D1DeviceContext1
//
//------------------------------------------------------------------------------
/// <summary>
/// Enables creation and drawing of geometry realization objects.
/// </summary>
interface DX_DECLARE_INTERFACE("d37f57e4-6908-459f-a199-e72f24f79987") ID2D1DeviceContext1 : public ID2D1DeviceContext
{
STDMETHOD(CreateFilledGeometryRealization)(
_In_ ID2D1Geometry *geometry,
FLOAT flatteningTolerance,
_Outptr_ ID2D1GeometryRealization **geometryRealization
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD(CreateStrokedGeometryRealization)(
@@ -87,7 +81,7 @@ interface DX_DECLARE_INTERFACE("d37f57e4-6908-459f-a199-e72f24f79987") ID2D1Devi
FLOAT flatteningTolerance,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle,
_Outptr_ ID2D1GeometryRealization **geometryRealization
_COM_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD_(void, DrawGeometryRealization)(
@@ -97,82 +91,69 @@ interface DX_DECLARE_INTERFACE("d37f57e4-6908-459f-a199-e72f24f79987") ID2D1Devi
}; // interface ID2D1DeviceContext1
//+-----------------------------------------------------------------------------
//
// Interface:
// ID2D1Device1
//
//------------------------------------------------------------------------------
/// <summary>
/// Represents a resource domain whose objects and device contexts can be used
/// together.
/// </summary>
interface DX_DECLARE_INTERFACE("d21768e1-23a4-4823-a14b-7c3eba85d658") ID2D1Device1 : public ID2D1Device
{
//
// Retrieves the rendering priority currently set on the device.
//
/// <summary>
/// Retrieves the rendering priority currently set on the device.
/// </summary>
STDMETHOD_(D2D1_RENDERING_PRIORITY, GetRenderingPriority)(
) PURE;
//
// Sets the rendering priority of the device.
//
/// <summary>
/// Sets the rendering priority of the device.
/// </summary>
STDMETHOD_(void, SetRenderingPriority)(
D2D1_RENDERING_PRIORITY renderingPriority
) PURE;
//
// Creates a new device context with no initially assigned target.
//
/// <summary>
/// Creates a new device context with no initially assigned target.
/// </summary>
STDMETHOD(CreateDeviceContext)(
D2D1_DEVICE_CONTEXT_OPTIONS options,
_Outptr_ ID2D1DeviceContext1 **deviceContext1
_COM_Outptr_ ID2D1DeviceContext1 **deviceContext1
) PURE;
using ID2D1Device::CreateDeviceContext;
}; // interface ID2D1Device1
//+-----------------------------------------------------------------------------
//
// Interface:
// ID2D1Factory2
//
//------------------------------------------------------------------------------
/// <summary>
/// Creates Direct2D resources. This interface also enables the creation of
/// ID2D1Device1 objects.
/// </summary>
interface DX_DECLARE_INTERFACE("94f81a73-9212-4376-9c58-b16a3a0d3992") ID2D1Factory2 : public ID2D1Factory1
{
//
// This creates a new Direct2D device from the given IDXGIDevice.
//
/// <summary>
/// This creates a new Direct2D device from the given IDXGIDevice.
/// </summary>
STDMETHOD(CreateDevice)(
_In_ IDXGIDevice *dxgiDevice,
_Outptr_ ID2D1Device1 **d2dDevice1
_COM_Outptr_ ID2D1Device1 **d2dDevice1
) PURE;
using ID2D1Factory1::CreateDevice;
}; // interface ID2D1Factory2
//+-----------------------------------------------------------------------------
//
// Interface:
// ID2D1CommandSink1
//
//------------------------------------------------------------------------------
/// <summary>
/// This interface performs all the same functions as the existing ID2D1CommandSink
/// interface. It also enables access to the new primitive blend modes, MIN and ADD,
/// through its SetPrimitiveBlend1 method.
/// </summary>
interface DX_DECLARE_INTERFACE("9eb767fd-4269-4467-b8c2-eb30cb305743") ID2D1CommandSink1 : public ID2D1CommandSink
{
//
// This method is called if primitiveBlend value was added after Windows 8.
// SetPrimitiveBlend method is used for Win8 values (_SOURCE_OVER and _COPY).
//
/// <summary>
/// This method is called if primitiveBlend value was added after Windows 8.
/// SetPrimitiveBlend method is used for Win8 values (_SOURCE_OVER and _COPY).
/// </summary>
STDMETHOD(SetPrimitiveBlend1)(
D2D1_PRIMITIVE_BLEND primitiveBlend
) PURE;
@@ -183,605 +164,19 @@ interface DX_DECLARE_INTERFACE("9eb767fd-4269-4467-b8c2-eb30cb305743") ID2D1Comm
#endif
EXTERN_C CONST IID IID_ID2D1GeometryRealization;
EXTERN_C CONST IID IID_ID2D1DeviceContext1;
EXTERN_C CONST IID IID_ID2D1Device1;
EXTERN_C CONST IID IID_ID2D1Factory2;
EXTERN_C CONST IID IID_ID2D1CommandSink1;
#ifdef D2D_USE_C_DEFINITIONS
typedef interface ID2D1GeometryRealization ID2D1GeometryRealization;
typedef struct ID2D1GeometryRealizationVtbl
{
ID2D1ResourceVtbl Base;
} ID2D1GeometryRealizationVtbl;
interface ID2D1GeometryRealization
{
CONST struct ID2D1GeometryRealizationVtbl *lpVtbl;
};
#define ID2D1GeometryRealization_QueryInterface(This, riid, ppv) \
((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
#define ID2D1GeometryRealization_AddRef(This) \
((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
#define ID2D1GeometryRealization_Release(This) \
((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
#define ID2D1GeometryRealization_GetFactory(This, factory) \
((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory))
typedef interface ID2D1DeviceContext1 ID2D1DeviceContext1;
typedef struct ID2D1DeviceContext1Vtbl
{
ID2D1DeviceContextVtbl Base;
STDMETHOD(CreateFilledGeometryRealization)(
ID2D1DeviceContext1 *This,
_In_ ID2D1Geometry *geometry,
FLOAT flatteningTolerance,
_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD(CreateStrokedGeometryRealization)(
ID2D1DeviceContext1 *This,
_In_ ID2D1Geometry *geometry,
FLOAT flatteningTolerance,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle,
_Outptr_ ID2D1GeometryRealization **geometryRealization
) PURE;
STDMETHOD_(void, DrawGeometryRealization)(
ID2D1DeviceContext1 *This,
_In_ ID2D1GeometryRealization *geometryRealization,
_In_ ID2D1Brush *brush
) PURE;
} ID2D1DeviceContext1Vtbl;
interface ID2D1DeviceContext1
{
CONST struct ID2D1DeviceContext1Vtbl *lpVtbl;
};
#define ID2D1DeviceContext1_QueryInterface(This, riid, ppv) \
((This)->lpVtbl->Base.Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
#define ID2D1DeviceContext1_AddRef(This) \
((This)->lpVtbl->Base.Base.Base.Base.AddRef((IUnknown *)This))
#define ID2D1DeviceContext1_Release(This) \
((This)->lpVtbl->Base.Base.Base.Base.Release((IUnknown *)This))
#define ID2D1DeviceContext1_GetFactory(This, factory) \
((This)->lpVtbl->Base.Base.Base.GetFactory((ID2D1Resource *)This, factory))
#define ID2D1DeviceContext1_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \
((This)->lpVtbl->Base.Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap))
#define ID2D1DeviceContext1_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \
((This)->lpVtbl->Base.Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush))
#define ID2D1DeviceContext1_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \
((This)->lpVtbl->Base.Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush))
#define ID2D1DeviceContext1_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \
((This)->lpVtbl->Base.Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush))
#define ID2D1DeviceContext1_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \
((This)->lpVtbl->Base.Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget))
#define ID2D1DeviceContext1_CreateLayer(This, size, layer) \
((This)->lpVtbl->Base.Base.CreateLayer((ID2D1RenderTarget *)This, size, layer))
#define ID2D1DeviceContext1_CreateMesh(This, mesh) \
((This)->lpVtbl->Base.Base.CreateMesh((ID2D1RenderTarget *)This, mesh))
#define ID2D1DeviceContext1_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle))
#define ID2D1DeviceContext1_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle))
#define ID2D1DeviceContext1_FillRectangle(This, rect, brush) \
((This)->lpVtbl->Base.Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush))
#define ID2D1DeviceContext1_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle))
#define ID2D1DeviceContext1_FillRoundedRectangle(This, roundedRect, brush) \
((This)->lpVtbl->Base.Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush))
#define ID2D1DeviceContext1_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle))
#define ID2D1DeviceContext1_FillEllipse(This, ellipse, brush) \
((This)->lpVtbl->Base.Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush))
#define ID2D1DeviceContext1_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle))
#define ID2D1DeviceContext1_FillGeometry(This, geometry, brush, opacityBrush) \
((This)->lpVtbl->Base.Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush))
#define ID2D1DeviceContext1_FillMesh(This, mesh, brush) \
((This)->lpVtbl->Base.Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush))
#define ID2D1DeviceContext1_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \
((This)->lpVtbl->Base.Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode))
#define ID2D1DeviceContext1_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \
((This)->lpVtbl->Base.Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options))
#define ID2D1DeviceContext1_SetTransform(This, transform) \
((This)->lpVtbl->Base.Base.SetTransform((ID2D1RenderTarget *)This, transform))
#define ID2D1DeviceContext1_GetTransform(This, transform) \
((This)->lpVtbl->Base.Base.GetTransform((ID2D1RenderTarget *)This, transform))
#define ID2D1DeviceContext1_SetAntialiasMode(This, antialiasMode) \
((This)->lpVtbl->Base.Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode))
#define ID2D1DeviceContext1_GetAntialiasMode(This) \
((This)->lpVtbl->Base.Base.GetAntialiasMode((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_SetTextAntialiasMode(This, textAntialiasMode) \
((This)->lpVtbl->Base.Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode))
#define ID2D1DeviceContext1_GetTextAntialiasMode(This) \
((This)->lpVtbl->Base.Base.GetTextAntialiasMode((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_SetTextRenderingParams(This, textRenderingParams) \
((This)->lpVtbl->Base.Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
#define ID2D1DeviceContext1_GetTextRenderingParams(This, textRenderingParams) \
((This)->lpVtbl->Base.Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams))
#define ID2D1DeviceContext1_SetTags(This, tag1, tag2) \
((This)->lpVtbl->Base.Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2))
#define ID2D1DeviceContext1_GetTags(This, tag1, tag2) \
((This)->lpVtbl->Base.Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2))
#define ID2D1DeviceContext1_PopLayer(This) \
((This)->lpVtbl->Base.Base.PopLayer((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_Flush(This, tag1, tag2) \
((This)->lpVtbl->Base.Base.Flush((ID2D1RenderTarget *)This, tag1, tag2))
#define ID2D1DeviceContext1_SaveDrawingState(This, drawingStateBlock) \
((This)->lpVtbl->Base.Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
#define ID2D1DeviceContext1_RestoreDrawingState(This, drawingStateBlock) \
((This)->lpVtbl->Base.Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock))
#define ID2D1DeviceContext1_PushAxisAlignedClip(This, clipRect, antialiasMode) \
((This)->lpVtbl->Base.Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode))
#define ID2D1DeviceContext1_PopAxisAlignedClip(This) \
((This)->lpVtbl->Base.Base.PopAxisAlignedClip((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_Clear(This, clearColor) \
((This)->lpVtbl->Base.Base.Clear((ID2D1RenderTarget *)This, clearColor))
#define ID2D1DeviceContext1_BeginDraw(This) \
((This)->lpVtbl->Base.Base.BeginDraw((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_EndDraw(This, tag1, tag2) \
((This)->lpVtbl->Base.Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2))
#define ID2D1DeviceContext1_GetPixelFormat(This) \
((This)->lpVtbl->Base.Base.GetPixelFormat((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_SetDpi(This, dpiX, dpiY) \
((This)->lpVtbl->Base.Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
#define ID2D1DeviceContext1_GetDpi(This, dpiX, dpiY) \
((This)->lpVtbl->Base.Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY))
#define ID2D1DeviceContext1_GetSize(This) \
((This)->lpVtbl->Base.Base.GetSize((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_GetPixelSize(This) \
((This)->lpVtbl->Base.Base.GetPixelSize((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_GetMaximumBitmapSize(This) \
((This)->lpVtbl->Base.Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This))
#define ID2D1DeviceContext1_IsSupported(This, renderTargetProperties) \
((This)->lpVtbl->Base.Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties))
#define ID2D1DeviceContext1_CreateBitmap(This, size, sourceData, pitch, bitmapProperties, bitmap) \
((This)->lpVtbl->Base.CreateBitmap((ID2D1DeviceContext *)This, size, sourceData, pitch, bitmapProperties, bitmap))
#define ID2D1DeviceContext1_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \
((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1DeviceContext *)This, wicBitmapSource, bitmapProperties, bitmap))
#define ID2D1DeviceContext1_CreateColorContext(This, space, profile, profileSize, colorContext) \
((This)->lpVtbl->Base.CreateColorContext((ID2D1DeviceContext *)This, space, profile, profileSize, colorContext))
#define ID2D1DeviceContext1_CreateColorContextFromFilename(This, filename, colorContext) \
((This)->lpVtbl->Base.CreateColorContextFromFilename((ID2D1DeviceContext *)This, filename, colorContext))
#define ID2D1DeviceContext1_CreateColorContextFromWicColorContext(This, wicColorContext, colorContext) \
((This)->lpVtbl->Base.CreateColorContextFromWicColorContext((ID2D1DeviceContext *)This, wicColorContext, colorContext))
#define ID2D1DeviceContext1_CreateBitmapFromDxgiSurface(This, surface, bitmapProperties, bitmap) \
((This)->lpVtbl->Base.CreateBitmapFromDxgiSurface((ID2D1DeviceContext *)This, surface, bitmapProperties, bitmap))
#define ID2D1DeviceContext1_CreateEffect(This, effectId, effect) \
((This)->lpVtbl->Base.CreateEffect((ID2D1DeviceContext *)This, effectId, effect))
#define ID2D1DeviceContext1_CreateGradientStopCollection(This, straightAlphaGradientStops, straightAlphaGradientStopsCount, preInterpolationSpace, postInterpolationSpace, bufferPrecision, extendMode, colorInterpolationMode, gradientStopCollection1) \
((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1DeviceContext *)This, straightAlphaGradientStops, straightAlphaGradientStopsCount, preInterpolationSpace, postInterpolationSpace, bufferPrecision, extendMode, colorInterpolationMode, gradientStopCollection1))
#define ID2D1DeviceContext1_CreateImageBrush(This, image, imageBrushProperties, brushProperties, imageBrush) \
((This)->lpVtbl->Base.CreateImageBrush((ID2D1DeviceContext *)This, image, imageBrushProperties, brushProperties, imageBrush))
#define ID2D1DeviceContext1_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \
((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1DeviceContext *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush))
#define ID2D1DeviceContext1_CreateCommandList(This, commandList) \
((This)->lpVtbl->Base.CreateCommandList((ID2D1DeviceContext *)This, commandList))
#define ID2D1DeviceContext1_IsDxgiFormatSupported(This, format) \
((This)->lpVtbl->Base.IsDxgiFormatSupported((ID2D1DeviceContext *)This, format))
#define ID2D1DeviceContext1_IsBufferPrecisionSupported(This, bufferPrecision) \
((This)->lpVtbl->Base.IsBufferPrecisionSupported((ID2D1DeviceContext *)This, bufferPrecision))
#define ID2D1DeviceContext1_GetImageLocalBounds(This, image, localBounds) \
((This)->lpVtbl->Base.GetImageLocalBounds((ID2D1DeviceContext *)This, image, localBounds))
#define ID2D1DeviceContext1_GetImageWorldBounds(This, image, worldBounds) \
((This)->lpVtbl->Base.GetImageWorldBounds((ID2D1DeviceContext *)This, image, worldBounds))
#define ID2D1DeviceContext1_GetGlyphRunWorldBounds(This, baselineOrigin, glyphRun, measuringMode, bounds) \
((This)->lpVtbl->Base.GetGlyphRunWorldBounds((ID2D1DeviceContext *)This, baselineOrigin, glyphRun, measuringMode, bounds))
#define ID2D1DeviceContext1_GetDevice(This, device) \
((This)->lpVtbl->Base.GetDevice((ID2D1DeviceContext *)This, device))
#define ID2D1DeviceContext1_SetTarget(This, image) \
((This)->lpVtbl->Base.SetTarget((ID2D1DeviceContext *)This, image))
#define ID2D1DeviceContext1_GetTarget(This, image) \
((This)->lpVtbl->Base.GetTarget((ID2D1DeviceContext *)This, image))
#define ID2D1DeviceContext1_SetRenderingControls(This, renderingControls) \
((This)->lpVtbl->Base.SetRenderingControls((ID2D1DeviceContext *)This, renderingControls))
#define ID2D1DeviceContext1_GetRenderingControls(This, renderingControls) \
((This)->lpVtbl->Base.GetRenderingControls((ID2D1DeviceContext *)This, renderingControls))
#define ID2D1DeviceContext1_SetPrimitiveBlend(This, primitiveBlend) \
((This)->lpVtbl->Base.SetPrimitiveBlend((ID2D1DeviceContext *)This, primitiveBlend))
#define ID2D1DeviceContext1_GetPrimitiveBlend(This) \
((This)->lpVtbl->Base.GetPrimitiveBlend((ID2D1DeviceContext *)This))
#define ID2D1DeviceContext1_SetUnitMode(This, unitMode) \
((This)->lpVtbl->Base.SetUnitMode((ID2D1DeviceContext *)This, unitMode))
#define ID2D1DeviceContext1_GetUnitMode(This) \
((This)->lpVtbl->Base.GetUnitMode((ID2D1DeviceContext *)This))
#define ID2D1DeviceContext1_DrawGlyphRun(This, baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode) \
((This)->lpVtbl->Base.DrawGlyphRun((ID2D1DeviceContext *)This, baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode))
#define ID2D1DeviceContext1_DrawImage(This, image, targetOffset, imageRectangle, interpolationMode, compositeMode) \
((This)->lpVtbl->Base.DrawImage((ID2D1DeviceContext *)This, image, targetOffset, imageRectangle, interpolationMode, compositeMode))
#define ID2D1DeviceContext1_DrawGdiMetafile(This, gdiMetafile, targetOffset) \
((This)->lpVtbl->Base.DrawGdiMetafile((ID2D1DeviceContext *)This, gdiMetafile, targetOffset))
#define ID2D1DeviceContext1_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform) \
((This)->lpVtbl->Base.DrawBitmap((ID2D1DeviceContext *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform))
#define ID2D1DeviceContext1_PushLayer(This, layerParameters, layer) \
((This)->lpVtbl->Base.PushLayer((ID2D1DeviceContext *)This, layerParameters, layer))
#define ID2D1DeviceContext1_InvalidateEffectInputRectangle(This, effect, input, inputRectangle) \
((This)->lpVtbl->Base.InvalidateEffectInputRectangle((ID2D1DeviceContext *)This, effect, input, inputRectangle))
#define ID2D1DeviceContext1_GetEffectInvalidRectangleCount(This, effect, rectangleCount) \
((This)->lpVtbl->Base.GetEffectInvalidRectangleCount((ID2D1DeviceContext *)This, effect, rectangleCount))
#define ID2D1DeviceContext1_GetEffectInvalidRectangles(This, effect, rectangles, rectanglesCount) \
((This)->lpVtbl->Base.GetEffectInvalidRectangles((ID2D1DeviceContext *)This, effect, rectangles, rectanglesCount))
#define ID2D1DeviceContext1_GetEffectRequiredInputRectangles(This, renderEffect, renderImageRectangle, inputDescriptions, requiredInputRects, inputCount) \
((This)->lpVtbl->Base.GetEffectRequiredInputRectangles((ID2D1DeviceContext *)This, renderEffect, renderImageRectangle, inputDescriptions, requiredInputRects, inputCount))
#define ID2D1DeviceContext1_FillOpacityMask(This, opacityMask, brush, destinationRectangle, sourceRectangle) \
((This)->lpVtbl->Base.FillOpacityMask((ID2D1DeviceContext *)This, opacityMask, brush, destinationRectangle, sourceRectangle))
#define ID2D1DeviceContext1_CreateFilledGeometryRealization(This, geometry, flatteningTolerance, geometryRealization) \
((This)->lpVtbl->CreateFilledGeometryRealization(This, geometry, flatteningTolerance, geometryRealization))
#define ID2D1DeviceContext1_CreateStrokedGeometryRealization(This, geometry, flatteningTolerance, strokeWidth, strokeStyle, geometryRealization) \
((This)->lpVtbl->CreateStrokedGeometryRealization(This, geometry, flatteningTolerance, strokeWidth, strokeStyle, geometryRealization))
#define ID2D1DeviceContext1_DrawGeometryRealization(This, geometryRealization, brush) \
((This)->lpVtbl->DrawGeometryRealization(This, geometryRealization, brush))
typedef interface ID2D1Device1 ID2D1Device1;
typedef struct ID2D1Device1Vtbl
{
ID2D1DeviceVtbl Base;
STDMETHOD_(D2D1_RENDERING_PRIORITY, GetRenderingPriority)(
ID2D1Device1 *This
) PURE;
STDMETHOD_(void, SetRenderingPriority)(
ID2D1Device1 *This,
D2D1_RENDERING_PRIORITY renderingPriority
) PURE;
STDMETHOD(CreateDeviceContext)(
ID2D1Device1 *This,
D2D1_DEVICE_CONTEXT_OPTIONS options,
_Outptr_ ID2D1DeviceContext1 **deviceContext1
) PURE;
} ID2D1Device1Vtbl;
interface ID2D1Device1
{
CONST struct ID2D1Device1Vtbl *lpVtbl;
};
#define ID2D1Device1_QueryInterface(This, riid, ppv) \
((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
#define ID2D1Device1_AddRef(This) \
((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
#define ID2D1Device1_Release(This) \
((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
#define ID2D1Device1_GetFactory(This, factory) \
((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory))
#define ID2D1Device1_CreatePrintControl(This, wicFactory, documentTarget, printControlProperties, printControl) \
((This)->lpVtbl->Base.CreatePrintControl((ID2D1Device *)This, wicFactory, documentTarget, printControlProperties, printControl))
#define ID2D1Device1_SetMaximumTextureMemory(This, maximumInBytes) \
((This)->lpVtbl->Base.SetMaximumTextureMemory((ID2D1Device *)This, maximumInBytes))
#define ID2D1Device1_GetMaximumTextureMemory(This) \
((This)->lpVtbl->Base.GetMaximumTextureMemory((ID2D1Device *)This))
#define ID2D1Device1_ClearResources(This, millisecondsSinceUse) \
((This)->lpVtbl->Base.ClearResources((ID2D1Device *)This, millisecondsSinceUse))
#define ID2D1Device1_GetRenderingPriority(This) \
((This)->lpVtbl->GetRenderingPriority(This))
#define ID2D1Device1_SetRenderingPriority(This, renderingPriority) \
((This)->lpVtbl->SetRenderingPriority(This, renderingPriority))
#define ID2D1Device1_CreateDeviceContext(This, options, deviceContext1) \
((This)->lpVtbl->CreateDeviceContext(This, options, deviceContext1))
typedef interface ID2D1Factory2 ID2D1Factory2;
typedef struct ID2D1Factory2Vtbl
{
ID2D1Factory1Vtbl Base;
STDMETHOD(CreateDevice)(
ID2D1Factory2 *This,
_In_ IDXGIDevice *dxgiDevice,
_Outptr_ ID2D1Device1 **d2dDevice1
) PURE;
} ID2D1Factory2Vtbl;
interface ID2D1Factory2
{
CONST struct ID2D1Factory2Vtbl *lpVtbl;
};
#define ID2D1Factory2_QueryInterface(This, riid, ppv) \
((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
#define ID2D1Factory2_AddRef(This) \
((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This))
#define ID2D1Factory2_Release(This) \
((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This))
#define ID2D1Factory2_ReloadSystemMetrics(This) \
((This)->lpVtbl->Base.Base.ReloadSystemMetrics((ID2D1Factory *)This))
#define ID2D1Factory2_GetDesktopDpi(This, dpiX, dpiY) \
((This)->lpVtbl->Base.Base.GetDesktopDpi((ID2D1Factory *)This, dpiX, dpiY))
#define ID2D1Factory2_CreateRectangleGeometry(This, rectangle, rectangleGeometry) \
((This)->lpVtbl->Base.Base.CreateRectangleGeometry((ID2D1Factory *)This, rectangle, rectangleGeometry))
#define ID2D1Factory2_CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry) \
((This)->lpVtbl->Base.Base.CreateRoundedRectangleGeometry((ID2D1Factory *)This, roundedRectangle, roundedRectangleGeometry))
#define ID2D1Factory2_CreateEllipseGeometry(This, ellipse, ellipseGeometry) \
((This)->lpVtbl->Base.Base.CreateEllipseGeometry((ID2D1Factory *)This, ellipse, ellipseGeometry))
#define ID2D1Factory2_CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup) \
((This)->lpVtbl->Base.Base.CreateGeometryGroup((ID2D1Factory *)This, fillMode, geometries, geometriesCount, geometryGroup))
#define ID2D1Factory2_CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry) \
((This)->lpVtbl->Base.Base.CreateTransformedGeometry((ID2D1Factory *)This, sourceGeometry, transform, transformedGeometry))
#define ID2D1Factory2_CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget) \
((This)->lpVtbl->Base.Base.CreateWicBitmapRenderTarget((ID2D1Factory *)This, target, renderTargetProperties, renderTarget))
#define ID2D1Factory2_CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget) \
((This)->lpVtbl->Base.Base.CreateHwndRenderTarget((ID2D1Factory *)This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget))
#define ID2D1Factory2_CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget) \
((This)->lpVtbl->Base.Base.CreateDxgiSurfaceRenderTarget((ID2D1Factory *)This, dxgiSurface, renderTargetProperties, renderTarget))
#define ID2D1Factory2_CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget) \
((This)->lpVtbl->Base.Base.CreateDCRenderTarget((ID2D1Factory *)This, renderTargetProperties, dcRenderTarget))
#define ID2D1Factory2_CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle) \
((This)->lpVtbl->Base.CreateStrokeStyle((ID2D1Factory1 *)This, strokeStyleProperties, dashes, dashesCount, strokeStyle))
#define ID2D1Factory2_CreatePathGeometry(This, pathGeometry) \
((This)->lpVtbl->Base.CreatePathGeometry((ID2D1Factory1 *)This, pathGeometry))
#define ID2D1Factory2_CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock) \
((This)->lpVtbl->Base.CreateDrawingStateBlock((ID2D1Factory1 *)This, drawingStateDescription, textRenderingParams, drawingStateBlock))
#define ID2D1Factory2_CreateGdiMetafile(This, metafileStream, metafile) \
((This)->lpVtbl->Base.CreateGdiMetafile((ID2D1Factory1 *)This, metafileStream, metafile))
#define ID2D1Factory2_RegisterEffectFromStream(This, classId, propertyXml, bindings, bindingsCount, effectFactory) \
((This)->lpVtbl->Base.RegisterEffectFromStream((ID2D1Factory1 *)This, classId, propertyXml, bindings, bindingsCount, effectFactory))
#define ID2D1Factory2_RegisterEffectFromString(This, classId, propertyXml, bindings, bindingsCount, effectFactory) \
((This)->lpVtbl->Base.RegisterEffectFromString((ID2D1Factory1 *)This, classId, propertyXml, bindings, bindingsCount, effectFactory))
#define ID2D1Factory2_UnregisterEffect(This, classId) \
((This)->lpVtbl->Base.UnregisterEffect((ID2D1Factory1 *)This, classId))
#define ID2D1Factory2_GetRegisteredEffects(This, effects, effectsCount, effectsReturned, effectsRegistered) \
((This)->lpVtbl->Base.GetRegisteredEffects((ID2D1Factory1 *)This, effects, effectsCount, effectsReturned, effectsRegistered))
#define ID2D1Factory2_GetEffectProperties(This, effectId, properties) \
((This)->lpVtbl->Base.GetEffectProperties((ID2D1Factory1 *)This, effectId, properties))
#define ID2D1Factory2_CreateDevice(This, dxgiDevice, d2dDevice1) \
((This)->lpVtbl->CreateDevice(This, dxgiDevice, d2dDevice1))
typedef interface ID2D1CommandSink1 ID2D1CommandSink1;
typedef struct ID2D1CommandSink1Vtbl
{
ID2D1CommandSinkVtbl Base;
STDMETHOD(SetPrimitiveBlend1)(
ID2D1CommandSink1 *This,
D2D1_PRIMITIVE_BLEND primitiveBlend
) PURE;
} ID2D1CommandSink1Vtbl;
interface ID2D1CommandSink1
{
CONST struct ID2D1CommandSink1Vtbl *lpVtbl;
};
#define ID2D1CommandSink1_QueryInterface(This, riid, ppv) \
((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv))
#define ID2D1CommandSink1_AddRef(This) \
((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This))
#define ID2D1CommandSink1_Release(This) \
((This)->lpVtbl->Base.Base.Release((IUnknown *)This))
#define ID2D1CommandSink1_BeginDraw(This) \
((This)->lpVtbl->Base.BeginDraw((ID2D1CommandSink *)This))
#define ID2D1CommandSink1_EndDraw(This) \
((This)->lpVtbl->Base.EndDraw((ID2D1CommandSink *)This))
#define ID2D1CommandSink1_SetAntialiasMode(This, antialiasMode) \
((This)->lpVtbl->Base.SetAntialiasMode((ID2D1CommandSink *)This, antialiasMode))
#define ID2D1CommandSink1_SetTags(This, tag1, tag2) \
((This)->lpVtbl->Base.SetTags((ID2D1CommandSink *)This, tag1, tag2))
#define ID2D1CommandSink1_SetTextAntialiasMode(This, textAntialiasMode) \
((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1CommandSink *)This, textAntialiasMode))
#define ID2D1CommandSink1_SetTextRenderingParams(This, textRenderingParams) \
((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1CommandSink *)This, textRenderingParams))
#define ID2D1CommandSink1_SetTransform(This, transform) \
((This)->lpVtbl->Base.SetTransform((ID2D1CommandSink *)This, transform))
#define ID2D1CommandSink1_SetPrimitiveBlend(This, primitiveBlend) \
((This)->lpVtbl->Base.SetPrimitiveBlend((ID2D1CommandSink *)This, primitiveBlend))
#define ID2D1CommandSink1_SetUnitMode(This, unitMode) \
((This)->lpVtbl->Base.SetUnitMode((ID2D1CommandSink *)This, unitMode))
#define ID2D1CommandSink1_Clear(This, color) \
((This)->lpVtbl->Base.Clear((ID2D1CommandSink *)This, color))
#define ID2D1CommandSink1_DrawGlyphRun(This, baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode) \
((This)->lpVtbl->Base.DrawGlyphRun((ID2D1CommandSink *)This, baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode))
#define ID2D1CommandSink1_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.DrawLine((ID2D1CommandSink *)This, point0, point1, brush, strokeWidth, strokeStyle))
#define ID2D1CommandSink1_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.DrawGeometry((ID2D1CommandSink *)This, geometry, brush, strokeWidth, strokeStyle))
#define ID2D1CommandSink1_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \
((This)->lpVtbl->Base.DrawRectangle((ID2D1CommandSink *)This, rect, brush, strokeWidth, strokeStyle))
#define ID2D1CommandSink1_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform) \
((This)->lpVtbl->Base.DrawBitmap((ID2D1CommandSink *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform))
#define ID2D1CommandSink1_DrawImage(This, image, targetOffset, imageRectangle, interpolationMode, compositeMode) \
((This)->lpVtbl->Base.DrawImage((ID2D1CommandSink *)This, image, targetOffset, imageRectangle, interpolationMode, compositeMode))
#define ID2D1CommandSink1_DrawGdiMetafile(This, gdiMetafile, targetOffset) \
((This)->lpVtbl->Base.DrawGdiMetafile((ID2D1CommandSink *)This, gdiMetafile, targetOffset))
#define ID2D1CommandSink1_FillMesh(This, mesh, brush) \
((This)->lpVtbl->Base.FillMesh((ID2D1CommandSink *)This, mesh, brush))
#define ID2D1CommandSink1_FillOpacityMask(This, opacityMask, brush, destinationRectangle, sourceRectangle) \
((This)->lpVtbl->Base.FillOpacityMask((ID2D1CommandSink *)This, opacityMask, brush, destinationRectangle, sourceRectangle))
#define ID2D1CommandSink1_FillGeometry(This, geometry, brush, opacityBrush) \
((This)->lpVtbl->Base.FillGeometry((ID2D1CommandSink *)This, geometry, brush, opacityBrush))
#define ID2D1CommandSink1_FillRectangle(This, rect, brush) \
((This)->lpVtbl->Base.FillRectangle((ID2D1CommandSink *)This, rect, brush))
#define ID2D1CommandSink1_PushAxisAlignedClip(This, clipRect, antialiasMode) \
((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1CommandSink *)This, clipRect, antialiasMode))
#define ID2D1CommandSink1_PushLayer(This, layerParameters1, layer) \
((This)->lpVtbl->Base.PushLayer((ID2D1CommandSink *)This, layerParameters1, layer))
#define ID2D1CommandSink1_PopAxisAlignedClip(This) \
((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1CommandSink *)This))
#define ID2D1CommandSink1_PopLayer(This) \
((This)->lpVtbl->Base.PopLayer((ID2D1CommandSink *)This))
#define ID2D1CommandSink1_SetPrimitiveBlend1(This, primitiveBlend) \
((This)->lpVtbl->SetPrimitiveBlend1(This, primitiveBlend))
#endif
+1107 -1596
View File
File diff suppressed because it is too large Load Diff
+32
View File
@@ -215,6 +215,38 @@ namespace D2D1
return inkStyleProperties;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_RECT_U
InfiniteRectU()
{
D2D1_RECT_U rect = { 0u, 0u, UINT_MAX, UINT_MAX };
return rect;
}
COM_DECLSPEC_NOTHROW
D2D1FORCEINLINE
D2D1_SIMPLE_COLOR_PROFILE
SimpleColorProfile(
const D2D1_POINT_2F &redPrimary,
const D2D1_POINT_2F &greenPrimary,
const D2D1_POINT_2F &bluePrimary,
const D2D1_GAMMA1 gamma,
const D2D1_POINT_2F &whitePointXZ
)
{
D2D1_SIMPLE_COLOR_PROFILE simpleColorProfile;
simpleColorProfile.redPrimary = redPrimary;
simpleColorProfile.greenPrimary = greenPrimary;
simpleColorProfile.bluePrimary = bluePrimary;
simpleColorProfile.gamma = gamma;
simpleColorProfile.whitePointXZ = whitePointXZ;
return simpleColorProfile;
}
} // namespace D2D1
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
+1464 -1865
View File
File diff suppressed because it is too large Load Diff
+35 -55
View File
@@ -25,73 +25,53 @@
// Built in effect CLSIDs
DEFINE_GUID(CLSID_D2D1YCbCr, 0x99503cc1, 0x66c7, 0x45c9, 0xa8, 0x75, 0x8a, 0xd8, 0xa7, 0x91, 0x44, 0x01);
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_YCBCR_PROP
//
// Synopsis:
// The enumeration of the YCbCr effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the YCbCr effect's top level properties.
/// </summary>
typedef enum D2D1_YCBCR_PROP
{
//
// Property Name: "ChromaSubsampling"
// Property Type: D2D1_YCBCR_CHROMA_SUBSAMPLING
//
D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0,
//
// Property Name: "TransformMatrix"
// Property Type: D2D1_MATRIX_3X2_F
//
D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1,
//
// Property Name: "InterpolationMode"
// Property Type: D2D1_YCBCR_INTERPOLATION_MODE
//
D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2,
D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "ChromaSubsampling"
/// Property Type: D2D1_YCBCR_CHROMA_SUBSAMPLING
/// </summary>
D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0,
/// <summary>
/// Property Name: "TransformMatrix"
/// Property Type: D2D1_MATRIX_3X2_F
/// </summary>
D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1,
/// <summary>
/// Property Name: "InterpolationMode"
/// Property Type: D2D1_YCBCR_INTERPOLATION_MODE
/// </summary>
D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2,
D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_YCBCR_CHROMA_SUBSAMPLING
//
//------------------------------------------------------------------------------
typedef enum D2D1_YCBCR_CHROMA_SUBSAMPLING
{
D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0,
D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1,
D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2,
D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3,
D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4,
D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff
D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0,
D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1,
D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2,
D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3,
D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4,
D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_CHROMA_SUBSAMPLING;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_YCBCR_INTERPOLATION_MODE
//
//------------------------------------------------------------------------------
typedef enum D2D1_YCBCR_INTERPOLATION_MODE
{
D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1,
D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2,
D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4,
D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5,
D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0,
D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1,
D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2,
D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4,
D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5,
D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_YCBCR_INTERPOLATION_MODE;
+372 -431
View File
@@ -41,553 +41,494 @@ DEFINE_GUID(CLSID_D2D1EdgeDetection, 0xEFF583CA, 0xCB07, 0x4AA9, 0xAC
DEFINE_GUID(CLSID_D2D1HighlightsShadows, 0xCADC8384, 0x323F, 0x4C7E, 0xA3, 0x61, 0x2E, 0x2B, 0x24, 0xDF, 0x6E, 0xE4);
DEFINE_GUID(CLSID_D2D1LookupTable3D, 0x349E0EDA, 0x0088, 0x4A79, 0x9C, 0xA3, 0xC7, 0xE3, 0x00, 0x20, 0x20, 0x20);
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_CONTRAST_PROP
//
// Synopsis:
// The enumeration of the Contrast effect's top level properties.
//
//------------------------------------------------------------------------------
DEFINE_GUID(CLSID_D2D1Opacity, 0x811d79a4, 0xde28, 0x4454, 0x80, 0x94, 0xc6, 0x46, 0x85, 0xf8, 0xbd, 0x4c);
DEFINE_GUID(CLSID_D2D1AlphaMask, 0xc80ecff0, 0x3fd5, 0x4f05, 0x83, 0x28, 0xc5, 0xd1, 0x72, 0x4b, 0x4f, 0x0a);
DEFINE_GUID(CLSID_D2D1CrossFade, 0x12f575e8, 0x4db1, 0x485f, 0x9a, 0x84, 0x03, 0xa0, 0x7d, 0xd3, 0x82, 0x9f);
DEFINE_GUID(CLSID_D2D1Tint, 0x36312b17, 0xf7dd, 0x4014, 0x91, 0x5d, 0xff, 0xca, 0x76, 0x8c, 0xf2, 0x11);
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// The enumeration of the Contrast effect's top level properties.
/// </summary>
typedef enum D2D1_CONTRAST_PROP
{
//
// Property Name: "Contrast"
// Property Type: FLOAT
//
D2D1_CONTRAST_PROP_CONTRAST = 0,
//
// Property Name: "ClampInput"
// Property Type: BOOL
//
D2D1_CONTRAST_PROP_CLAMP_INPUT = 1,
D2D1_CONTRAST_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Contrast"
/// Property Type: FLOAT
/// </summary>
D2D1_CONTRAST_PROP_CONTRAST = 0,
/// <summary>
/// Property Name: "ClampInput"
/// Property Type: BOOL
/// </summary>
D2D1_CONTRAST_PROP_CLAMP_INPUT = 1,
D2D1_CONTRAST_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CONTRAST_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_RGBTOHUE_PROP
//
// Synopsis:
// The enumeration of the RgbToHue effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the RgbToHue effect's top level properties.
/// </summary>
typedef enum D2D1_RGBTOHUE_PROP
{
//
// Property Name: "OutputColorSpace"
// Property Type: D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
//
D2D1_RGBTOHUE_PROP_OUTPUT_COLOR_SPACE = 0,
D2D1_RGBTOHUE_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "OutputColorSpace"
/// Property Type: D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
/// </summary>
D2D1_RGBTOHUE_PROP_OUTPUT_COLOR_SPACE = 0,
D2D1_RGBTOHUE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_RGBTOHUE_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
//
//------------------------------------------------------------------------------
typedef enum D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE
{
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
} D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_HUETORGB_PROP
//
// Synopsis:
// The enumeration of the HueToRgb effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the HueToRgb effect's top level properties.
/// </summary>
typedef enum D2D1_HUETORGB_PROP
{
//
// Property Name: "InputColorSpace"
// Property Type: D2D1_HUETORGB_INPUT_COLOR_SPACE
//
D2D1_HUETORGB_PROP_INPUT_COLOR_SPACE = 0,
D2D1_HUETORGB_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "InputColorSpace"
/// Property Type: D2D1_HUETORGB_INPUT_COLOR_SPACE
/// </summary>
D2D1_HUETORGB_PROP_INPUT_COLOR_SPACE = 0,
D2D1_HUETORGB_PROP_FORCE_DWORD = 0xffffffff
} D2D1_HUETORGB_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_HUETORGB_INPUT_COLOR_SPACE
//
//------------------------------------------------------------------------------
typedef enum D2D1_HUETORGB_INPUT_COLOR_SPACE
{
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_HUETORGB_INPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_VALUE = 0,
D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS = 1,
D2D1_HUETORGB_INPUT_COLOR_SPACE_FORCE_DWORD = 0xffffffff
} D2D1_HUETORGB_INPUT_COLOR_SPACE;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_CHROMAKEY_PROP
//
// Synopsis:
// The enumeration of the Chroma Key effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Chroma Key effect's top level properties.
/// </summary>
typedef enum D2D1_CHROMAKEY_PROP
{
//
// Property Name: "Color"
// Property Type: D2D1_VECTOR_3F
//
D2D1_CHROMAKEY_PROP_COLOR = 0,
//
// Property Name: "Tolerance"
// Property Type: FLOAT
//
D2D1_CHROMAKEY_PROP_TOLERANCE = 1,
//
// Property Name: "InvertAlpha"
// Property Type: BOOL
//
D2D1_CHROMAKEY_PROP_INVERT_ALPHA = 2,
//
// Property Name: "Feather"
// Property Type: BOOL
//
D2D1_CHROMAKEY_PROP_FEATHER = 3,
D2D1_CHROMAKEY_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_3F
/// </summary>
D2D1_CHROMAKEY_PROP_COLOR = 0,
/// <summary>
/// Property Name: "Tolerance"
/// Property Type: FLOAT
/// </summary>
D2D1_CHROMAKEY_PROP_TOLERANCE = 1,
/// <summary>
/// Property Name: "InvertAlpha"
/// Property Type: BOOL
/// </summary>
D2D1_CHROMAKEY_PROP_INVERT_ALPHA = 2,
/// <summary>
/// Property Name: "Feather"
/// Property Type: BOOL
/// </summary>
D2D1_CHROMAKEY_PROP_FEATHER = 3,
D2D1_CHROMAKEY_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CHROMAKEY_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_EMBOSS_PROP
//
// Synopsis:
// The enumeration of the Emboss effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Emboss effect's top level properties.
/// </summary>
typedef enum D2D1_EMBOSS_PROP
{
//
// Property Name: "Height"
// Property Type: FLOAT
//
D2D1_EMBOSS_PROP_HEIGHT = 0,
//
// Property Name: "Direction"
// Property Type: FLOAT
//
D2D1_EMBOSS_PROP_DIRECTION = 1,
D2D1_EMBOSS_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Height"
/// Property Type: FLOAT
/// </summary>
D2D1_EMBOSS_PROP_HEIGHT = 0,
/// <summary>
/// Property Name: "Direction"
/// Property Type: FLOAT
/// </summary>
D2D1_EMBOSS_PROP_DIRECTION = 1,
D2D1_EMBOSS_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EMBOSS_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_EXPOSURE_PROP
//
// Synopsis:
// The enumeration of the Exposure effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Exposure effect's top level properties.
/// </summary>
typedef enum D2D1_EXPOSURE_PROP
{
//
// Property Name: "ExposureValue"
// Property Type: FLOAT
//
D2D1_EXPOSURE_PROP_EXPOSURE_VALUE = 0,
D2D1_EXPOSURE_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "ExposureValue"
/// Property Type: FLOAT
/// </summary>
D2D1_EXPOSURE_PROP_EXPOSURE_VALUE = 0,
D2D1_EXPOSURE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EXPOSURE_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_POSTERIZE_PROP
//
// Synopsis:
// The enumeration of the Posterize effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Posterize effect's top level properties.
/// </summary>
typedef enum D2D1_POSTERIZE_PROP
{
//
// Property Name: "RedValueCount"
// Property Type: UINT32
//
D2D1_POSTERIZE_PROP_RED_VALUE_COUNT = 0,
//
// Property Name: "GreenValueCount"
// Property Type: UINT32
//
D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT = 1,
//
// Property Name: "BlueValueCount"
// Property Type: UINT32
//
D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT = 2,
D2D1_POSTERIZE_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "RedValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_RED_VALUE_COUNT = 0,
/// <summary>
/// Property Name: "GreenValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT = 1,
/// <summary>
/// Property Name: "BlueValueCount"
/// Property Type: UINT32
/// </summary>
D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT = 2,
D2D1_POSTERIZE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_POSTERIZE_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_SEPIA_PROP
//
// Synopsis:
// The enumeration of the Sepia effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Sepia effect's top level properties.
/// </summary>
typedef enum D2D1_SEPIA_PROP
{
//
// Property Name: "Intensity"
// Property Type: FLOAT
//
D2D1_SEPIA_PROP_INTENSITY = 0,
//
// Property Name: "AlphaMode"
// Property Type: D2D1_ALPHA_MODE
//
D2D1_SEPIA_PROP_ALPHA_MODE = 1,
D2D1_SEPIA_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Intensity"
/// Property Type: FLOAT
/// </summary>
D2D1_SEPIA_PROP_INTENSITY = 0,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_SEPIA_PROP_ALPHA_MODE = 1,
D2D1_SEPIA_PROP_FORCE_DWORD = 0xffffffff
} D2D1_SEPIA_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_SHARPEN_PROP
//
// Synopsis:
// The enumeration of the Sharpen effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Sharpen effect's top level properties.
/// </summary>
typedef enum D2D1_SHARPEN_PROP
{
//
// Property Name: "Sharpness"
// Property Type: FLOAT
//
D2D1_SHARPEN_PROP_SHARPNESS = 0,
//
// Property Name: "Threshold"
// Property Type: FLOAT
//
D2D1_SHARPEN_PROP_THRESHOLD = 1,
D2D1_SHARPEN_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Sharpness"
/// Property Type: FLOAT
/// </summary>
D2D1_SHARPEN_PROP_SHARPNESS = 0,
/// <summary>
/// Property Name: "Threshold"
/// Property Type: FLOAT
/// </summary>
D2D1_SHARPEN_PROP_THRESHOLD = 1,
D2D1_SHARPEN_PROP_FORCE_DWORD = 0xffffffff
} D2D1_SHARPEN_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_STRAIGHTEN_PROP
//
// Synopsis:
// The enumeration of the Straighten effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Straighten effect's top level properties.
/// </summary>
typedef enum D2D1_STRAIGHTEN_PROP
{
//
// Property Name: "Angle"
// Property Type: FLOAT
//
D2D1_STRAIGHTEN_PROP_ANGLE = 0,
//
// Property Name: "MaintainSize"
// Property Type: BOOL
//
D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE = 1,
//
// Property Name: "ScaleMode"
// Property Type: D2D1_STRAIGHTEN_SCALE_MODE
//
D2D1_STRAIGHTEN_PROP_SCALE_MODE = 2,
D2D1_STRAIGHTEN_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Angle"
/// Property Type: FLOAT
/// </summary>
D2D1_STRAIGHTEN_PROP_ANGLE = 0,
/// <summary>
/// Property Name: "MaintainSize"
/// Property Type: BOOL
/// </summary>
D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE = 1,
/// <summary>
/// Property Name: "ScaleMode"
/// Property Type: D2D1_STRAIGHTEN_SCALE_MODE
/// </summary>
D2D1_STRAIGHTEN_PROP_SCALE_MODE = 2,
D2D1_STRAIGHTEN_PROP_FORCE_DWORD = 0xffffffff
} D2D1_STRAIGHTEN_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_STRAIGHTEN_SCALE_MODE
//
//------------------------------------------------------------------------------
typedef enum D2D1_STRAIGHTEN_SCALE_MODE
{
D2D1_STRAIGHTEN_SCALE_MODE_NEAREST_NEIGHBOR = 0,
D2D1_STRAIGHTEN_SCALE_MODE_LINEAR = 1,
D2D1_STRAIGHTEN_SCALE_MODE_CUBIC = 2,
D2D1_STRAIGHTEN_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_STRAIGHTEN_SCALE_MODE_ANISOTROPIC = 4,
D2D1_STRAIGHTEN_SCALE_MODE_FORCE_DWORD = 0xffffffff
D2D1_STRAIGHTEN_SCALE_MODE_NEAREST_NEIGHBOR = 0,
D2D1_STRAIGHTEN_SCALE_MODE_LINEAR = 1,
D2D1_STRAIGHTEN_SCALE_MODE_CUBIC = 2,
D2D1_STRAIGHTEN_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3,
D2D1_STRAIGHTEN_SCALE_MODE_ANISOTROPIC = 4,
D2D1_STRAIGHTEN_SCALE_MODE_FORCE_DWORD = 0xffffffff
} D2D1_STRAIGHTEN_SCALE_MODE;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_TEMPERATUREANDTINT_PROP
//
// Synopsis:
// The enumeration of the Temperature And Tint effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Temperature And Tint effect's top level properties.
/// </summary>
typedef enum D2D1_TEMPERATUREANDTINT_PROP
{
//
// Property Name: "Temperature"
// Property Type: FLOAT
//
D2D1_TEMPERATUREANDTINT_PROP_TEMPERATURE = 0,
//
// Property Name: "Tint"
// Property Type: FLOAT
//
D2D1_TEMPERATUREANDTINT_PROP_TINT = 1,
D2D1_TEMPERATUREANDTINT_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Temperature"
/// Property Type: FLOAT
/// </summary>
D2D1_TEMPERATUREANDTINT_PROP_TEMPERATURE = 0,
/// <summary>
/// Property Name: "Tint"
/// Property Type: FLOAT
/// </summary>
D2D1_TEMPERATUREANDTINT_PROP_TINT = 1,
D2D1_TEMPERATUREANDTINT_PROP_FORCE_DWORD = 0xffffffff
} D2D1_TEMPERATUREANDTINT_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_VIGNETTE_PROP
//
// Synopsis:
// The enumeration of the Vignette effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Vignette effect's top level properties.
/// </summary>
typedef enum D2D1_VIGNETTE_PROP
{
//
// Property Name: "Color"
// Property Type: D2D1_VECTOR_4F
//
D2D1_VIGNETTE_PROP_COLOR = 0,
//
// Property Name: "TransitionSize"
// Property Type: FLOAT
//
D2D1_VIGNETTE_PROP_TRANSITION_SIZE = 1,
//
// Property Name: "Strength"
// Property Type: FLOAT
//
D2D1_VIGNETTE_PROP_STRENGTH = 2,
D2D1_VIGNETTE_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_4F
/// </summary>
D2D1_VIGNETTE_PROP_COLOR = 0,
/// <summary>
/// Property Name: "TransitionSize"
/// Property Type: FLOAT
/// </summary>
D2D1_VIGNETTE_PROP_TRANSITION_SIZE = 1,
/// <summary>
/// Property Name: "Strength"
/// Property Type: FLOAT
/// </summary>
D2D1_VIGNETTE_PROP_STRENGTH = 2,
D2D1_VIGNETTE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_VIGNETTE_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_EDGEDETECTION_PROP
//
// Synopsis:
// The enumeration of the Edge Detection effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Edge Detection effect's top level properties.
/// </summary>
typedef enum D2D1_EDGEDETECTION_PROP
{
//
// Property Name: "Strength"
// Property Type: FLOAT
//
D2D1_EDGEDETECTION_PROP_STRENGTH = 0,
//
// Property Name: "BlurRadius"
// Property Type: FLOAT
//
D2D1_EDGEDETECTION_PROP_BLUR_RADIUS = 1,
//
// Property Name: "Mode"
// Property Type: D2D1_EDGEDETECTION_MODE
//
D2D1_EDGEDETECTION_PROP_MODE = 2,
//
// Property Name: "OverlayEdges"
// Property Type: BOOL
//
D2D1_EDGEDETECTION_PROP_OVERLAY_EDGES = 3,
//
// Property Name: "AlphaMode"
// Property Type: D2D1_ALPHA_MODE
//
D2D1_EDGEDETECTION_PROP_ALPHA_MODE = 4,
D2D1_EDGEDETECTION_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Strength"
/// Property Type: FLOAT
/// </summary>
D2D1_EDGEDETECTION_PROP_STRENGTH = 0,
/// <summary>
/// Property Name: "BlurRadius"
/// Property Type: FLOAT
/// </summary>
D2D1_EDGEDETECTION_PROP_BLUR_RADIUS = 1,
/// <summary>
/// Property Name: "Mode"
/// Property Type: D2D1_EDGEDETECTION_MODE
/// </summary>
D2D1_EDGEDETECTION_PROP_MODE = 2,
/// <summary>
/// Property Name: "OverlayEdges"
/// Property Type: BOOL
/// </summary>
D2D1_EDGEDETECTION_PROP_OVERLAY_EDGES = 3,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_EDGEDETECTION_PROP_ALPHA_MODE = 4,
D2D1_EDGEDETECTION_PROP_FORCE_DWORD = 0xffffffff
} D2D1_EDGEDETECTION_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_EDGEDETECTION_MODE
//
//------------------------------------------------------------------------------
typedef enum D2D1_EDGEDETECTION_MODE
{
D2D1_EDGEDETECTION_MODE_SOBEL = 0,
D2D1_EDGEDETECTION_MODE_PREWITT = 1,
D2D1_EDGEDETECTION_MODE_FORCE_DWORD = 0xffffffff
D2D1_EDGEDETECTION_MODE_SOBEL = 0,
D2D1_EDGEDETECTION_MODE_PREWITT = 1,
D2D1_EDGEDETECTION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_EDGEDETECTION_MODE;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_HIGHLIGHTSANDSHADOWS_PROP
//
// Synopsis:
// The enumeration of the Highlights and Shadows effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Highlights and Shadows effect's top level properties.
/// </summary>
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_PROP
{
//
// Property Name: "Highlights"
// Property Type: FLOAT
//
D2D1_HIGHLIGHTSANDSHADOWS_PROP_HIGHLIGHTS = 0,
//
// Property Name: "Shadows"
// Property Type: FLOAT
//
D2D1_HIGHLIGHTSANDSHADOWS_PROP_SHADOWS = 1,
//
// Property Name: "Clarity"
// Property Type: FLOAT
//
D2D1_HIGHLIGHTSANDSHADOWS_PROP_CLARITY = 2,
//
// Property Name: "InputGamma"
// Property Type: D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
//
D2D1_HIGHLIGHTSANDSHADOWS_PROP_INPUT_GAMMA = 3,
//
// Property Name: "MaskBlurRadius"
// Property Type: FLOAT
//
D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS = 4,
D2D1_HIGHLIGHTSANDSHADOWS_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Highlights"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_HIGHLIGHTS = 0,
/// <summary>
/// Property Name: "Shadows"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_SHADOWS = 1,
/// <summary>
/// Property Name: "Clarity"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_CLARITY = 2,
/// <summary>
/// Property Name: "InputGamma"
/// Property Type: D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_INPUT_GAMMA = 3,
/// <summary>
/// Property Name: "MaskBlurRadius"
/// Property Type: FLOAT
/// </summary>
D2D1_HIGHLIGHTSANDSHADOWS_PROP_MASK_BLUR_RADIUS = 4,
D2D1_HIGHLIGHTSANDSHADOWS_PROP_FORCE_DWORD = 0xffffffff
} D2D1_HIGHLIGHTSANDSHADOWS_PROP;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
//
//------------------------------------------------------------------------------
typedef enum D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA
{
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_LINEAR = 0,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_SRGB = 1,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_FORCE_DWORD = 0xffffffff
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_LINEAR = 0,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_SRGB = 1,
D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA_FORCE_DWORD = 0xffffffff
} D2D1_HIGHLIGHTSANDSHADOWS_INPUT_GAMMA;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_LOOKUPTABLE3D_PROP
//
// Synopsis:
// The enumeration of the Lookup Table 3D effect's top level properties.
//
//------------------------------------------------------------------------------
/// <summary>
/// The enumeration of the Lookup Table 3D effect's top level properties.
/// </summary>
typedef enum D2D1_LOOKUPTABLE3D_PROP
{
//
// Property Name: "Lut"
// Property Type: IUnknown *
//
D2D1_LOOKUPTABLE3D_PROP_LUT = 0,
//
// Property Name: "AlphaMode"
// Property Type: D2D1_ALPHA_MODE
//
D2D1_LOOKUPTABLE3D_PROP_ALPHA_MODE = 1,
D2D1_LOOKUPTABLE3D_PROP_FORCE_DWORD = 0xffffffff
/// <summary>
/// Property Name: "Lut"
/// Property Type: IUnknown *
/// </summary>
D2D1_LOOKUPTABLE3D_PROP_LUT = 0,
/// <summary>
/// Property Name: "AlphaMode"
/// Property Type: D2D1_ALPHA_MODE
/// </summary>
D2D1_LOOKUPTABLE3D_PROP_ALPHA_MODE = 1,
D2D1_LOOKUPTABLE3D_PROP_FORCE_DWORD = 0xffffffff
} D2D1_LOOKUPTABLE3D_PROP;
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// The enumeration of the Opacity effect's top level properties.
/// </summary>
typedef enum D2D1_OPACITY_PROP
{
/// <summary>
/// Property Name: "Opacity"
/// Property Type: FLOAT
/// </summary>
D2D1_OPACITY_PROP_OPACITY = 0,
D2D1_OPACITY_PROP_FORCE_DWORD = 0xffffffff
} D2D1_OPACITY_PROP;
/// <summary>
/// The enumeration of the Cross Fade effect's top level properties.
/// </summary>
typedef enum D2D1_CROSSFADE_PROP
{
/// <summary>
/// Property Name: "Weight"
/// Property Type: FLOAT
/// </summary>
D2D1_CROSSFADE_PROP_WEIGHT = 0,
D2D1_CROSSFADE_PROP_FORCE_DWORD = 0xffffffff
} D2D1_CROSSFADE_PROP;
/// <summary>
/// The enumeration of the Tint effect's top level properties.
/// </summary>
typedef enum D2D1_TINT_PROP
{
/// <summary>
/// Property Name: "Color"
/// Property Type: D2D1_VECTOR_4F
/// </summary>
D2D1_TINT_PROP_COLOR = 0,
/// <summary>
/// Property Name: "ClampOutput"
/// Property Type: BOOL
/// </summary>
D2D1_TINT_PROP_CLAMP_OUTPUT = 1,
D2D1_TINT_PROP_FORCE_DWORD = 0xffffffff
} D2D1_TINT_PROP;
#endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
+1 -1
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
+22 -3
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -7306,7 +7306,9 @@ enum D3D11_FEATURE
D3D11_FEATURE_D3D9_OPTIONS1 = ( D3D11_FEATURE_MARKER_SUPPORT + 1 ) ,
D3D11_FEATURE_D3D11_OPTIONS2 = ( D3D11_FEATURE_D3D9_OPTIONS1 + 1 ) ,
D3D11_FEATURE_D3D11_OPTIONS3 = ( D3D11_FEATURE_D3D11_OPTIONS2 + 1 ) ,
D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = ( D3D11_FEATURE_D3D11_OPTIONS3 + 1 )
D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = ( D3D11_FEATURE_D3D11_OPTIONS3 + 1 ) ,
D3D11_FEATURE_D3D11_OPTIONS4 = ( D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT + 1 ) ,
D3D11_FEATURE_SHADER_CACHE = ( D3D11_FEATURE_D3D11_OPTIONS4 + 1 )
} D3D11_FEATURE;
typedef struct D3D11_FEATURE_DATA_THREADING
@@ -7463,6 +7465,19 @@ typedef struct D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT
UINT MaxGPUVirtualAddressBitsPerProcess;
} D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT;
typedef
enum D3D11_SHADER_CACHE_SUPPORT_FLAGS
{
D3D11_SHADER_CACHE_SUPPORT_NONE = 0,
D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x1,
D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x2
} D3D11_SHADER_CACHE_SUPPORT_FLAGS;
typedef struct D3D11_FEATURE_DATA_SHADER_CACHE
{
UINT SupportFlags;
} D3D11_FEATURE_DATA_SHADER_CACHE;
extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_c_ifspec;
@@ -9661,6 +9676,9 @@ DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_NOGMC, 0xed418a9f, 0x0
DEFINE_GUID(D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_GMC, 0xab998b5b, 0x4258,0x44a9,0x9f,0xeb,0x94,0xe5,0x97,0xa6,0xba,0xae);
DEFINE_GUID(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN, 0x5b11d51b, 0x2f4c,0x4452,0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);
DEFINE_GUID(D3D11_DECODER_PROFILE_HEVC_VLD_MAIN10, 0x107af0e0, 0xef1a,0x4d19,0xab,0xa8,0x67,0xa1,0x63,0x07,0x3d,0x13);
DEFINE_GUID(D3D11_DECODER_PROFILE_VP9_VLD_PROFILE0, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);
DEFINE_GUID(D3D11_DECODER_PROFILE_VP9_VLD_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
DEFINE_GUID(D3D11_DECODER_PROFILE_VP8_VLD, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);
typedef struct D3D11_VIDEO_DECODER_DESC
{
GUID Guid;
@@ -9929,7 +9947,8 @@ enum D3D11_VIDEO_PROCESSOR_FEATURE_CAPS
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_STREAM = 0x80,
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_PIXEL_ASPECT_RATIO = 0x100,
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_MIRROR = 0x200,
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x400
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x400,
D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_METADATA_HDR10 = 0x800
} D3D11_VIDEO_PROCESSOR_FEATURE_CAPS;
typedef
+1 -1
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
+1 -1
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
+2019 -4
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
+2635 -31
View File
File diff suppressed because it is too large Load Diff
+669 -32
View File
@@ -8,7 +8,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
@@ -50,6 +50,27 @@ typedef interface ID3D12Debug ID3D12Debug;
#endif /* __ID3D12Debug_FWD_DEFINED__ */
#ifndef __ID3D12Debug1_FWD_DEFINED__
#define __ID3D12Debug1_FWD_DEFINED__
typedef interface ID3D12Debug1 ID3D12Debug1;
#endif /* __ID3D12Debug1_FWD_DEFINED__ */
#ifndef __ID3D12Debug2_FWD_DEFINED__
#define __ID3D12Debug2_FWD_DEFINED__
typedef interface ID3D12Debug2 ID3D12Debug2;
#endif /* __ID3D12Debug2_FWD_DEFINED__ */
#ifndef __ID3D12DebugDevice1_FWD_DEFINED__
#define __ID3D12DebugDevice1_FWD_DEFINED__
typedef interface ID3D12DebugDevice1 ID3D12DebugDevice1;
#endif /* __ID3D12DebugDevice1_FWD_DEFINED__ */
#ifndef __ID3D12DebugDevice_FWD_DEFINED__
#define __ID3D12DebugDevice_FWD_DEFINED__
typedef interface ID3D12DebugDevice ID3D12DebugDevice;
@@ -64,6 +85,13 @@ typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue;
#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */
#ifndef __ID3D12DebugCommandList1_FWD_DEFINED__
#define __ID3D12DebugCommandList1_FWD_DEFINED__
typedef interface ID3D12DebugCommandList1 ID3D12DebugCommandList1;
#endif /* __ID3D12DebugCommandList1_FWD_DEFINED__ */
#ifndef __ID3D12DebugCommandList_FWD_DEFINED__
#define __ID3D12DebugCommandList_FWD_DEFINED__
typedef interface ID3D12DebugCommandList ID3D12DebugCommandList;
@@ -176,18 +204,201 @@ EXTERN_C const IID IID_ID3D12Debug;
#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */
#ifndef __ID3D12Debug1_INTERFACE_DEFINED__
#define __ID3D12Debug1_INTERFACE_DEFINED__
/* interface ID3D12Debug1 */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D12Debug1;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("affaa4ca-63fe-4d8e-b8ad-159000af4304")
ID3D12Debug1 : public IUnknown
{
public:
virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation(
BOOL Enable) = 0;
virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation(
BOOL Enable) = 0;
};
#else /* C style interface */
typedef struct ID3D12Debug1Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Debug1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Debug1 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Debug1 * This);
void ( STDMETHODCALLTYPE *EnableDebugLayer )(
ID3D12Debug1 * This);
void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
ID3D12Debug1 * This,
BOOL Enable);
void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
ID3D12Debug1 * This,
BOOL Enable);
END_INTERFACE
} ID3D12Debug1Vtbl;
interface ID3D12Debug1
{
CONST_VTBL struct ID3D12Debug1Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D12Debug1_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D12Debug1_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D12Debug1_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D12Debug1_EnableDebugLayer(This) \
( (This)->lpVtbl -> EnableDebugLayer(This) )
#define ID3D12Debug1_SetEnableGPUBasedValidation(This,Enable) \
( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
#define ID3D12Debug1_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D12Debug1_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0002 */
/* [local] */
typedef
enum D3D12_DEBUG_FEATURE
enum D3D12_GPU_BASED_VALIDATION_FLAGS
{
D3D12_DEBUG_FEATURE_NONE = 0,
D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DRAW = 0x1,
D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DISPATCH = 0x2
} D3D12_DEBUG_FEATURE;
D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0,
D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x1
} D3D12_GPU_BASED_VALIDATION_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS)
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_s_ifspec;
#ifndef __ID3D12Debug2_INTERFACE_DEFINED__
#define __ID3D12Debug2_INTERFACE_DEFINED__
/* interface ID3D12Debug2 */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D12Debug2;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("93a665c4-a3b2-4e5d-b692-a26ae14e3374")
ID3D12Debug2 : public IUnknown
{
public:
virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags(
D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0;
};
#else /* C style interface */
typedef struct ID3D12Debug2Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Debug2 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Debug2 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Debug2 * This);
void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
ID3D12Debug2 * This,
D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
END_INTERFACE
} ID3D12Debug2Vtbl;
interface ID3D12Debug2
{
CONST_VTBL struct ID3D12Debug2Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D12Debug2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D12Debug2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D12Debug2_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D12Debug2_SetGPUBasedValidationFlags(This,Flags) \
( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D12Debug2_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0003 */
/* [local] */
DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEBUG_FEATURE );
typedef
enum D3D12_RLDO_FLAGS
{
@@ -198,10 +409,169 @@ enum D3D12_RLDO_FLAGS
} D3D12_RLDO_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS)
typedef
enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE
{
D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0,
D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = ( D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS + 1 ) ,
D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = ( D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS + 1 )
} D3D12_DEBUG_DEVICE_PARAMETER_TYPE;
typedef
enum D3D12_DEBUG_FEATURE
{
D3D12_DEBUG_FEATURE_NONE = 0,
D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x1,
D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x2,
D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x4,
D3D12_DEBUG_FEATURE_VALID_MASK = ( ( D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS | D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING ) | D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION )
} D3D12_DEBUG_FEATURE;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE)
typedef
enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE
{
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0,
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE + 1 ) ,
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY + 1 ) ,
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION + 1 ) ,
NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION + 1 )
} D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE;
typedef
enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS
{
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0,
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x1,
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x2,
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x4,
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x7
} D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS)
typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS
{
UINT MaxMessagesPerCommandList;
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode;
D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags;
} D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS;
typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR
{
FLOAT SlowdownFactor;
} D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0003_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0003_v0_0_s_ifspec;
#ifndef __ID3D12DebugDevice1_INTERFACE_DEFINED__
#define __ID3D12DebugDevice1_INTERFACE_DEFINED__
/* interface ID3D12DebugDevice1 */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D12DebugDevice1;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a9b71770-d099-4a65-a698-3dee10020f88")
ID3D12DebugDevice1 : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
_In_reads_bytes_(DataSize) const void *pData,
UINT DataSize) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
_Out_writes_bytes_(DataSize) void *pData,
UINT DataSize) = 0;
virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
D3D12_RLDO_FLAGS Flags) = 0;
};
#else /* C style interface */
typedef struct ID3D12DebugDevice1Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DebugDevice1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DebugDevice1 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DebugDevice1 * This);
HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
ID3D12DebugDevice1 * This,
D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
_In_reads_bytes_(DataSize) const void *pData,
UINT DataSize);
HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
ID3D12DebugDevice1 * This,
D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
_Out_writes_bytes_(DataSize) void *pData,
UINT DataSize);
HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
ID3D12DebugDevice1 * This,
D3D12_RLDO_FLAGS Flags);
END_INTERFACE
} ID3D12DebugDevice1Vtbl;
interface ID3D12DebugDevice1
{
CONST_VTBL struct ID3D12DebugDevice1Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D12DebugDevice1_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D12DebugDevice1_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D12DebugDevice1_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D12DebugDevice1_SetDebugParameter(This,Type,pData,DataSize) \
( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
#define ID3D12DebugDevice1_GetDebugParameter(This,Type,pData,DataSize) \
( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
#define ID3D12DebugDevice1_ReportLiveDeviceObjects(This,Flags) \
( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D12DebugDevice1_INTERFACE_DEFINED__ */
#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__
#define __ID3D12DebugDevice_INTERFACE_DEFINED__
@@ -300,14 +670,14 @@ EXTERN_C const IID IID_ID3D12DebugDevice;
#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0002 */
/* interface __MIDL_itf_d3d12sdklayers_0000_0005 */
/* [local] */
DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95);
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0002_v0_0_s_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_s_ifspec;
#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
@@ -392,6 +762,136 @@ EXTERN_C const IID IID_ID3D12DebugCommandQueue;
#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0006 */
/* [local] */
typedef
enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE
{
D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0
} D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE;
typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS
{
D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode;
} D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0006_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0006_v0_0_s_ifspec;
#ifndef __ID3D12DebugCommandList1_INTERFACE_DEFINED__
#define __ID3D12DebugCommandList1_INTERFACE_DEFINED__
/* interface ID3D12DebugCommandList1 */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D12DebugCommandList1;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("102ca951-311b-4b01-b11f-ecb83e061b37")
ID3D12DebugCommandList1 : public IUnknown
{
public:
virtual BOOL STDMETHODCALLTYPE AssertResourceState(
_In_ ID3D12Resource *pResource,
UINT Subresource,
UINT State) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
_In_reads_bytes_(DataSize) const void *pData,
UINT DataSize) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
_Out_writes_bytes_(DataSize) void *pData,
UINT DataSize) = 0;
};
#else /* C style interface */
typedef struct ID3D12DebugCommandList1Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DebugCommandList1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DebugCommandList1 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DebugCommandList1 * This);
BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
ID3D12DebugCommandList1 * This,
_In_ ID3D12Resource *pResource,
UINT Subresource,
UINT State);
HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
ID3D12DebugCommandList1 * This,
D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
_In_reads_bytes_(DataSize) const void *pData,
UINT DataSize);
HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
ID3D12DebugCommandList1 * This,
D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
_Out_writes_bytes_(DataSize) void *pData,
UINT DataSize);
END_INTERFACE
} ID3D12DebugCommandList1Vtbl;
interface ID3D12DebugCommandList1
{
CONST_VTBL struct ID3D12DebugCommandList1Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D12DebugCommandList1_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D12DebugCommandList1_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D12DebugCommandList1_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D12DebugCommandList1_AssertResourceState(This,pResource,Subresource,State) \
( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
#define ID3D12DebugCommandList1_SetDebugParameter(This,Type,pData,DataSize) \
( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
#define ID3D12DebugCommandList1_GetDebugParameter(This,Type,pData,DataSize) \
( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D12DebugCommandList1_INTERFACE_DEFINED__ */
#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__
#define __ID3D12DebugCommandList_INTERFACE_DEFINED__
@@ -493,7 +993,7 @@ EXTERN_C const IID IID_ID3D12DebugCommandList;
#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0004 */
/* interface __MIDL_itf_d3d12sdklayers_0000_0008 */
/* [local] */
typedef
@@ -929,10 +1429,10 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + 1 ) ,
D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1 ) ,
D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1 ) ,
D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY = ( D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + 1 ) ,
@@ -1271,10 +1771,7 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID + 1 ) ,
D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID + 1 ) ,
D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION + 4 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + 1 ) ,
D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
@@ -1319,8 +1816,8 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE + 1 ) ,
D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + 1 ) ,
D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + 1 ) ,
D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS + 1 ) ,
D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOPYFLAGS + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET = ( D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + 1 ) ,
@@ -1338,8 +1835,8 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + 1 ) ,
D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY = ( D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTYPEFORQUERY = ( D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTYPEFORQUERY + 1 ) ,
D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = ( D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + 1 ) ,
D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE + 1 ) ,
D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT + 1 ) ,
@@ -1459,9 +1956,145 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = ( D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE + 1 ) ,
D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = ( D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE + 1 ) ,
D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = ( D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT + 1 ) ,
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT + 1 )
D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE + 1 ) ,
D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST + 1 ) ,
D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE + 1 ) ,
D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC + 1 ) ,
D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE + 1 ) ,
D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST + 1 ) ,
D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE + 1 ) ,
D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC + 1 ) ,
D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = ( D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = ( D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS + 1 ) ,
D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = ( D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END + 1 ) ,
D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE + 1 ) ,
D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH + 1 ) ,
D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY + 1 ) ,
D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = ( D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY + 1 ) ,
D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = ( D3D12_MESSAGE_ID_STOREPIPELINE_NONAME + 1 ) ,
D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = ( D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME + 1 ) ,
D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = ( D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND + 1 ) ,
D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = ( D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC + 1 ) ,
D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = ( D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY + 1 ) ,
D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS + 1 ) ,
D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEODECODER = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODER + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEODECODER = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODER + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODER + 1 ) ,
D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM + 1 ) ,
D3D12_MESSAGE_ID_DEPRECATED_API = ( D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS + 1 ) ,
D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = ( D3D12_MESSAGE_ID_DEPRECATED_API + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = ( D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE + 1 ) ,
D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = ( D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS + 1 ) ,
D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = ( D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D + 1 ) ,
D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = ( D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = ( D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE + 1 ) ,
D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = ( D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE + 1 ) ,
D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = ( D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE + 1 ) ,
D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = ( D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = ( D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS + 1 ) ,
D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS + 1 ) ,
D3D12_MESSAGE_ID_CREATE_PASS = ( D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_PASS = ( D3D12_MESSAGE_ID_CREATE_PASS + 1 ) ,
D3D12_MESSAGE_ID_LIVE_PASS = ( D3D12_MESSAGE_ID_DESTROY_PASS + 1 ) ,
D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = ( D3D12_MESSAGE_ID_LIVE_PASS + 1 ) ,
D3D12_MESSAGE_ID_BEGIN_EVENT = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS + 1 ) ,
D3D12_MESSAGE_ID_END_EVENT = ( D3D12_MESSAGE_ID_BEGIN_EVENT + 1 ) ,
D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = ( D3D12_MESSAGE_ID_END_EVENT + 1 ) ,
D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = ( D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM + 1 ) ,
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE + 1 ) ,
D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = ( D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = ( D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = ( D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS + 1 ) ,
D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES + 1 ) ,
D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG + 1 ) ,
D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = ( D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE + 1 ) ,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = ( D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS + 1 ) ,
D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE + 1 ) ,
D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET + 1 ) ,
D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH + 1 ) ,
D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = ( D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE + 1 ) ,
D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = ( D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED + 1 ) ,
D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = ( D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM + 1 ) ,
D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM + 1 ) ,
D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR + 1 ) ,
D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM + 1 ) ,
D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = ( D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS + 1 ) ,
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT + 1 )
} D3D12_MESSAGE_ID;
static_assert(D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED == 1000, "Publicly released SDK D3D12_MESSAGE_ID enum values must not be changed. New enum values must be added to the end of the list.");
static_assert(D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT == 1067, "Publicly released SDK D3D12_MESSAGE_ID enum values must not be changed. New enum values must be added to the end of the list.");
typedef struct D3D12_MESSAGE
{
D3D12_MESSAGE_CATEGORY Category;
@@ -1490,8 +2123,8 @@ typedef struct D3D12_INFO_QUEUE_FILTER
#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_s_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0008_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0008_v0_0_s_ifspec;
#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__
#define __ID3D12InfoQueue_INTERFACE_DEFINED__
@@ -1898,20 +2531,24 @@ EXTERN_C const IID IID_ID3D12InfoQueue;
#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d12sdklayers_0000_0005 */
/* interface __MIDL_itf_d3d12sdklayers_0000_0009 */
/* [local] */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0);
DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04);
DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74);
DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88);
DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e);
DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a);
DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37);
DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f);
DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0005_v0_0_s_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0009_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0009_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
+123 -3
View File
@@ -3,7 +3,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -46,6 +46,13 @@ typedef interface ID3D10Blob ID3D10Blob;
#endif /* __ID3D10Blob_FWD_DEFINED__ */
#ifndef __ID3DDestructionNotifier_FWD_DEFINED__
#define __ID3DDestructionNotifier_FWD_DEFINED__
typedef interface ID3DDestructionNotifier ID3DDestructionNotifier;
#endif /* __ID3DDestructionNotifier_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
@@ -442,6 +449,119 @@ typedef ID3D10Blob ID3DBlob;
typedef ID3DBlob* LPD3DBLOB;
#define IID_ID3DBlob IID_ID3D10Blob
typedef void ( __stdcall *PFN_DESTRUCTION_CALLBACK )(
void *pData);
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
#ifndef __ID3DDestructionNotifier_INTERFACE_DEFINED__
#define __ID3DDestructionNotifier_INTERFACE_DEFINED__
/* interface ID3DDestructionNotifier */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3DDestructionNotifier;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a06eb39a-50da-425b-8c31-4eecd6c270f3")
ID3DDestructionNotifier : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE RegisterDestructionCallback(
/* [annotation] */
_In_ PFN_DESTRUCTION_CALLBACK callbackFn,
/* [annotation] */
_In_ void *pData,
/* [annotation] */
_Out_ UINT *pCallbackID) = 0;
virtual HRESULT STDMETHODCALLTYPE UnregisterDestructionCallback(
/* [annotation] */
_In_ UINT callbackID) = 0;
};
#else /* C style interface */
typedef struct ID3DDestructionNotifierVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3DDestructionNotifier * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3DDestructionNotifier * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3DDestructionNotifier * This);
HRESULT ( STDMETHODCALLTYPE *RegisterDestructionCallback )(
ID3DDestructionNotifier * This,
/* [annotation] */
_In_ PFN_DESTRUCTION_CALLBACK callbackFn,
/* [annotation] */
_In_ void *pData,
/* [annotation] */
_Out_ UINT *pCallbackID);
HRESULT ( STDMETHODCALLTYPE *UnregisterDestructionCallback )(
ID3DDestructionNotifier * This,
/* [annotation] */
_In_ UINT callbackID);
END_INTERFACE
} ID3DDestructionNotifierVtbl;
interface ID3DDestructionNotifier
{
CONST_VTBL struct ID3DDestructionNotifierVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3DDestructionNotifier_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3DDestructionNotifier_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3DDestructionNotifier_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3DDestructionNotifier_RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) \
( (This)->lpVtbl -> RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) )
#define ID3DDestructionNotifier_UnregisterDestructionCallback(This,callbackID) \
( (This)->lpVtbl -> UnregisterDestructionCallback(This,callbackID) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3DDestructionNotifier_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3dcommon_0000_0002 */
/* [local] */
typedef
enum _D3D_INCLUDE_TYPE
{
@@ -866,8 +986,8 @@ DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x0
#define D3D_COMPONENT_MASK_W 8
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
+277 -48
View File
@@ -3,7 +3,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Abstract:
// Public API definitions for DWrite, D2D and DImage.
// Public API definitions shared by DWrite, D2D, and DImage.
//
//----------------------------------------------------------------------------
#pragma once
@@ -21,84 +21,72 @@
#define CHECKMETHOD(method) virtual DECLSPEC_NOTHROW _Must_inspect_result_ HRESULT STDMETHODCALLTYPE method
#endif
#pragma warning(push)
#pragma warning(disable:4201) // anonymous unions warning
//
// Forward declarations
//
interface IDXGISurface;
struct IDXGISurface;
//+----------------------------------------------------------------------------
//
// Enum:
// DWRITE_MEASURING_MODE
//
// Synopsis:
// The measuring method used for text layout.
//
//-------------------------------------------------------------------------------
/// <summary>
/// The measuring method used for text layout.
/// </summary>
typedef enum DWRITE_MEASURING_MODE
{
//
// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
//
/// <summary>
/// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
/// </summary>
DWRITE_MEASURING_MODE_NATURAL,
//
// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
//
/// <summary>
/// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
/// </summary>
DWRITE_MEASURING_MODE_GDI_CLASSIC,
//
/// <summary>
// Text is measured using the same glyph display metrics as text measured by GDI using a font
// created with CLEARTYPE_NATURAL_QUALITY.
//
/// </summary>
DWRITE_MEASURING_MODE_GDI_NATURAL
} DWRITE_MEASURING_MODE;
//+-----------------------------------------------------------------------------
//
// Enum:
// D2D1_ALPHA_MODE
//
// Synopsis:
// Qualifies how alpha is to be treated in a bitmap or render target containing
// alpha.
//
//------------------------------------------------------------------------------
/// <summary>
/// Qualifies how alpha is to be treated in a bitmap or render target containing
/// alpha.
/// </summary>
typedef enum D2D1_ALPHA_MODE
{
//
// Alpha mode should be determined implicitly. Some target surfaces do not supply
// or imply this information in which case alpha must be specified.
//
/// <summary>
/// Alpha mode should be determined implicitly. Some target surfaces do not supply
/// or imply this information in which case alpha must be specified.
/// </summary>
D2D1_ALPHA_MODE_UNKNOWN = 0,
//
// Treat the alpha as premultipled.
//
/// <summary>
/// Treat the alpha as premultipled.
/// </summary>
D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
//
// Opacity is in the 'A' component only.
//
/// <summary>
/// Opacity is in the 'A' component only.
/// </summary>
D2D1_ALPHA_MODE_STRAIGHT = 2,
//
// Ignore any alpha channel information.
//
/// <summary>
/// Ignore any alpha channel information.
/// </summary>
D2D1_ALPHA_MODE_IGNORE = 3,
D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
} D2D1_ALPHA_MODE;
//+-----------------------------------------------------------------------------
//
// Struct:
// D2D1_PIXEL_FORMAT
//
//------------------------------------------------------------------------------
/// <summary>
/// Description of a pixel format.
/// </summary>
typedef struct D2D1_PIXEL_FORMAT
{
DXGI_FORMAT format;
@@ -106,4 +94,245 @@ typedef struct D2D1_PIXEL_FORMAT
} D2D1_PIXEL_FORMAT;
/// <summary>
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
/// </summary>
typedef struct D2D_POINT_2U
{
UINT32 x;
UINT32 y;
} D2D_POINT_2U;
/// <summary>
/// Represents an x-coordinate and y-coordinate pair in two-dimensional space.
/// </summary>
typedef struct D2D_POINT_2F
{
FLOAT x;
FLOAT y;
} D2D_POINT_2F;
typedef POINT D2D_POINT_2L;
/// <summary>
/// A vector of 2 FLOAT values (x, y).
/// </summary>
typedef struct D2D_VECTOR_2F
{
FLOAT x;
FLOAT y;
} D2D_VECTOR_2F;
/// <summary>
/// A vector of 3 FLOAT values (x, y, z).
/// </summary>
typedef struct D2D_VECTOR_3F
{
FLOAT x;
FLOAT y;
FLOAT z;
} D2D_VECTOR_3F;
/// <summary>
/// A vector of 4 FLOAT values (x, y, z, w).
/// </summary>
typedef struct D2D_VECTOR_4F
{
FLOAT x;
FLOAT y;
FLOAT z;
FLOAT w;
} D2D_VECTOR_4F;
/// <summary>
/// Represents a rectangle defined by the coordinates of the upper-left corner
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
/// </summary>
typedef struct D2D_RECT_F
{
FLOAT left;
FLOAT top;
FLOAT right;
FLOAT bottom;
} D2D_RECT_F;
/// <summary>
/// Represents a rectangle defined by the coordinates of the upper-left corner
/// (left, top) and the coordinates of the lower-right corner (right, bottom).
/// </summary>
typedef struct D2D_RECT_U
{
UINT32 left;
UINT32 top;
UINT32 right;
UINT32 bottom;
} D2D_RECT_U;
typedef RECT D2D_RECT_L;
/// <summary>
/// Stores an ordered pair of floats, typically the width and height of a rectangle.
/// </summary>
typedef struct D2D_SIZE_F
{
FLOAT width;
FLOAT height;
} D2D_SIZE_F;
/// <summary>
/// Stores an ordered pair of integers, typically the width and height of a
/// rectangle.
/// </summary>
typedef struct D2D_SIZE_U
{
UINT32 width;
UINT32 height;
} D2D_SIZE_U;
/// <summary>
/// Represents a 3-by-2 matrix.
/// </summary>
typedef struct D2D_MATRIX_3X2_F
{
union
{
struct
{
/// <summary>
/// Horizontal scaling / cosine of rotation
/// </summary>
FLOAT m11;
/// <summary>
/// Vertical shear / sine of rotation
/// </summary>
FLOAT m12;
/// <summary>
/// Horizontal shear / negative sine of rotation
/// </summary>
FLOAT m21;
/// <summary>
/// Vertical scaling / cosine of rotation
/// </summary>
FLOAT m22;
/// <summary>
/// Horizontal shift (always orthogonal regardless of rotation)
/// </summary>
FLOAT dx;
/// <summary>
/// Vertical shift (always orthogonal regardless of rotation)
/// </summary>
FLOAT dy;
};
struct
{
FLOAT _11, _12;
FLOAT _21, _22;
FLOAT _31, _32;
};
FLOAT m[3][2];
};
} D2D_MATRIX_3X2_F;
/// <summary>
/// Represents a 4-by-3 matrix.
/// </summary>
typedef struct D2D_MATRIX_4X3_F
{
union
{
struct
{
FLOAT _11, _12, _13;
FLOAT _21, _22, _23;
FLOAT _31, _32, _33;
FLOAT _41, _42, _43;
};
FLOAT m[4][3];
};
} D2D_MATRIX_4X3_F;
/// <summary>
/// Represents a 4-by-4 matrix.
/// </summary>
typedef struct D2D_MATRIX_4X4_F
{
union
{
struct
{
FLOAT _11, _12, _13, _14;
FLOAT _21, _22, _23, _24;
FLOAT _31, _32, _33, _34;
FLOAT _41, _42, _43, _44;
};
FLOAT m[4][4];
};
} D2D_MATRIX_4X4_F;
/// <summary>
/// Represents a 5-by-4 matrix.
/// </summary>
typedef struct D2D_MATRIX_5X4_F
{
union
{
struct
{
FLOAT _11, _12, _13, _14;
FLOAT _21, _22, _23, _24;
FLOAT _31, _32, _33, _34;
FLOAT _41, _42, _43, _44;
FLOAT _51, _52, _53, _54;
};
FLOAT m[5][4];
};
} D2D_MATRIX_5X4_F;
typedef D2D_POINT_2F D2D1_POINT_2F;
typedef D2D_POINT_2U D2D1_POINT_2U;
typedef D2D_POINT_2L D2D1_POINT_2L;
typedef D2D_RECT_F D2D1_RECT_F;
typedef D2D_RECT_U D2D1_RECT_U;
typedef D2D_RECT_L D2D1_RECT_L;
typedef D2D_SIZE_F D2D1_SIZE_F;
typedef D2D_SIZE_U D2D1_SIZE_U;
typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
#pragma warning(pop)
#endif /* DCOMMON_H_INCLUDED */
+25 -11
View File
@@ -10,9 +10,7 @@
#ifndef DWRITE_H_INCLUDED
#define DWRITE_H_INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef DWRITE_NO_WINDOWS_H
@@ -56,7 +54,7 @@ enum DWRITE_FONT_FILE_TYPE
/// <summary>
/// OpenType font that contains a TrueType collection.
/// </summary>
DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION,
/// <summary>
/// Type 1 PFM font.
@@ -76,7 +74,10 @@ enum DWRITE_FONT_FILE_TYPE
/// <summary>
/// Bitmap .FON font.
/// </summary>
DWRITE_FONT_FILE_TYPE_BITMAP
DWRITE_FONT_FILE_TYPE_BITMAP,
// The following name is obsolete, but kept as an alias to avoid breaking existing code.
DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION = DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION,
};
/// <summary>
@@ -97,9 +98,9 @@ enum DWRITE_FONT_FACE_TYPE
DWRITE_FONT_FACE_TYPE_TRUETYPE,
/// <summary>
/// OpenType font face that is a part of a TrueType collection.
/// OpenType font face that is a part of a TrueType or CFF collection.
/// </summary>
DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION,
/// <summary>
/// A Type 1 font face.
@@ -127,7 +128,10 @@ enum DWRITE_FONT_FACE_TYPE
/// font file loaders) and the resulting font face object supports only the
/// minimum functionality necessary to render glyphs.
/// </summary>
DWRITE_FONT_FACE_TYPE_RAW_CFF
DWRITE_FONT_FACE_TYPE_RAW_CFF,
// The following name is obsolete, but kept as an alias to avoid breaking existing code.
DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION,
};
/// <summary>
@@ -2446,7 +2450,7 @@ enum DWRITE_NUMBER_SUBSTITUTION_METHOD
/// <summary>
/// Holds the appropriate digits and numeric punctuation for a given locale.
/// </summary>
interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown
interface DWRITE_DECLARE_INTERFACE("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") IDWriteNumberSubstitution : public IUnknown
{
};
@@ -2511,7 +2515,7 @@ struct DWRITE_SHAPING_GLYPH_PROPERTIES
/// stop prematurely and return a callback error. Rather than return E_NOTIMPL,
/// an application should stub the method and return a constant/null and S_OK.
/// </summary>
interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown
interface DWRITE_DECLARE_INTERFACE("688e1a58-5094-47c8-adc8-fbcea60ae92b") IDWriteTextAnalysisSource : public IUnknown
{
/// <summary>
/// Get a block of text starting at the specified text position.
@@ -2620,7 +2624,7 @@ interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABL
/// state of the analysis sink, therefore a Set method call on a range
/// overwrites the previously set analysis result of the same range.
/// </summary>
interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown
interface DWRITE_DECLARE_INTERFACE("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") IDWriteTextAnalysisSink : public IUnknown
{
/// <summary>
/// Report script analysis for the text range.
@@ -2918,7 +2922,7 @@ interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWri
_In_reads_(glyphCount) UINT16 const* glyphIndices,
_In_reads_(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
UINT32 glyphCount,
_In_ IDWriteFontFace * fontFace,
_In_ IDWriteFontFace* fontFace,
FLOAT fontEmSize,
BOOL isSideways,
BOOL isRightToLeft,
@@ -4371,6 +4375,16 @@ interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWri
UINT32 maxHitTestMetricsCount,
_Out_ UINT32* actualHitTestMetricsCount
) PURE;
using IDWriteTextFormat::GetFontCollection;
using IDWriteTextFormat::GetFontFamilyNameLength;
using IDWriteTextFormat::GetFontFamilyName;
using IDWriteTextFormat::GetFontWeight;
using IDWriteTextFormat::GetFontStyle;
using IDWriteTextFormat::GetFontStretch;
using IDWriteTextFormat::GetFontSize;
using IDWriteTextFormat::GetLocaleNameLength;
using IDWriteTextFormat::GetLocaleName;
};
+8 -4
View File
@@ -10,9 +10,7 @@
#ifndef DWRITE_1_H_INCLUDED
#define DWRITE_1_H_INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif
#include <DWrite.h>
@@ -1337,6 +1335,10 @@ interface DWRITE_DECLARE_INTERFACE("a71efdb4-9fdb-4838-ad90-cfc3be8c3daf") IDWri
/// True if the font contains vertical glyph variants.
/// </returns>
STDMETHOD_(BOOL, HasVerticalGlyphVariants)() PURE;
using IDWriteFontFace::GetMetrics;
using IDWriteFontFace::GetGdiCompatibleMetrics;
using IDWriteFontFace::GetRecommendedRenderingMode;
};
@@ -1355,6 +1357,8 @@ interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32738") IDWri
_Out_ DWRITE_FONT_METRICS1* fontMetrics
) PURE;
using IDWriteFont::GetMetrics;
/// <summary>
/// Gets the PANOSE values from the font, used for font selection and
/// matching.
@@ -1714,7 +1718,7 @@ interface DWRITE_DECLARE_INTERFACE("80DAD800-E21F-4E83-96CE-BFCCE500DB7C") IDWri
/// If any of these callbacks returns an error, the analysis functions will
/// stop prematurely and return a callback error.
/// </summary>
interface DECLSPEC_UUID("{639CFAD8-0FB4-4B21-A58A-067920120009}") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource1 : public IDWriteTextAnalysisSource
interface DWRITE_DECLARE_INTERFACE("639CFAD8-0FB4-4B21-A58A-067920120009") IDWriteTextAnalysisSource1 : public IDWriteTextAnalysisSource
{
/// <summary>
/// The text analyzer calls back to this to get the desired glyph
@@ -1753,7 +1757,7 @@ interface DECLSPEC_UUID("{639CFAD8-0FB4-4B21-A58A-067920120009}") DECLSPEC_NOVTA
/// The interface implemented by the client to receive the
/// output of the text analyzers.
/// </summary>
interface DECLSPEC_UUID("B0D941A0-85E7-4D8B-9FD3-5CED9934482A") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink1 : public IDWriteTextAnalysisSink
interface DWRITE_DECLARE_INTERFACE("B0D941A0-85E7-4D8B-9FD3-5CED9934482A") IDWriteTextAnalysisSink1 : public IDWriteTextAnalysisSink
{
/// <summary>
/// The text analyzer calls back to this to report the actual orientation
+20 -9
View File
@@ -10,9 +10,7 @@
#ifndef DWRITE_2_H_INCLUDED
#define DWRITE_2_H_INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif
#include <DWrite_1.h>
@@ -238,6 +236,11 @@ interface DWRITE_DECLARE_INTERFACE("D3E0E934-22A0-427E-AAE4-7D9574B59DB1") IDWri
BOOL isRightToLeft,
_In_opt_ IUnknown* clientDrawingEffect
) PURE;
using IDWriteTextRenderer::DrawGlyphRun;
using IDWriteTextRenderer::DrawUnderline;
using IDWriteTextRenderer::DrawStrikethrough;
using IDWriteTextRenderer::DrawInlineObject;
};
@@ -510,6 +513,8 @@ interface DWRITE_DECLARE_INTERFACE("553A9FF3-5693-4DF7-B52B-74806F7F2EB9") IDWri
_In_reads_(glyphCount) UINT16 const* glyphIndices,
_Out_writes_(glyphCount) UINT8* featureApplies
) PURE;
using IDWriteTextAnalyzer1::GetGlyphOrientationTransform;
};
@@ -554,8 +559,8 @@ interface DWRITE_DECLARE_INTERFACE("EFA008F9-F7A1-48BF-B05C-F224713CC0FF") IDWri
DWRITE_FONT_WEIGHT baseWeight,
DWRITE_FONT_STYLE baseStyle,
DWRITE_FONT_STRETCH baseStretch,
_Deref_out_range_(0, textLength) UINT32* mappedLength,
_COM_Outptr_ IDWriteFont** mappedFont,
_Out_range_(0, textLength) UINT32* mappedLength,
_COM_Outptr_result_maybenull_ IDWriteFont** mappedFont,
_Out_ FLOAT* scale
) PURE;
};
@@ -643,7 +648,7 @@ typedef struct _D3DCOLORVALUE {
} D3DCOLORVALUE;
#define D3DCOLORVALUE_DEFINED
#endif D3DCOLORVALUE_DEFINED
#endif // D3DCOLORVALUE_DEFINED
typedef D3DCOLORVALUE DWRITE_COLOR_F;
@@ -653,8 +658,10 @@ typedef D3DCOLORVALUE DWRITE_COLOR_F;
interface DWRITE_DECLARE_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944") IDWriteFont2 : public IDWriteFont1
{
/// <summary>
/// Returns TRUE if the font contains color information (COLR and CPAL tables),
/// or FALSE if not.
/// Returns TRUE if the font contains tables that can provide color information
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
/// TRUE is returned even in the case when the font tables contain only grayscale
/// images.
/// </summary>
STDMETHOD_(BOOL, IsColorFont)() PURE;
};
@@ -667,8 +674,10 @@ interface DWRITE_DECLARE_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944") IDWri
interface DWRITE_DECLARE_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7") IDWriteFontFace2 : public IDWriteFontFace1
{
/// <summary>
/// Returns TRUE if the font contains color information (COLR and CPAL tables),
/// or FALSE if not.
/// Returns TRUE if the font contains tables that can provide color information
/// (including COLR, CPAL, SVG, CBDT, sbix tables), or FALSE if not. Note that
/// TRUE is returned even in the case when the font tables contain only grayscale
/// images.
/// </summary>
STDMETHOD_(BOOL, IsColorFont)() PURE;
@@ -747,6 +756,8 @@ interface DWRITE_DECLARE_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7") IDWri
_Out_ DWRITE_RENDERING_MODE* renderingMode,
_Out_ DWRITE_GRID_FIT_MODE* gridFitMode
) PURE;
using IDWriteFontFace1::GetRecommendedRenderingMode;
};
/// <summary>
+684 -3
View File
@@ -10,9 +10,7 @@
#ifndef DWRITE_3_H_INCLUDED
#define DWRITE_3_H_INCLUDED
#if _MSC_VER > 1000
#pragma once
#endif
#include <DWrite_2.h>
@@ -1247,6 +1245,8 @@ interface DWRITE_DECLARE_INTERFACE("D37D7598-09BE-4222-A236-2081341CC1F2") IDWri
_Out_ DWRITE_GRID_FIT_MODE* gridFitMode
) PURE;
using IDWriteFontFace2::GetRecommendedRenderingMode;
/// <summary>
/// Determines whether the character is locally downloaded from the font.
/// </summary>
@@ -1578,6 +1578,8 @@ interface DWRITE_DECLARE_INTERFACE("4556BE70-3ABD-4F70-90BE-421780A6F515") IDWri
_In_ IDWriteFontSet* fontSet,
_COM_Outptr_ IDWriteFontSet** filteredSet
) PURE;
using IDWriteGdiInterop::CreateFontFromLOGFONT;
};
/// <summary>
@@ -1684,6 +1686,9 @@ interface DWRITE_DECLARE_INTERFACE("F67E0EDD-9E3D-4ECC-8C32-4183253DFE70") IDWri
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetLineSpacing)(_Out_ DWRITE_LINE_SPACING* lineSpacingOptions) PURE;
using IDWriteTextFormat1::SetLineSpacing;
using IDWriteTextFormat1::GetLineSpacing;
};
interface DWRITE_DECLARE_INTERFACE("07DDCD52-020E-4DE8-AC33-6C953D83F92D") IDWriteTextLayout3 : public IDWriteTextLayout2
@@ -1738,6 +1743,682 @@ interface DWRITE_DECLARE_INTERFACE("07DDCD52-020E-4DE8-AC33-6C953D83F92D") IDWri
UINT32 maxLineCount,
_Out_ UINT32* actualLineCount
) PURE;
using IDWriteTextLayout2::SetLineSpacing;
using IDWriteTextLayout2::GetLineSpacing;
using IDWriteTextLayout2::GetLineMetrics;
};
#endif /* DWRITE_3_H_INCLUDED */
////////////////////////////////////////////////////////////////////////////////////////////////////
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
/// <summary>
/// Fonts may contain multiple drawable data formats for glyphs. These flags specify which formats
/// are supported in the font, either at a font-wide level or per glyph, and the app may use them
/// to tell DWrite which formats to return when splitting a color glyph run.
/// </summary>
enum DWRITE_GLYPH_IMAGE_FORMATS
{
/// <summary>
/// Indicates no data is available for this glyph.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x00000000,
/// <summary>
/// The glyph has TrueType outlines.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x00000001,
/// <summary>
/// The glyph has CFF outlines.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x00000002,
/// <summary>
/// The glyph has multilayered COLR data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x00000004,
/// <summary>
/// The glyph has SVG outlines as standard XML.
/// </summary>
/// <remarks>
/// Fonts may store the content gzip'd rather than plain text,
/// indicated by the first two bytes as gzip header {0x1F 0x8B}.
/// </remarks>
DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x00000008,
/// <summary>
/// The glyph has PNG image data, with standard PNG IHDR.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x00000010,
/// <summary>
/// The glyph has JPEG image data, with standard JIFF SOI header.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x00000020,
/// <summary>
/// The glyph has TIFF image data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x00000040,
/// <summary>
/// The glyph has raw 32-bit premultiplied BGRA data.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x00000080,
};
#ifdef DEFINE_ENUM_FLAG_OPERATORS
DEFINE_ENUM_FLAG_OPERATORS(DWRITE_GLYPH_IMAGE_FORMATS);
#endif
/// <summary>
/// Represents a color glyph run. The IDWriteFactory4::TranslateColorGlyphRun
/// method returns an ordered collection of color glyph runs of varying types
/// depending on what the font supports.
/// </summary>
/// <summary>
/// For runs without any specific color, such as PNG data, the runColor field will be zero.
/// </summary>
struct DWRITE_COLOR_GLYPH_RUN1 : DWRITE_COLOR_GLYPH_RUN
{
/// <summary>
/// Type of glyph image format for this color run. Exactly one type will be set since
/// TranslateColorGlyphRun has already broken down the run into separate parts.
/// </summary>
DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat;
/// <summary>
/// Measuring mode to use for this glyph run.
/// </summary>
DWRITE_MEASURING_MODE measuringMode;
};
/// <summary>
/// Data for a single glyph from GetGlyphImageData.
/// </summary>
struct DWRITE_GLYPH_IMAGE_DATA
{
/// <summary>
/// Pointer to the glyph data, be it SVG, PNG, JPEG, TIFF.
/// </summary>
_Field_size_bytes_(imageDataSize) void const* imageData;
/// <summary>
/// Size of glyph data in bytes.
/// </summary>
UINT32 imageDataSize;
/// <summary>
/// Unique identifier for the glyph data. Clients may use this to cache a parsed/decompressed
/// version and tell whether a repeated call to the same font returns the same data.
/// </summary>
UINT32 uniqueDataId;
/// <summary>
/// Pixels per em of the returned data. For non-scalable raster data (PNG/TIFF/JPG), this can be larger
/// or smaller than requested from GetGlyphImageData when there isn't an exact match.
/// For scaling intermediate sizes, use: desired pixels per em * font em size / actual pixels per em.
/// </summary>
UINT32 pixelsPerEm;
/// <summary>
/// Size of image when the format is pixel data.
/// </summary>
D2D1_SIZE_U pixelSize;
/// <summary>
/// Left origin along the horizontal Roman baseline.
/// </summary>
D2D1_POINT_2L horizontalLeftOrigin;
/// <summary>
/// Right origin along the horizontal Roman baseline.
/// </summary>
D2D1_POINT_2L horizontalRightOrigin;
/// <summary>
/// Top origin along the vertical central baseline.
/// </summary>
D2D1_POINT_2L verticalTopOrigin;
/// <summary>
/// Bottom origin along vertical central baseline.
/// </summary>
D2D1_POINT_2L verticalBottomOrigin;
};
/// <summary>
/// Enumerator for an ordered collection of color glyph runs.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("7C5F86DA-C7A1-4F05-B8E1-55A179FE5A35") IDWriteColorGlyphRunEnumerator1 : public IDWriteColorGlyphRunEnumerator
{
/// <summary>
/// Gets the current color glyph run.
/// </summary>
/// <param name="colorGlyphRun">Receives a pointer to the color
/// glyph run. The pointer remains valid until the next call to
/// MoveNext or until the interface is released.</param>
/// <returns>
/// Standard HRESULT error code. An error is returned if there is
/// no current glyph run, i.e., if MoveNext has not yet been called
/// or if the end of the sequence has been reached.
/// </returns>
STDMETHOD(GetCurrentRun)(
_Outptr_ DWRITE_COLOR_GLYPH_RUN1 const** colorGlyphRun
) PURE;
using IDWriteColorGlyphRunEnumerator::GetCurrentRun;
};
/// <summary>
/// The interface that represents an absolute reference to a font face.
/// It contains font face type, appropriate file references and face identification data.
/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("27F2A904-4EB8-441D-9678-0563F53E3E2F") IDWriteFontFace4 : public IDWriteFontFace3
{
/// <summary>
/// Gets all the glyph image formats supported by the entire font (SVG, PNG, JPEG, ...).
/// </summary>
STDMETHOD_(DWRITE_GLYPH_IMAGE_FORMATS, GetGlyphImageFormats)() PURE;
/// <summary>
/// Gets the available image formats of a specific glyph and ppem. Glyphs often have at least TrueType
/// or CFF outlines, but they may also have SVG outlines, or they may have only bitmaps
/// with no TrueType/CFF outlines. Some image formats, notably the PNG/JPEG ones, are size
/// specific and will return no match when there isn't an entry in that size range.
/// </summary>
/// <remarks>
/// Glyph ids beyond the glyph count return DWRITE_GLYPH_IMAGE_FORMATS_NONE.
/// </remarks>
STDMETHOD(GetGlyphImageFormats)(
UINT16 glyphId,
UINT32 pixelsPerEmFirst,
UINT32 pixelsPerEmLast,
_Out_ DWRITE_GLYPH_IMAGE_FORMATS* glyphImageFormats
) PURE;
/// <summary>
/// Gets a pointer to the glyph data based on the desired image format.
/// </summary>
/// <remarks>
/// The glyphDataContext must be released via ReleaseGlyphImageData when done if the data is not empty,
/// similar to IDWriteFontFileStream::ReadFileFragment and IDWriteFontFileStream::ReleaseFileFragment.
/// The data pointer is valid so long as the IDWriteFontFace exists and ReleaseGlyphImageData has not
/// been called.
/// </remarks>
/// <remarks>
/// The DWRITE_GLYPH_IMAGE_DATA::uniqueDataId is valuable for caching purposes so that if the same
/// resource is returned more than once, an existing resource can be quickly retrieved rather than
/// needing to reparse or decompress the data.
/// </remarks>
/// <remarks>
/// The function only returns SVG or raster data - requesting TrueType/CFF/COLR data returns
/// DWRITE_E_INVALIDARG. Those must be drawn via DrawGlyphRun or queried using GetGlyphOutline instead.
/// Exactly one format may be requested or else the function returns DWRITE_E_INVALIDARG.
/// If the glyph does not have that format, the call is not an error, but the function returns empty data.
/// </remarks>
STDMETHOD(GetGlyphImageData)(
_In_ UINT16 glyphId,
UINT32 pixelsPerEm,
DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat,
_Out_ DWRITE_GLYPH_IMAGE_DATA* glyphData,
_Outptr_result_maybenull_ void** glyphDataContext
) PURE;
/// <summary>
/// Releases the table data obtained earlier from ReadGlyphData.
/// </summary>
/// <param name="glyphDataContext">Opaque context from ReadGlyphData.</param>
STDMETHOD_(void, ReleaseGlyphImageData)(
void* glyphDataContext
) PURE;
};
interface DWRITE_DECLARE_INTERFACE("4B0B5BD3-0797-4549-8AC5-FE915CC53856") IDWriteFactory4 : public IDWriteFactory3
{
/// <summary>
/// Translates a glyph run to a sequence of color glyph runs, which can be
/// rendered to produce a color representation of the original "base" run.
/// </summary>
/// <param name="baselineOriginX">Horizontal and vertical origin of the base glyph run in
/// pre-transform coordinates.</param>
/// <param name="glyphRun">Pointer to the original "base" glyph run.</param>
/// <param name="glyphRunDescription">Optional glyph run description.</param>
/// <param name="glyphImageFormats">Which data formats TranslateColorGlyphRun
/// should split the runs into.</param>
/// <param name="measuringMode">Measuring mode, needed to compute the origins
/// of each glyph.</param>
/// <param name="worldToDeviceTransform">Matrix converting from the client's
/// coordinate space to device coordinates (pixels), i.e., the world transform
/// multiplied by any DPI scaling.</param>
/// <param name="colorPaletteIndex">Zero-based index of the color palette to use.
/// Valid indices are less than the number of palettes in the font, as returned
/// by IDWriteFontFace2::GetColorPaletteCount.</param>
/// <param name="colorLayers">If the function succeeds, receives a pointer
/// to an enumerator object that can be used to obtain the color glyph runs.
/// If the base run has no color glyphs, then the output pointer is NULL
/// and the method returns DWRITE_E_NOCOLOR.</param>
/// <returns>
/// Returns DWRITE_E_NOCOLOR if the font has no color information, the glyph run
/// does not contain any color glyphs, or the specified color palette index
/// is out of range. In this case, the client should render the original glyph
/// run. Otherwise, returns a standard HRESULT error code.
/// </returns>
/// <remarks>
/// The old IDWriteFactory2::TranslateColorGlyphRun is equivalent to passing
/// DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE|CFF|COLR.
/// </remarks>
STDMETHOD(TranslateColorGlyphRun)(
D2D1_POINT_2F baselineOrigin,
_In_ DWRITE_GLYPH_RUN const* glyphRun,
_In_opt_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
DWRITE_GLYPH_IMAGE_FORMATS desiredGlyphImageFormats,
DWRITE_MEASURING_MODE measuringMode,
_In_opt_ DWRITE_MATRIX const* worldAndDpiTransform,
UINT32 colorPaletteIndex,
_COM_Outptr_ IDWriteColorGlyphRunEnumerator1** colorLayers
) PURE;
using IDWriteFactory2::TranslateColorGlyphRun;
/// <summary>
/// Converts glyph run placements to glyph origins.
/// </summary>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// The transform and DPI have no affect on the origin scaling.
/// They are solely used to compute glyph advances when not supplied
/// and align glyphs in pixel aligned measuring modes.
/// </remarks>
STDMETHOD(ComputeGlyphOrigins)(
DWRITE_GLYPH_RUN const* glyphRun,
DWRITE_MEASURING_MODE measuringMode,
D2D1_POINT_2F baselineOrigin,
_In_opt_ DWRITE_MATRIX const* worldAndDpiTransform,
_Out_writes_(glyphRun->glyphCount) D2D1_POINT_2F* glyphOrigins
) PURE;
/// <summary>
/// Converts glyph run placements to glyph origins. This overload is for natural metrics, which
/// includes SVG, TrueType natural modes, and bitmap placement.
/// </summary>
STDMETHOD(ComputeGlyphOrigins)(
DWRITE_GLYPH_RUN const* glyphRun,
D2D1_POINT_2F baselineOrigin,
_Out_writes_(glyphRun->glyphCount) D2D1_POINT_2F* glyphOrigins
) PURE;
};
#endif // NTDDI_VERSION >= NTDDI_WIN10_RS1
////////////////////////////////////////////////////////////////////////////////////////////////////
#if NTDDI_VERSION >= NTDDI_WIN10_RS2
interface DWRITE_DECLARE_INTERFACE("3FF7715F-3CDC-4DC6-9B72-EC5621DCCAFD") IDWriteFontSetBuilder1 : public IDWriteFontSetBuilder
{
/// <summary>
/// Adds references to all the fonts in the specified font file. The method
/// parses the font file to determine the fonts and their properties.
/// </summary>
/// <param name="fontFile">Font file reference object to add to the set.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(AddFontFile)(
_In_ IDWriteFontFile* fontFile
) throw();
};
/// <summary>
/// The IDWriteAsyncResult interface represents the result of an asynchronous
/// operation. A client can use the interface to wait for the operation to
/// complete and to get the result.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("CE25F8FD-863B-4D13-9651-C1F88DC73FE2") IDWriteAsyncResult : public IUnknown
{
/// <summary>
/// The GetWaitHandleMethod method returns a handle that can be used to wait
/// for the asynchronous operation to complete. The handle remains valid
/// until the interface is released.
/// </summary>
STDMETHOD_(HANDLE, GetWaitHandle)() PURE;
/// <summary>
/// The GetResult method returns the result of the asynchronous operation.
/// The return value is E_PENDING if the operation has not yet completed.
/// </summary>
STDMETHOD(GetResult)() PURE;
};
/// <summary>
/// DWRITE_FILE_FRAGMENT represents a range of bytes in a font file.
/// </summary>
struct DWRITE_FILE_FRAGMENT
{
/// <summary>
/// Starting offset of the fragment from the beginning of the file.
/// </summary>
UINT64 fileOffset;
/// <summary>
/// Size of the file fragment, in bytes.
/// </summary>
UINT64 fragmentSize;
};
/// <summary>
/// IDWriteRemoteFontFileStream represents a font file stream parts of which may be
/// non-local. Non-local data must be downloaded before it can be accessed using
/// ReadFragment. The interface exposes methods to download font data and query the
/// locality of font data.
/// </summary>
/// <remarks>
/// For more information, see the description of IDWriteRemoteFontFileLoader.
/// </remarks>
interface DWRITE_DECLARE_INTERFACE("4DB3757A-2C72-4ED9-B2B6-1ABABE1AFF9C") IDWriteRemoteFontFileStream : public IDWriteFontFileStream
{
/// <summary>
/// GetLocalFileSize returns the number of bytes of the font file that are
/// currently local, which should always be less than or equal to the full
/// file size returned by GetFileSize. If the locality is remote, the return
/// value is zero. If the file is fully local, the return value must be the
/// same as GetFileSize.
/// </summary>
/// <param name="localFileSize">Receives the local size of the file.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetLocalFileSize)(
_Out_ UINT64* localFileSize
) PURE;
/// <summary>
/// GetFileFragmentLocality returns information about the locality of a byte range (i.e.,
/// font fragment) within the font file stream.
/// </summary>
/// <param name="fileOffset">Offset of the fragment from the beginning of the font file.</param>
/// <param name="fragmentSize">Size of the fragment in bytes.</param>
/// <param name="isLocal">Receives TRUE if the first byte of the fragment is local, FALSE if not.</param>
/// <param name="partialSize">Receives the number of contiguous bytes from the start of the
/// fragment that have the same locality as the first byte.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetFileFragmentLocality)(
UINT64 fileOffset,
UINT64 fragmentSize,
_Out_ BOOL* isLocal,
_Out_range_(0, fragmentSize) UINT64* partialSize
) PURE;
/// <summary>
/// Gets the current locality of the file.
/// </summary>
/// <returns>
/// Returns the locality enumeration (i.e., remote, partial, or local).
/// </returns>
STDMETHOD_(DWRITE_LOCALITY, GetLocality)() PURE;
/// <summary>
/// BeginDownload begins downloading all or part of the font file.
/// </summary>
/// <param name="fileFragments">Array of structures, each specifying a byte
/// range to download.</param>
/// <param name="fragmentCount">Number of elements in the fileFragments array.
/// This can be zero to just download file information, such as the size.</param>
/// <param name="asyncResult">Receives an object that can be used to wait for
/// the asynchronous download to complete and to get the download result upon
/// completion. The result may be NULL if the download completes synchronously.
/// For example, this can happen if method determines that the requested data
/// is already local.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(BeginDownload)(
_In_ UUID const* downloadOperationID,
_In_reads_(fragmentCount) DWRITE_FILE_FRAGMENT const* fileFragments,
UINT32 fragmentCount,
_COM_Outptr_result_maybenull_ IDWriteAsyncResult** asyncResult
) PURE;
};
/// <summary>
/// Specifies the container format of a font resource. A container format is distinct from
/// a font file format (DWRITE_FONT_FILE_TYPE) because the container describes the container
/// in which the underlying font file is packaged.
/// </summary>
enum DWRITE_CONTAINER_TYPE
{
DWRITE_CONTAINER_TYPE_UNKNOWN,
DWRITE_CONTAINER_TYPE_WOFF,
DWRITE_CONTAINER_TYPE_WOFF2
};
/// <summary>
/// The IDWriteRemoteFontFileLoader interface represents a font file loader that can access
/// remote (i.e., downloadable) fonts. The IDWriteFactory5::CreateHttpFontFileLoader method
/// returns an instance of this interface, or a client can create its own implementation.
/// </summary>
/// <remarks>
/// Calls to a remote file loader or stream should never block waiting for network operations.
/// Any call that cannot succeeded immediately using local (e.g., cached) must should return
/// DWRITE_E_REMOTEFONT. This error signifies to DWrite that it should add requests to the
/// font download queue.
/// </remarks>
interface DWRITE_DECLARE_INTERFACE("68648C83-6EDE-46C0-AB46-20083A887FDE") IDWriteRemoteFontFileLoader : public IDWriteFontFileLoader
{
/// <summary>
/// Creates a remote font file stream object that encapsulates an open file resource
/// and can be used to download remote file data.
/// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
/// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
/// <param name="fontFileStream">Pointer to the newly created font file stream.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
/// <remarks>
/// Unlike CreateStreamFromKey, this method can be used to create a stream for a remote file.
/// If the file is remote, the client must call IDWriteRemoteFontFileStream::DownloadFileInformation
/// before the stream can be used to get the file size or access data.
/// </remarks>
STDMETHOD(CreateRemoteStreamFromKey)(
_In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReferenceKey,
UINT32 fontFileReferenceKeySize,
_COM_Outptr_ IDWriteRemoteFontFileStream** fontFileStream
) PURE;
/// <summary>
/// Gets the locality of the file resource identified by the unique key.
/// </summary>
/// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
/// within the scope of the font loader being used.</param>
/// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
/// <param name="locality">Locality of the file.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(GetLocalityFromKey)(
_In_reads_bytes_(fontFileReferenceKeySize) void const* fontFileReferenceKey,
UINT32 fontFileReferenceKeySize,
_Out_ DWRITE_LOCALITY* locality
) PURE;
/// <summary>
/// Creates a font file reference from a URL if the loader supports this capability.
/// </summary>
/// <param name="factory">Factory used to create the font file reference.</param>
/// <param name="baseUrl">Optional base URL. The base URL is used to resolve the fontFileUrl
/// if it is relative. For example, the baseUrl might be the URL of the referring document
/// that contained the fontFileUrl.</param>
/// <param name="fontFileUrl">URL of the font resource.</param>
/// <param name="fontFile">Receives a pointer to the newly created font file reference.</param>
/// <returns>
/// Standard HRESULT error code, or E_NOTIMPL if the loader does not implement this method.
/// </returns>
STDMETHOD(CreateFontFileReferenceFromUrl)(
IDWriteFactory* factory,
_In_opt_z_ WCHAR const* baseUrl,
_In_z_ WCHAR const* fontFileUrl,
_COM_Outptr_ IDWriteFontFile** fontFile
) PURE;
};
/// <summary>
/// The IDWriteInMemoryFontFileLoader interface enables clients to reference
/// in-memory fonts without having to implement a custom loader. The
/// IDWriteFactory5::CreateInMemoryFontFileLoader method returns an instance
/// of this interface, which the client is responsible for registering and
/// unregistering using IDWriteFactory::RegisterFontFileLoader and
/// IDWriteFactory::UnregisterFontFileLoader.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("DC102F47-A12D-4B1C-822D-9E117E33043F") IDWriteInMemoryFontFileLoader : public IDWriteFontFileLoader
{
/// <summary>
/// The CreateInMemoryFontFileReference method creates a font file reference
/// (IDWriteFontFile object) from an array of bytes. The font file reference
/// is bound to the IDWRiteInMemoryFontFileLoader instance with which it was
/// created and remains valid for as long as that loader is registered with
/// the factory.
/// </summary>
/// <param name="factory">Factory object used to create the font file reference.</param>
/// <param name="fontData">Pointer to a memory block containing the font data.</param>
/// <param name="fontDataSize">Size of the font data.</param>
/// <param name="ownerObject">Optional object that owns the memory specified by
/// the fontData parameter. If this parameter is not NULL, the method stores a
/// pointer to the font data and adds a reference to the owner object. The
/// fontData pointer must remain valid until the owner object is released. If
/// this parameter is NULL, the method makes a copy of the font data.</param>
/// <param name="fontFile">Receives a pointer to the newly-created font file
/// reference.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateInMemoryFontFileReference)(
IDWriteFactory* factory,
_In_reads_bytes_(fontDataSize) void const* fontData,
UINT32 fontDataSize,
_In_opt_ IUnknown* ownerObject,
_COM_Outptr_ IDWriteFontFile** fontFile
) PURE;
/// <summary>
/// The GetFileCount method returns the number of font file references that
/// have been created using this loader instance.
/// </summary>
STDMETHOD_(UINT32, GetFileCount)() PURE;
};
/// <summary>
/// The root factory interface for all DWrite objects.
/// </summary>
interface DWRITE_DECLARE_INTERFACE("958DB99A-BE2A-4F09-AF7D-65189803D1D3") IDWriteFactory5 : public IDWriteFactory4
{
/// <summary>
/// Creates an empty font set builder to add font face references
/// and create a custom font set.
/// </summary>
/// <param name="fontSetBuilder">Holds the newly created font set builder object, or NULL in case of failure.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateFontSetBuilder)(
_COM_Outptr_ IDWriteFontSetBuilder1** fontSetBuilder
) PURE;
using IDWriteFactory3::CreateFontSetBuilder;
/// <summary>
/// The CreateInMemoryFontFileLoader method creates a loader object that can
/// be used to create font file references to in-memory fonts. The caller is
/// responsible for registering and unregistering the loader.
/// </summary>
/// <param name="newLoader">Receives a pointer to the newly-created loader object.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateInMemoryFontFileLoader)(
_COM_Outptr_ IDWriteInMemoryFontFileLoader** newLoader
) PURE;
/// <summary>
/// The CreateHttpFontFileLoader function creates a remote font file loader
/// that can create font file references from HTTP or HTTPS URLs. The caller
/// is responsible for registering and unregistering the loader.
/// </summary>
/// <param name="referrerUrl">Optional referrer URL for HTTP requests.</param>
/// <param name="extraHeaders">Optional additional header fields to include
/// in HTTP requests. Each header field consists of a name followed by a colon
/// (":") and the field value, as specified by RFC 2616. Multiple header fields
/// may be separated by newlines.</param>
/// <param name="newLoader">Receives a pointer to the newly-created loader object.</param>
/// <returns>
/// Standard HRESULT error code.
/// </returns>
STDMETHOD(CreateHttpFontFileLoader)(
_In_opt_z_ wchar_t const* referrerUrl,
_In_opt_z_ wchar_t const* extraHeaders,
_COM_Outptr_ IDWriteRemoteFontFileLoader** newLoader
);
/// <summary>
/// The AnalyzeContainerType method analyzes the specified file data to determine
/// whether it is a known font container format (e.g., WOFF or WOFF2).
/// </summary>
/// <returns>
/// Returns the container type if recognized. DWRITE_CONTAINER_TYPE_UNKOWNN is
/// returned for all other files, including uncompressed font files.
/// </returns>
STDMETHOD_(DWRITE_CONTAINER_TYPE, AnalyzeContainerType)(
_In_reads_bytes_(fileDataSize) void const* fileData,
UINT32 fileDataSize
) PURE;
/// <summary>
/// The UnpackFontFile method unpacks font data from a container file (WOFF or
/// WOFF2) and returns the unpacked font data in the form of a font file stream.
/// </summary>
/// <param name="containerType">Container type returned by AnalyzeContainerType.</param>
/// <param name="fileData">Pointer to the compressed data.</param>
/// <param name="fileDataSize">Size of the compressed data, in bytes.</param>
/// <param name="unpackedFontStream">Receives a pointer to a newly created font
/// file stream containing the uncompressed data.</param>
/// <returns>
/// Standard HRESULT error code. The return value is E_INVALIDARG if the container
/// type is DWRITE_CONTAINER_TYPE_UNKNOWN.
/// </returns>
STDMETHOD(UnpackFontFile)(
DWRITE_CONTAINER_TYPE containerType,
_In_reads_bytes_(fileDataSize) void const* fileData,
UINT32 fileDataSize,
_COM_Outptr_ IDWriteFontFileStream** unpackedFontStream
) PURE;
};
#endif // NTDDI_VERSION >= NTDDI_WIN10_RS2
#endif // DWRITE_3_H_INCLUDED
+25 -18
View File
@@ -1,9 +1,9 @@

/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -140,6 +140,7 @@ typedef interface IDXGIDevice1 IDXGIDevice1;
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "dxgicommon.h"
#include "dxgitype.h"
#ifdef __cplusplus
@@ -181,6 +182,8 @@ typedef struct DXGI_MAPPED_RECT
} DXGI_MAPPED_RECT;
#ifdef __midl
#ifndef LUID_DEFINED
#define LUID_DEFINED 1
typedef struct _LUID
{
DWORD LowPart;
@@ -189,6 +192,7 @@ typedef struct _LUID
typedef struct _LUID *PLUID;
#endif
#endif
typedef struct DXGI_ADAPTER_DESC
{
@@ -273,7 +277,9 @@ enum DXGI_SWAP_CHAIN_FLAG
DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 128,
DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 256,
DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 512,
DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024
DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024,
DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 2048,
DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 4096
} DXGI_SWAP_CHAIN_FLAG;
typedef struct DXGI_SWAP_CHAIN_DESC
@@ -319,7 +325,7 @@ EXTERN_C const IID IID_IDXGIObject;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown) = 0;
_In_opt_ const IUnknown *pUnknown) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
/* [annotation][in] */
@@ -369,7 +375,7 @@ EXTERN_C const IID IID_IDXGIObject;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIObject * This,
@@ -488,7 +494,7 @@ EXTERN_C const IID IID_IDXGIDeviceSubObject;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDeviceSubObject * This,
@@ -626,7 +632,7 @@ EXTERN_C const IID IID_IDXGIResource;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIResource * This,
@@ -788,7 +794,7 @@ EXTERN_C const IID IID_IDXGIKeyedMutex;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIKeyedMutex * This,
@@ -953,7 +959,7 @@ EXTERN_C const IID IID_IDXGISurface;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface * This,
@@ -1110,7 +1116,7 @@ EXTERN_C const IID IID_IDXGISurface1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface1 * This,
@@ -1300,7 +1306,7 @@ EXTERN_C const IID IID_IDXGIAdapter;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter * This,
@@ -1506,7 +1512,7 @@ EXTERN_C const IID IID_IDXGIOutput;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput * This,
@@ -1684,6 +1690,7 @@ EXTERN_C const IID IID_IDXGIOutput;
#define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020UL
#define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040UL
#define DXGI_PRESENT_USE_DURATION 0x00000100UL
#define DXGI_PRESENT_ALLOW_TEARING 0x00000200UL
extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_c_ifspec;
@@ -1787,7 +1794,7 @@ EXTERN_C const IID IID_IDXGISwapChain;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain * This,
@@ -2039,7 +2046,7 @@ EXTERN_C const IID IID_IDXGIFactory;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory * This,
@@ -2241,7 +2248,7 @@ EXTERN_C const IID IID_IDXGIDevice;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice * This,
@@ -2448,7 +2455,7 @@ EXTERN_C const IID IID_IDXGIFactory1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory1 * This,
@@ -2628,7 +2635,7 @@ EXTERN_C const IID IID_IDXGIAdapter1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter1 * This,
@@ -2785,7 +2792,7 @@ EXTERN_C const IID IID_IDXGIDevice1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice1 * This,
+11 -10
View File
@@ -3,7 +3,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -360,7 +360,7 @@ EXTERN_C const IID IID_IDXGIOutputDuplication;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutputDuplication * This,
@@ -582,7 +582,7 @@ EXTERN_C const IID IID_IDXGISurface2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISurface2 * This,
@@ -776,7 +776,7 @@ EXTERN_C const IID IID_IDXGIResource1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIResource1 * This,
@@ -991,7 +991,7 @@ EXTERN_C const IID IID_IDXGIDevice2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice2 * This,
@@ -1209,7 +1209,8 @@ typedef struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC
typedef struct DXGI_PRESENT_PARAMETERS
{
UINT DirtyRectsCount;
RECT *pDirtyRects;
/* [annotation] */
_Field_size_full_opt_(DirtyRectsCount) RECT *pDirtyRects;
RECT *pScrollRect;
POINT *pScrollOffset;
} DXGI_PRESENT_PARAMETERS;
@@ -1314,7 +1315,7 @@ EXTERN_C const IID IID_IDXGISwapChain1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain1 * This,
@@ -1699,7 +1700,7 @@ EXTERN_C const IID IID_IDXGIFactory2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory2 * This,
@@ -2048,7 +2049,7 @@ EXTERN_C const IID IID_IDXGIAdapter2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter2 * This,
@@ -2233,7 +2234,7 @@ EXTERN_C const IID IID_IDXGIOutput1;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput1 * This,
+6 -6
View File
@@ -3,7 +3,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -168,7 +168,7 @@ EXTERN_C const IID IID_IDXGIDevice3;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIDevice3 * This,
@@ -430,7 +430,7 @@ EXTERN_C const IID IID_IDXGISwapChain2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain2 * This,
@@ -792,7 +792,7 @@ EXTERN_C const IID IID_IDXGIOutput2;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput2 * This,
@@ -1059,7 +1059,7 @@ EXTERN_C const IID IID_IDXGIFactory3;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory3 * This,
@@ -1861,7 +1861,7 @@ EXTERN_C const IID IID_IDXGIOutput3;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput3 * This,
+5 -5
View File
@@ -3,7 +3,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0613 */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
@@ -170,7 +170,7 @@ EXTERN_C const IID IID_IDXGISwapChain3;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGISwapChain3 * This,
@@ -599,7 +599,7 @@ EXTERN_C const IID IID_IDXGIOutput4;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput4 * This,
@@ -906,7 +906,7 @@ EXTERN_C const IID IID_IDXGIFactory4;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIFactory4 * This,
@@ -1296,7 +1296,7 @@ EXTERN_C const IID IID_IDXGIAdapter3;
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_ const IUnknown *pUnknown);
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter3 * This,
File diff suppressed because it is too large Load Diff
+727
View File
@@ -0,0 +1,727 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.01.0622 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __dxgi1_6_h__
#define __dxgi1_6_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IDXGIAdapter4_FWD_DEFINED__
#define __IDXGIAdapter4_FWD_DEFINED__
typedef interface IDXGIAdapter4 IDXGIAdapter4;
#endif /* __IDXGIAdapter4_FWD_DEFINED__ */
#ifndef __IDXGIOutput6_FWD_DEFINED__
#define __IDXGIOutput6_FWD_DEFINED__
typedef interface IDXGIOutput6 IDXGIOutput6;
#endif /* __IDXGIOutput6_FWD_DEFINED__ */
/* header files for imported files */
#include "dxgi1_5.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dxgi1_6_0000_0000 */
/* [local] */
// Copyright (c) Microsoft Corporation. All Rights Reserved
#include <winapifamily.h>
#pragma region App Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
typedef
enum DXGI_ADAPTER_FLAG3
{
DXGI_ADAPTER_FLAG3_NONE = 0,
DXGI_ADAPTER_FLAG3_REMOTE = 1,
DXGI_ADAPTER_FLAG3_SOFTWARE = 2,
DXGI_ADAPTER_FLAG3_ACG_COMPATIBLE = 4,
DXGI_ADAPTER_FLAG3_FORCE_DWORD = 0xffffffff
} DXGI_ADAPTER_FLAG3;
DEFINE_ENUM_FLAG_OPERATORS( DXGI_ADAPTER_FLAG3 );
typedef struct DXGI_ADAPTER_DESC3
{
WCHAR Description[ 128 ];
UINT VendorId;
UINT DeviceId;
UINT SubSysId;
UINT Revision;
SIZE_T DedicatedVideoMemory;
SIZE_T DedicatedSystemMemory;
SIZE_T SharedSystemMemory;
LUID AdapterLuid;
DXGI_ADAPTER_FLAG3 Flags;
DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity;
DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity;
} DXGI_ADAPTER_DESC3;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0000_v0_0_s_ifspec;
#ifndef __IDXGIAdapter4_INTERFACE_DEFINED__
#define __IDXGIAdapter4_INTERFACE_DEFINED__
/* interface IDXGIAdapter4 */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIAdapter4;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3c8d99d1-4fbf-4181-a82c-af66bf7bd24e")
IDXGIAdapter4 : public IDXGIAdapter3
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc3(
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC3 *pDesc) = 0;
};
#else /* C style interface */
typedef struct IDXGIAdapter4Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIAdapter4 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIAdapter4 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIAdapter4 * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
_In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][out][in] */
_Inout_ UINT *pDataSize,
/* [annotation][out] */
_Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFIID riid,
/* [annotation][retval][out] */
_COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *EnumOutputs )(
IDXGIAdapter4 * This,
/* [in] */ UINT Output,
/* [annotation][out][in] */
_COM_Outptr_ IDXGIOutput **ppOutput);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ REFGUID InterfaceName,
/* [annotation][out] */
_Out_ LARGE_INTEGER *pUMDVersion);
HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDesc2 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC2 *pDesc);
HRESULT ( STDMETHODCALLTYPE *RegisterHardwareContentProtectionTeardownStatusEvent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie);
void ( STDMETHODCALLTYPE *UnregisterHardwareContentProtectionTeardownStatus )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ DWORD dwCookie);
HRESULT ( STDMETHODCALLTYPE *QueryVideoMemoryInfo )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][out] */
_Out_ DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfo);
HRESULT ( STDMETHODCALLTYPE *SetVideoMemoryReservation )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ UINT NodeIndex,
/* [annotation][in] */
_In_ DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,
/* [annotation][in] */
_In_ UINT64 Reservation);
HRESULT ( STDMETHODCALLTYPE *RegisterVideoMemoryBudgetChangeNotificationEvent )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ HANDLE hEvent,
/* [annotation][out] */
_Out_ DWORD *pdwCookie);
void ( STDMETHODCALLTYPE *UnregisterVideoMemoryBudgetChangeNotification )(
IDXGIAdapter4 * This,
/* [annotation][in] */
_In_ DWORD dwCookie);
HRESULT ( STDMETHODCALLTYPE *GetDesc3 )(
IDXGIAdapter4 * This,
/* [annotation][out] */
_Out_ DXGI_ADAPTER_DESC3 *pDesc);
END_INTERFACE
} IDXGIAdapter4Vtbl;
interface IDXGIAdapter4
{
CONST_VTBL struct IDXGIAdapter4Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIAdapter4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIAdapter4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIAdapter4_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIAdapter4_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIAdapter4_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIAdapter4_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIAdapter4_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIAdapter4_EnumOutputs(This,Output,ppOutput) \
( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) )
#define IDXGIAdapter4_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIAdapter4_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \
( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) )
#define IDXGIAdapter4_GetDesc1(This,pDesc) \
( (This)->lpVtbl -> GetDesc1(This,pDesc) )
#define IDXGIAdapter4_GetDesc2(This,pDesc) \
( (This)->lpVtbl -> GetDesc2(This,pDesc) )
#define IDXGIAdapter4_RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) \
( (This)->lpVtbl -> RegisterHardwareContentProtectionTeardownStatusEvent(This,hEvent,pdwCookie) )
#define IDXGIAdapter4_UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) \
( (This)->lpVtbl -> UnregisterHardwareContentProtectionTeardownStatus(This,dwCookie) )
#define IDXGIAdapter4_QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) \
( (This)->lpVtbl -> QueryVideoMemoryInfo(This,NodeIndex,MemorySegmentGroup,pVideoMemoryInfo) )
#define IDXGIAdapter4_SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) \
( (This)->lpVtbl -> SetVideoMemoryReservation(This,NodeIndex,MemorySegmentGroup,Reservation) )
#define IDXGIAdapter4_RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) \
( (This)->lpVtbl -> RegisterVideoMemoryBudgetChangeNotificationEvent(This,hEvent,pdwCookie) )
#define IDXGIAdapter4_UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) \
( (This)->lpVtbl -> UnregisterVideoMemoryBudgetChangeNotification(This,dwCookie) )
#define IDXGIAdapter4_GetDesc3(This,pDesc) \
( (This)->lpVtbl -> GetDesc3(This,pDesc) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIAdapter4_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi1_6_0000_0001 */
/* [local] */
typedef struct DXGI_OUTPUT_DESC1
{
WCHAR DeviceName[ 32 ];
RECT DesktopCoordinates;
BOOL AttachedToDesktop;
DXGI_MODE_ROTATION Rotation;
HMONITOR Monitor;
UINT BitsPerColor;
DXGI_COLOR_SPACE_TYPE ColorSpace;
FLOAT RedPrimary[ 2 ];
FLOAT GreenPrimary[ 2 ];
FLOAT BluePrimary[ 2 ];
FLOAT WhitePoint[ 2 ];
FLOAT MinLuminance;
FLOAT MaxLuminance;
FLOAT MaxFullFrameLuminance;
} DXGI_OUTPUT_DESC1;
typedef
enum DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS
{
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN = 1,
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_WINDOWED = 2,
DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED = 4
} DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS );
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0001_v0_0_s_ifspec;
#ifndef __IDXGIOutput6_INTERFACE_DEFINED__
#define __IDXGIOutput6_INTERFACE_DEFINED__
/* interface IDXGIOutput6 */
/* [unique][local][uuid][object] */
EXTERN_C const IID IID_IDXGIOutput6;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("068346e8-aaec-4b84-add7-137f513f77a1")
IDXGIOutput6 : public IDXGIOutput5
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDesc1(
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC1 *pDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE CheckHardwareCompositionSupport(
/* [annotation][out] */
_Out_ UINT *pFlags) = 0;
};
#else /* C style interface */
typedef struct IDXGIOutput6Vtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IDXGIOutput6 * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IDXGIOutput6 * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [in] */ UINT DataSize,
/* [annotation][in] */
_In_reads_bytes_(DataSize) const void *pData);
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][in] */
_In_opt_ const IUnknown *pUnknown);
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFGUID Name,
/* [annotation][out][in] */
_Inout_ UINT *pDataSize,
/* [annotation][out] */
_Out_writes_bytes_(*pDataSize) void *pData);
HRESULT ( STDMETHODCALLTYPE *GetParent )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ REFIID riid,
/* [annotation][retval][out] */
_COM_Outptr_ void **ppParent);
HRESULT ( STDMETHODCALLTYPE *GetDesc )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )(
IDXGIOutput6 * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
_Inout_ UINT *pNumModes,
/* [annotation][out] */
_Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_MODE_DESC *pModeToMatch,
/* [annotation][out] */
_Out_ DXGI_MODE_DESC *pClosestMatch,
/* [annotation][in] */
_In_opt_ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *TakeOwnership )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
BOOL Exclusive);
void ( STDMETHODCALLTYPE *ReleaseOwnership )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps);
HRESULT ( STDMETHODCALLTYPE *SetGammaControl )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *GetGammaControl )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_GAMMA_CONTROL *pArray);
HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGISurface *pScanoutSurface);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGISurface *pDestination);
HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_FRAME_STATISTICS *pStats);
HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList1 )(
IDXGIOutput6 * This,
/* [in] */ DXGI_FORMAT EnumFormat,
/* [in] */ UINT Flags,
/* [annotation][out][in] */
_Inout_ UINT *pNumModes,
/* [annotation][out] */
_Out_writes_to_opt_(*pNumModes,*pNumModes) DXGI_MODE_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ const DXGI_MODE_DESC1 *pModeToMatch,
/* [annotation][out] */
_Out_ DXGI_MODE_DESC1 *pClosestMatch,
/* [annotation][in] */
_In_opt_ IUnknown *pConcernedDevice);
HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IDXGIResource *pDestination);
HRESULT ( STDMETHODCALLTYPE *DuplicateOutput )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [annotation][out] */
_COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
BOOL ( STDMETHODCALLTYPE *SupportsOverlays )(
IDXGIOutput6 * This);
HRESULT ( STDMETHODCALLTYPE *CheckOverlaySupport )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ DXGI_FORMAT EnumFormat,
/* [annotation][out] */
_In_ IUnknown *pConcernedDevice,
/* [annotation][out] */
_Out_ UINT *pFlags);
HRESULT ( STDMETHODCALLTYPE *CheckOverlayColorSpaceSupport )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ DXGI_FORMAT Format,
/* [annotation][in] */
_In_ DXGI_COLOR_SPACE_TYPE ColorSpace,
/* [annotation][in] */
_In_ IUnknown *pConcernedDevice,
/* [annotation][out] */
_Out_ UINT *pFlags);
HRESULT ( STDMETHODCALLTYPE *DuplicateOutput1 )(
IDXGIOutput6 * This,
/* [annotation][in] */
_In_ IUnknown *pDevice,
/* [in] */ UINT Flags,
/* [annotation][in] */
_In_ UINT SupportedFormatsCount,
/* [annotation][in] */
_In_reads_(SupportedFormatsCount) const DXGI_FORMAT *pSupportedFormats,
/* [annotation][out] */
_COM_Outptr_ IDXGIOutputDuplication **ppOutputDuplication);
HRESULT ( STDMETHODCALLTYPE *GetDesc1 )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ DXGI_OUTPUT_DESC1 *pDesc);
HRESULT ( STDMETHODCALLTYPE *CheckHardwareCompositionSupport )(
IDXGIOutput6 * This,
/* [annotation][out] */
_Out_ UINT *pFlags);
END_INTERFACE
} IDXGIOutput6Vtbl;
interface IDXGIOutput6
{
CONST_VTBL struct IDXGIOutput6Vtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IDXGIOutput6_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IDXGIOutput6_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IDXGIOutput6_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IDXGIOutput6_SetPrivateData(This,Name,DataSize,pData) \
( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) )
#define IDXGIOutput6_SetPrivateDataInterface(This,Name,pUnknown) \
( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) )
#define IDXGIOutput6_GetPrivateData(This,Name,pDataSize,pData) \
( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) )
#define IDXGIOutput6_GetParent(This,riid,ppParent) \
( (This)->lpVtbl -> GetParent(This,riid,ppParent) )
#define IDXGIOutput6_GetDesc(This,pDesc) \
( (This)->lpVtbl -> GetDesc(This,pDesc) )
#define IDXGIOutput6_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \
( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) )
#define IDXGIOutput6_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
#define IDXGIOutput6_WaitForVBlank(This) \
( (This)->lpVtbl -> WaitForVBlank(This) )
#define IDXGIOutput6_TakeOwnership(This,pDevice,Exclusive) \
( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) )
#define IDXGIOutput6_ReleaseOwnership(This) \
( (This)->lpVtbl -> ReleaseOwnership(This) )
#define IDXGIOutput6_GetGammaControlCapabilities(This,pGammaCaps) \
( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) )
#define IDXGIOutput6_SetGammaControl(This,pArray) \
( (This)->lpVtbl -> SetGammaControl(This,pArray) )
#define IDXGIOutput6_GetGammaControl(This,pArray) \
( (This)->lpVtbl -> GetGammaControl(This,pArray) )
#define IDXGIOutput6_SetDisplaySurface(This,pScanoutSurface) \
( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) )
#define IDXGIOutput6_GetDisplaySurfaceData(This,pDestination) \
( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) )
#define IDXGIOutput6_GetFrameStatistics(This,pStats) \
( (This)->lpVtbl -> GetFrameStatistics(This,pStats) )
#define IDXGIOutput6_GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) \
( (This)->lpVtbl -> GetDisplayModeList1(This,EnumFormat,Flags,pNumModes,pDesc) )
#define IDXGIOutput6_FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) \
( (This)->lpVtbl -> FindClosestMatchingMode1(This,pModeToMatch,pClosestMatch,pConcernedDevice) )
#define IDXGIOutput6_GetDisplaySurfaceData1(This,pDestination) \
( (This)->lpVtbl -> GetDisplaySurfaceData1(This,pDestination) )
#define IDXGIOutput6_DuplicateOutput(This,pDevice,ppOutputDuplication) \
( (This)->lpVtbl -> DuplicateOutput(This,pDevice,ppOutputDuplication) )
#define IDXGIOutput6_SupportsOverlays(This) \
( (This)->lpVtbl -> SupportsOverlays(This) )
#define IDXGIOutput6_CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) \
( (This)->lpVtbl -> CheckOverlaySupport(This,EnumFormat,pConcernedDevice,pFlags) )
#define IDXGIOutput6_CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) \
( (This)->lpVtbl -> CheckOverlayColorSpaceSupport(This,Format,ColorSpace,pConcernedDevice,pFlags) )
#define IDXGIOutput6_DuplicateOutput1(This,pDevice,Flags,SupportedFormatsCount,pSupportedFormats,ppOutputDuplication) \
( (This)->lpVtbl -> DuplicateOutput1(This,pDevice,Flags,SupportedFormatsCount,pSupportedFormats,ppOutputDuplication) )
#define IDXGIOutput6_GetDesc1(This,pDesc) \
( (This)->lpVtbl -> GetDesc1(This,pDesc) )
#define IDXGIOutput6_CheckHardwareCompositionSupport(This,pFlags) \
( (This)->lpVtbl -> CheckHardwareCompositionSupport(This,pFlags) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IDXGIOutput6_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_dxgi1_6_0000_0002 */
/* [local] */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
DEFINE_GUID(IID_IDXGIAdapter4,0x3c8d99d1,0x4fbf,0x4181,0xa8,0x2c,0xaf,0x66,0xbf,0x7b,0xd2,0x4e);
DEFINE_GUID(IID_IDXGIOutput6,0x068346e8,0xaaec,0x4b84,0xad,0xd7,0x13,0x7f,0x51,0x3f,0x77,0xa1);
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgi1_6_0000_0002_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
+51
View File
@@ -0,0 +1,51 @@
//
// Copyright (C) Microsoft. All rights reserved.
//
#ifndef __dxgicommon_h__
#define __dxgicommon_h__
typedef struct DXGI_RATIONAL
{
UINT Numerator;
UINT Denominator;
} DXGI_RATIONAL;
// The following values are used with DXGI_SAMPLE_DESC::Quality:
#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff
#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe
typedef struct DXGI_SAMPLE_DESC
{
UINT Count;
UINT Quality;
} DXGI_SAMPLE_DESC;
typedef enum DXGI_COLOR_SPACE_TYPE
{
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
DXGI_COLOR_SPACE_RESERVED = 4,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13,
DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16,
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17,
DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18,
DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19,
DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF
} DXGI_COLOR_SPACE_TYPE;
#endif // __dxgicommon_h__
+2 -34
View File
@@ -1,9 +1,10 @@
//
//
// Copyright (C) Microsoft. All rights reserved.
//
#ifndef __dxgitype_h__
#define __dxgitype_h__
#include "dxgicommon.h"
#include "dxgiformat.h"
#define _FACDXGI 0x87a
@@ -55,12 +56,6 @@ typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
float ControlPointPositions[1025];
} DXGI_GAMMA_CONTROL_CAPABILITIES;
typedef struct DXGI_RATIONAL
{
UINT Numerator;
UINT Denominator;
} DXGI_RATIONAL;
typedef enum DXGI_MODE_SCANLINE_ORDER
{
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
@@ -95,33 +90,6 @@ typedef struct DXGI_MODE_DESC
DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;
// The following values are used with DXGI_SAMPLE_DESC::Quality:
#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff
#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe
typedef struct DXGI_SAMPLE_DESC
{
UINT Count;
UINT Quality;
} DXGI_SAMPLE_DESC;
typedef enum DXGI_COLOR_SPACE_TYPE
{
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
DXGI_COLOR_SPACE_RESERVED = 4,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF
} DXGI_COLOR_SPACE_TYPE;
typedef struct DXGI_JPEG_DC_HUFFMAN_TABLE
{
BYTE CodeCounts[12];
+305
View File
@@ -0,0 +1,305 @@
/*
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
sdkddkver.h
Abstract:
Master include file for versioning windows SDK/DDK.
*/
#ifndef _INC_SDKDDKVER
#define _INC_SDKDDKVER
#if (_MSC_VER >= 800)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#pragma warning(disable:4668) /* #if not_defined treated as #if 0 */
#endif
#pragma warning(disable:4001) /* nonstandard extension : single line comment */
#endif
#pragma once
//
// _WIN32_WINNT version constants
//
#define _WIN32_WINNT_NT4 0x0400
#define _WIN32_WINNT_WIN2K 0x0500
#define _WIN32_WINNT_WINXP 0x0501
#define _WIN32_WINNT_WS03 0x0502
#define _WIN32_WINNT_WIN6 0x0600
#define _WIN32_WINNT_VISTA 0x0600
#define _WIN32_WINNT_WS08 0x0600
#define _WIN32_WINNT_LONGHORN 0x0600
#define _WIN32_WINNT_WIN7 0x0601
#define _WIN32_WINNT_WIN8 0x0602
#define _WIN32_WINNT_WINBLUE 0x0603
#define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* ABRACADABRA_THRESHOLD*/
#define _WIN32_WINNT_WIN10 0x0A00 /* ABRACADABRA_THRESHOLD*/
//
// _WIN32_IE_ version constants
//
#define _WIN32_IE_IE20 0x0200
#define _WIN32_IE_IE30 0x0300
#define _WIN32_IE_IE302 0x0302
#define _WIN32_IE_IE40 0x0400
#define _WIN32_IE_IE401 0x0401
#define _WIN32_IE_IE50 0x0500
#define _WIN32_IE_IE501 0x0501
#define _WIN32_IE_IE55 0x0550
#define _WIN32_IE_IE60 0x0600
#define _WIN32_IE_IE60SP1 0x0601
#define _WIN32_IE_IE60SP2 0x0603
#define _WIN32_IE_IE70 0x0700
#define _WIN32_IE_IE80 0x0800
#define _WIN32_IE_IE90 0x0900
#define _WIN32_IE_IE100 0x0A00
#define _WIN32_IE_IE110 0x0A00 /* ABRACADABRA_THRESHOLD */
//
// IE <-> OS version mapping
//
// NT4 supports IE versions 2.0 -> 6.0 SP1
#define _WIN32_IE_NT4 _WIN32_IE_IE20
#define _WIN32_IE_NT4SP1 _WIN32_IE_IE20
#define _WIN32_IE_NT4SP2 _WIN32_IE_IE20
#define _WIN32_IE_NT4SP3 _WIN32_IE_IE302
#define _WIN32_IE_NT4SP4 _WIN32_IE_IE401
#define _WIN32_IE_NT4SP5 _WIN32_IE_IE401
#define _WIN32_IE_NT4SP6 _WIN32_IE_IE50
// Win98 supports IE versions 4.01 -> 6.0 SP1
#define _WIN32_IE_WIN98 _WIN32_IE_IE401
// Win98SE supports IE versions 5.0 -> 6.0 SP1
#define _WIN32_IE_WIN98SE _WIN32_IE_IE50
// WinME supports IE versions 5.5 -> 6.0 SP1
#define _WIN32_IE_WINME _WIN32_IE_IE55
// Win2k supports IE versions 5.01 -> 6.0 SP1
#define _WIN32_IE_WIN2K _WIN32_IE_IE501
#define _WIN32_IE_WIN2KSP1 _WIN32_IE_IE501
#define _WIN32_IE_WIN2KSP2 _WIN32_IE_IE501
#define _WIN32_IE_WIN2KSP3 _WIN32_IE_IE501
#define _WIN32_IE_WIN2KSP4 _WIN32_IE_IE501
#define _WIN32_IE_XP _WIN32_IE_IE60
#define _WIN32_IE_XPSP1 _WIN32_IE_IE60SP1
#define _WIN32_IE_XPSP2 _WIN32_IE_IE60SP2
#define _WIN32_IE_WS03 0x0602
#define _WIN32_IE_WS03SP1 _WIN32_IE_IE60SP2
#define _WIN32_IE_WIN6 _WIN32_IE_IE70
#define _WIN32_IE_LONGHORN _WIN32_IE_IE70
#define _WIN32_IE_WIN7 _WIN32_IE_IE80
#define _WIN32_IE_WIN8 _WIN32_IE_IE100
#define _WIN32_IE_WINBLUE _WIN32_IE_IE100
#define _WIN32_IE_WINTHRESHOLD _WIN32_IE_IE110 /* ABRACADABRA_THRESHOLD */
#define _WIN32_IE_WIN10 _WIN32_IE_IE110 /* ABRACADABRA_THRESHOLD */
//
// NTDDI version constants
//
#define NTDDI_WIN2K 0x05000000
#define NTDDI_WIN2KSP1 0x05000100
#define NTDDI_WIN2KSP2 0x05000200
#define NTDDI_WIN2KSP3 0x05000300
#define NTDDI_WIN2KSP4 0x05000400
#define NTDDI_WINXP 0x05010000
#define NTDDI_WINXPSP1 0x05010100
#define NTDDI_WINXPSP2 0x05010200
#define NTDDI_WINXPSP3 0x05010300
#define NTDDI_WINXPSP4 0x05010400
#define NTDDI_WS03 0x05020000
#define NTDDI_WS03SP1 0x05020100
#define NTDDI_WS03SP2 0x05020200
#define NTDDI_WS03SP3 0x05020300
#define NTDDI_WS03SP4 0x05020400
#define NTDDI_WIN6 0x06000000
#define NTDDI_WIN6SP1 0x06000100
#define NTDDI_WIN6SP2 0x06000200
#define NTDDI_WIN6SP3 0x06000300
#define NTDDI_WIN6SP4 0x06000400
#define NTDDI_VISTA NTDDI_WIN6
#define NTDDI_VISTASP1 NTDDI_WIN6SP1
#define NTDDI_VISTASP2 NTDDI_WIN6SP2
#define NTDDI_VISTASP3 NTDDI_WIN6SP3
#define NTDDI_VISTASP4 NTDDI_WIN6SP4
#define NTDDI_LONGHORN NTDDI_VISTA
#define NTDDI_WS08 NTDDI_WIN6SP1
#define NTDDI_WS08SP2 NTDDI_WIN6SP2
#define NTDDI_WS08SP3 NTDDI_WIN6SP3
#define NTDDI_WS08SP4 NTDDI_WIN6SP4
#define NTDDI_WIN7 0x06010000
#define NTDDI_WIN8 0x06020000
#define NTDDI_WINBLUE 0x06030000
#define NTDDI_WINTHRESHOLD 0x0A000000 /* ABRACADABRA_THRESHOLD */
#define NTDDI_WIN10 0x0A000000 /* ABRACADABRA_THRESHOLD */
#define NTDDI_WIN10_TH2 0x0A000001 /* ABRACADABRA_WIN10_TH2 */
#define NTDDI_WIN10_RS1 0x0A000002 /* ABRACADABRA_WIN10_RS1 */
#define NTDDI_WIN10_RS2 0x0A000003 /* ABRACADABRA_WIN10_RS2 */
#define WDK_NTDDI_VERSION NTDDI_WIN10_RS2
//
// masks for version macros
//
#define OSVERSION_MASK 0xFFFF0000
#define SPVERSION_MASK 0x0000FF00
#define SUBVERSION_MASK 0x000000FF
//
// macros to extract various version fields from the NTDDI version
//
#define OSVER(Version) ((Version) & OSVERSION_MASK)
#define SPVER(Version) (((Version) & SPVERSION_MASK) >> 8)
#define SUBVER(Version) (((Version) & SUBVERSION_MASK) )
#if defined(DECLSPEC_DEPRECATED_DDK)
// deprecate in 2k or later
#if (NTDDI_VERSION >= NTDDI_WIN2K)
#define DECLSPEC_DEPRECATED_DDK_WIN2K DECLSPEC_DEPRECATED_DDK
#else
#define DECLSPEC_DEPRECATED_DDK_WIN2K
#endif
// deprecate in XP or later
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define DECLSPEC_DEPRECATED_DDK_WINXP DECLSPEC_DEPRECATED_DDK
#else
#define DECLSPEC_DEPRECATED_DDK_WINXP
#endif
// deprecate in WS03 or later
#if (NTDDI_VERSION >= NTDDI_WS03)
#define DECLSPEC_DEPRECATED_DDK_WIN2003 DECLSPEC_DEPRECATED_DDK
#else
#define DECLSPEC_DEPRECATED_DDK_WIN2003
#endif
// deprecate in WIN6 or later
#if (NTDDI_VERSION >= NTDDI_WIN6)
#define DECLSPEC_DEPRECATED_DDK_WIN6 DECLSPEC_DEPRECATED_DDK
#else
#define DECLSPEC_DEPRECATED_DDK_WIN6
#endif
#define DECLSPEC_DEPRECATED_DDK_LONGHORN DECLSPEC_DEPRECATED_DDK_WIN6
#endif // defined(DECLSPEC_DEPRECATED_DDK)
//
// if versions aren't already defined, default to most current
//
#define NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
#if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
#define _WIN32_WINNT 0x0A00
#endif
#ifndef NTDDI_VERSION
#ifdef _WIN32_WINNT
#if (_WIN32_WINNT <= _WIN32_WINNT_WINBLUE)
// set NTDDI_VERSION based on _WIN32_WINNT
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
#elif (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
// set NTDDI_VERSION to default to WDK_NTDDI_VERSION
#define NTDDI_VERSION WDK_NTDDI_VERSION
#endif // (_WIN32_WINNT <= _WIN32_WINNT_WINBLUE)
#else
// set NTDDI_VERSION to default to latest if _WIN32_WINNT isn't set
#define NTDDI_VERSION 0x0A000003
#endif // _WIN32_WINNT
#endif // NTDDI_VERSION
#ifndef WINVER
#ifdef _WIN32_WINNT
// set WINVER based on _WIN32_WINNT
#define WINVER _WIN32_WINNT
#else
#define WINVER 0x0A00
#endif
#endif
#ifndef _WIN32_IE
#ifdef _WIN32_WINNT
// set _WIN32_IE based on _WIN32_WINNT
#if (_WIN32_WINNT <= _WIN32_WINNT_NT4)
#define _WIN32_IE _WIN32_IE_IE50
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN2K)
#define _WIN32_IE _WIN32_IE_IE501
#elif (_WIN32_WINNT <= _WIN32_WINNT_WINXP)
#define _WIN32_IE _WIN32_IE_IE60
#elif (_WIN32_WINNT <= _WIN32_WINNT_WS03)
#define _WIN32_IE _WIN32_IE_WS03
#elif (_WIN32_WINNT <= _WIN32_WINNT_VISTA)
#define _WIN32_IE _WIN32_IE_LONGHORN
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN7)
#define _WIN32_IE _WIN32_IE_WIN7
#elif (_WIN32_WINNT <= _WIN32_WINNT_WIN8)
#define _WIN32_IE _WIN32_IE_WIN8
#else
#define _WIN32_IE 0x0A00
#endif
#else
#define _WIN32_IE 0x0A00
#endif
#endif
//
// Sanity check for compatible versions
//
#if defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
#if (defined(WINVER) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400))
#error WINVER setting conflicts with _WIN32_WINNT setting
#endif
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WIN2K) && (_WIN32_WINNT != _WIN32_WINNT_WIN2K))
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
#endif
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WINXP) && (_WIN32_WINNT != _WIN32_WINNT_WINXP))
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
#endif
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_WS03) && (_WIN32_WINNT != _WIN32_WINNT_WS03))
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
#endif
#if (((OSVERSION_MASK & NTDDI_VERSION) == NTDDI_VISTA) && (_WIN32_WINNT != _WIN32_WINNT_VISTA))
#error NTDDI_VERSION setting conflicts with _WIN32_WINNT setting
#endif
#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
#endif
#endif // defined(_WIN32_WINNT) && !defined(MIDL_PASS) && !defined(_WINRESRC_)
#if (_MSC_VER >= 800)
#if (_MSC_VER >= 1200)
#pragma warning(pop)
#else
#pragma warning(default:4001) /* nonstandard extension : single line comment */
#endif
#endif
#endif /* !_INC_SDKDDKVER */
+240
View File
@@ -0,0 +1,240 @@
/*
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
winapifamily.h
Abstract:
Master include file for API family partitioning.
*/
#ifndef _INC_WINAPIFAMILY
#define _INC_WINAPIFAMILY
#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4001) /* nonstandard extension 'single line comment' was used */
#endif
#pragma once
#endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#include <winpackagefamily.h>
/*
* When compiling C and C++ code using SDK header files, the development
* environment can specify a target platform by #define-ing the
* pre-processor symbol WINAPI_FAMILY to one of the following values.
* Each FAMILY value denotes an application family for which a different
* subset of the total set of header-file-defined APIs are available.
* Setting the WINAPI_FAMILY value will effectively hide from the
* editing and compilation environments the existence of APIs that
* are not applicable to the family of applications targeting a
* specific platform.
*/
/* In Windows 10, WINAPI_PARTITIONs will be used to add additional
* device specific APIs to a particular WINAPI_FAMILY.
* For example, when writing Windows Universal apps, specifying
* WINAPI_FAMILY_APP will hide phone APIs from compilation.
* However, specifying WINAPI_PARTITION_PHONE_APP=1 additionally, will
* unhide any API hidden behind the partition, to the compiler.
* The following partitions are currently defined:
* WINAPI_PARTITION_DESKTOP // usable for Desktop Win32 apps (but not store apps)
* WINAPI_PARTITION_APP // usable for Windows Universal store apps
* WINAPI_PARTITION_PC_APP // specific to Desktop-only store apps
* WINAPI_PARTITION_PHONE_APP // specific to Phone-only store apps
* WINAPI_PARTITION_SYSTEM // specific to System applications
* The following partitions are indirect partitions and defined in
* winpackagefamily.h. These partitions are related to package based
* partitions. For example, specifying WINAPI_PARTITION_SERVER=1 will light up
* any API hidden behind the package based partitions that are bound to
* WINAPI_PARTITION_SERVER, to the compiler.
* WINAPI_PARTITION_SERVER // specific to Server applications
*/
/*
* The WINAPI_FAMILY values of 0 and 1 are reserved to ensure that
* an error will occur if WINAPI_FAMILY is set to any
* WINAPI_PARTITION value (which must be 0 or 1, see below).
*/
#define WINAPI_FAMILY_PC_APP 2 /* Windows Store Applications */
#define WINAPI_FAMILY_PHONE_APP 3 /* Windows Phone Applications */
#define WINAPI_FAMILY_SYSTEM 4 /* Windows Drivers and Tools */
#define WINAPI_FAMILY_SERVER 5 /* Windows Server Applications */
#define WINAPI_FAMILY_DESKTOP_APP 100 /* Windows Desktop Applications */
/* The value of WINAPI_FAMILY_DESKTOP_APP may change in future SDKs. */
/* Additional WINAPI_FAMILY values may be defined in future SDKs. */
/*
* For compatibility with Windows 8 header files, the following
* synonym for WINAPI_FAMILY_PC_APP is temporarily #define'd.
* Use of this symbol should be considered deprecated.
*/
#define WINAPI_FAMILY_APP WINAPI_FAMILY_PC_APP
/*
* If no WINAPI_FAMILY value is specified, then all APIs available to
* Windows desktop applications are exposed.
*/
#ifndef WINAPI_FAMILY
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
#endif
/*
* API PARTITONs are part of an indirection mechanism for mapping between
* individual APIs and the FAMILYs to which they apply.
* Each PARTITION is a category or subset of named APIs. PARTITIONs
* are permitted to have overlapping membership -- some single API
* might be part of more than one PARTITION. PARTITIONS are each #define-ed
* to be either 1 or 0 or depending on the platform at which the app is targeted.
*/
/*
* The mapping between families and partitions is summarized here.
* An X indicates that the given partition is active for the given
* platform/family.
*
* +-------------------+---+
* | *Partition* | |
* +---+---+---+---+---+---+
* | | | | | | |
* | | | | | | |
* | | | | P | | |
* | | | | H | | |
* | D | | | O | | |
* | E | | P | N | S | S |
* | S | | C | E | Y | E |
* | K | | _ | _ | S | R |
* | T | A | A | A | T | V |
* +-------------------------+----+ O | P | P | P | E | E |
* | *Platform/Family* \| P | P | P | P | M | R |
* +------------------------------+---+---+---+---+---+---+
* | WINAPI_FAMILY_DESKTOP_APP | X | X | X | | | |
* +------------------------------+---+---+---+---+---+---+
* | WINAPI_FAMILY_PC_APP | | X | X | | | |
* +------------------------------+---+---+---+---+---+---+
* | WINAPI_FAMILY_PHONE_APP | | X | | X | | |
* +----------------------------- +---+---+---+---+---+---+
* | WINAPI_FAMILY_SYSTEM | | | | | X | |
* +----------------------------- +---+---+---+---+---+---+
* | WINAPI_FAMILY_SERVER | | | | | X | X |
* +------------------------------+---+---+---+---+---+---+
*
* The table above is encoded in the following expressions,
* each of which evaluates to 1 or 0.
*
* Whenever a new family is added, all of these expressions
* need to be reconsidered.
*/
#if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP && \
WINAPI_FAMILY != WINAPI_FAMILY_PC_APP && \
WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP && \
WINAPI_FAMILY != WINAPI_FAMILY_SYSTEM && \
WINAPI_FAMILY != WINAPI_FAMILY_SERVER
#error Unknown WINAPI_FAMILY value. Was it defined in terms of a WINAPI_PARTITION_* value?
#endif
#ifndef WINAPI_PARTITION_DESKTOP
#define WINAPI_PARTITION_DESKTOP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
#endif
#ifndef WINAPI_PARTITION_APP
#define WINAPI_PARTITION_APP \
(WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || \
WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#endif
#ifndef WINAPI_PARTITION_PC_APP
#define WINAPI_PARTITION_PC_APP \
(WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
#endif
#ifndef WINAPI_PARTITION_PHONE_APP
#define WINAPI_PARTITION_PHONE_APP (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#endif
/*
* SYSTEM is the only partition defined here.
* All other System based editions are defined as packages
* on top of the System partition.
* See winpackagefamily.h for packages level partitions
*/
#ifndef WINAPI_PARTITION_SYSTEM
#define WINAPI_PARTITION_SYSTEM \
(WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM || \
WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
#endif
/*
* For compatibility with Windows Phone 8 header files, the following
* synonym for WINAPI_PARTITION_PHONE_APP is temporarily #define'd.
* Use of this symbol should be regarded as deprecated.
*/
#define WINAPI_PARTITION_PHONE WINAPI_PARTITION_PHONE_APP
/*
* Header files use the WINAPI_FAMILY_PARTITION macro to assign one or
* more declarations to some group of partitions. The macro chooses
* whether the preprocessor will emit or omit a sequence of declarations
* bracketed by an #if/#endif pair. All header file references to the
* WINAPI_PARTITION_* values should be in the form of occurrences of
* WINAPI_FAMILY_PARTITION(...).
*
* For example, the following usage of WINAPI_FAMILY_PARTITION identifies
* a sequence of declarations that are part of both the Windows Desktop
* Partition and the Windows-Phone-Specific Store Partition:
*
* #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
* ...
* #endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
*
* The comment on the closing #endif allow tools as well as people to find the
* matching #ifdef properly.
*
* Usages of WINAPI_FAMILY_PARTITION may be combined, when the partitition definitions are
* related. In particular one might use declarations like
*
* #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
*
* or
*
* #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
*
* Direct references to WINAPI_PARTITION_ values (eg #if !WINAPI_FAMILY_PARTITION_...)
* should not be used.
*/
#define WINAPI_FAMILY_PARTITION(Partitions) (Partitions)
/*
* Macro used to #define or typedef a symbol used for selective deprecation
* of individual methods of a COM interfaces that are otherwise available
* for a given set of partitions.
*/
#define _WINAPI_DEPRECATED_DECLARATION __declspec(deprecated("This API cannot be used in the context of the caller's application type."))
/*
* For compatibility with Windows 8 header files, the following
* symbol is temporarily conditionally #define'd. Additional symbols
* like this should be not defined in winapifamily.h, but rather should be
* introduced locally to the header files of the component that needs them.
*/
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# define APP_DEPRECATED_HRESULT HRESULT _WINAPI_DEPRECATED_DECLARATION
#endif // WINAPIFAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif
#endif /* !_INC_WINAPIFAMILY */
+91
View File
@@ -0,0 +1,91 @@
/*
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
winpackagefamily.h
Abstract:
API family partitioning based on packages.
*/
#ifndef _INC_WINPACKAGEFAMILY
#define _INC_WINPACKAGEFAMILY
#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4001) /* nonstandard extension 'single line comment' was used */
#endif
#pragma once
#endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#ifndef WINAPI_PARTITION_SERVER
#define WINAPI_PARTITION_SERVER (WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
#endif
/*
* PARTITIONS based on packages are each #undef'ed below, and then will be #define-ed
* to be either 1 or 0 or depending on the active WINAPI_FAMILY.
*/
#undef WINAPI_PARTITION_PKG_WINTRUST
#undef WINAPI_PARTITION_PKG_WEBSERVICES
#undef WINAPI_PARTITION_PKG_EVENTLOGSERVICE
#undef WINAPI_PARTITION_PKG_VHD
#undef WINAPI_PARTITION_PKG_PERFCOUNTER
#undef WINAPI_PARTITION_PKG_SECURESTARTUP
#undef WINAPI_PARTITION_PKG_REMOTEFS
#undef WINAPI_PARTITION_PKG_BOOTABLESKU
#undef WINAPI_PARTITION_PKG_CMDTOOLS
#undef WINAPI_PARTITION_PKG_DISM
#undef WINAPI_PARTITION_PKG_CORESETUP
#undef WINAPI_PARTITION_PKG_APPRUNTIME
#undef WINAPI_PARTITION_PKG_ESENT
#undef WINAPI_PARTITION_PKG_WINMGMT
#undef WINAPI_PARTITION_PKG_WNV
#undef WINAPI_PARTITION_PKG_CLUSTER
#undef WINAPI_PARTITION_PKG_VSS
#undef WINAPI_PARTITION_PKG_TRAFFIC
#undef WINAPI_PARTITION_PKG_ISCSI
#undef WINAPI_PARTITION_PKG_STORAGE
#undef WINAPI_PARTITION_PKG_MPSSVC
#undef WINAPI_PARTITION_PKG_APPXDEPLOYMENT
#undef WINAPI_PARTITION_PKG_WER
/*
* PARTITIONS for feature packages. Each package might be active for one or more editions
*/
#define WINAPI_PARTITION_PKG_WINTRUST (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_WEBSERVICES (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_EVENTLOGSERVICE (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_VHD (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_PERFCOUNTER (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_SECURESTARTUP (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_REMOTEFS (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_BOOTABLESKU (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_CMDTOOLS (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_DISM (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_CORESETUP (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_APPRUNTIME (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_ESENT (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_WINMGMT (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_WNV (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_CLUSTER (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_VSS (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_TRAFFIC (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_ISCSI (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_STORAGE (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_MPSSVC (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_APPXDEPLOYMENT (WINAPI_PARTITION_SERVER == 1)
#define WINAPI_PARTITION_PKG_WER (WINAPI_PARTITION_SERVER == 1)
#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif
#endif /* !_INC_WINPACKAGEFAMILY */
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Vendored Submodule
+1
Submodule 3rdparty/zlib added at cacf7f1d4e
+31 -2
View File
@@ -1,4 +1,11 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.0.2)
option(WITH_GDB "WITH_GDB" OFF)
option(WITHOUT_LLVM "WITHOUT_LLVM" OFF)
if (WITH_GDB)
add_definitions(-DWITH_GDB_DEBUGGER)
endif()
set(ASMJIT_STATIC TRUE)
@@ -11,6 +18,12 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
add_definitions(-DCMAKE_BUILD)
# We use libpng's static library and don't need to build the shared library and run the tests
@@ -22,9 +35,25 @@ if (NOT USE_SYSTEM_LIBPNG)
add_subdirectory( 3rdparty/libpng )
endif()
option(VULKAN_PREBUILT "" OFF)
# TODO: do real installation, including copying directory structure
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
add_subdirectory( Vulkan )
add_subdirectory( rpcs3 )
add_subdirectory( rsx_program_decompiler )
include_directories(3rdparty/hidapi/hidapi)
if(APPLE)
add_subdirectory(3rdparty/hidapi/mac)
#list(APPEND LIBS hidapi)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_subdirectory(3rdparty/hidapi/linux)
elseif(MSVC)
add_subdirectory(3rdparty/hidapi/windows)
else()
add_subdirectory(3rdparty/hidapi/libusb)
#list(APPEND LIBS hidapi-libusb)
endif()
+20
View File
@@ -0,0 +1,20 @@
# Getting Started
Before getting started using the emulator, read the [Quickstart Guide](https://rpcs3.net/quickstart) and the [FAQ](https://rpcs3.net/faq). After reading those, if you need support, visit our [Forums](https://forums.rpcs3.net).
# Issue Reporting
**The GitHub Issue Tracker is not the place to ask for support or to submit [Game Compatibility](https://rpcs3.net/compatibility) reports.** Requests for support or incorrect reports will be closed. If you are not sure whether the issue you want to report is an actual issue that is not yet known, please use the forums to submit such report.
**Before reporting an issue:**
- Check if your system matches all the minimum requirements listed in the [Quickstart Guide](https://rpcs3.net/quickstart);
- Check if the issue is meaningful for the team (e.g. The Last of Us doesn't work is obvious and therefore useless);
- Search older issues/forum threads to see if your issue was already submitted.
- Use understandable English. It doesn't need to be perfect, but clear enough to understand your message.
- While reporting issues, don't forget to include details about your system (OS, CPU, GPU, etc.), as well as the RPCS3.log file.
Submitting your test results for Commercial Games must be done on our forums. Please read the [Game Compatibility](https://github.com/RPCS3/rpcs3/wiki/Game-Compatibility) wiki page before doing so.
# Contributing
Check the [Coding Style Guidelines](https://github.com/RPCS3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/RPCS3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information). If you have any questions, hit us up on our [Discord Server](https://discord.me/RPCS3) in the **#development** channel.
+69 -33
View File
@@ -3,58 +3,94 @@ RPCS3
[![Build Status](https://travis-ci.org/RPCS3/rpcs3.svg?branch=master)](https://travis-ci.org/RPCS3/rpcs3)
[![Build status](https://ci.appveyor.com/api/projects/status/411c4clmiohtx7eo/branch/master?svg=true)](https://ci.appveyor.com/project/rpcs3/rpcs3/branch/master)
[![Coverity Status](https://img.shields.io/coverity/scan/3960.svg)](https://scan.coverity.com/projects/3960)
[![Coverage Status](https://coveralls.io/repos/RPCS3/rpcs3/badge.svg)](https://coveralls.io/r/RPCS3/rpcs3)
An open-source PlayStation 3 emulator/debugger written in C++.
The world's first open-source PlayStation 3 emulator/debugger written in C++ for Windows and Linux.
You can find some basic information in the [FAQ](https://github.com/RPCS3/rpcs3/wiki/FAQ). For discussion about this emulator and PS3 emulation please visit the [official forums](http://www.emunewz.net/forum/forumdisplay.php?fid=162).
You can find some basic information in our [**website**](https://rpcs3.net/).
For discussion about this emulator and PS3 emulation please visit our [**forums**](https://forums.rpcs3.net) and our [**Discord server**](https://discord.me/RPCS3).
[**Support Lead Developers Nekotekina and kd-11 on Patreon**](https://www.patreon.com/Nekotekina)
### Development
## Development
If you want to contribute please take a look at the [Coding Style](https://github.com/RPCS3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/RPCS3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information) pages. You should as well contact any of the developers in the forum in order to know about the current situation of the emulator.
If you want to contribute please take a look at the [Coding Style](https://github.com/RPCS3/rpcs3/wiki/Coding-Style), [Roadmap](https://github.com/RPCS3/rpcs3/wiki/Roadmap) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information) pages. You should as well contact any of the developers in the forums or in Discord in order to know more about the current situation of the emulator.
### Dependencies
## Dependencies
__Windows__
* [Visual Studio 2015](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)
* [Visual C++ Redistributable Packages for Visual Studio 2015](http://www.microsoft.com/en-us/download/details.aspx?id=48145)
* [Cmake 3.1.0+](http://www.cmake.org/download/) (required; add to PATH)
### Windows
* [Visual Studio 2017](https://www.visualstudio.com/en/downloads/)
* [Visual C++ Redistributable Packages for Visual Studio 2017](https://go.microsoft.com/fwlink/?LinkId=746572)
* [Cmake 3.1.0+](https://www.cmake.org/download/) (required; add to PATH)
* [Python 3.3+](https://www.python.org/downloads/) (required; add to PATH)
* [Qt 5.9+](https://www.qt.io/download-open-source/) (required; add QTDIR `<QtInstallFolder>\5.9.1\msvc2015_64\` environment variable if you do not want to use the Visual Studio Qt Plugin)
* [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2015) (optional; see above)
__Linux__
* GCC 5.1+ or Clang 3.5.0+
* Debian & Ubuntu: `sudo apt-get install cmake build-essential libopenal-dev libwxgtk3.0-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev`
* Arch: `sudo pacman -S glew openal wxgtk cmake llvm`
### Linux
* [Qt 5.9+](https://www.qt.io/download-open-source/)
* GCC 5.1+ or Clang 3.5.0+ ([not GCC 6.1](https://github.com/RPCS3/rpcs3/issues/1691))
* Debian & Ubuntu: `sudo apt-get install cmake build-essential libasound2-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git qt5-default`
* Arch: `sudo pacman -S glew openal cmake llvm qt5-base`
* Fedora: `sudo dnf install cmake qt5-devel vulkan-devel glew glew-devel`
**If you have a NVIDIA GPU, you may need to install the libglvnd package.**
__Mac OSX__
### MacOS
MacOS is not supported at this moment because it doesn't meet system requirements (OpenGL 4.3)
* Xcode 6+ (tested with Xcode 6.4)
* Install with Homebrew: `brew install glew wxwidgets`
* Remove '-framework QuickTime' from '_ldflags' in /usr/local/bin/wx-config
* Install with Homebrew: `brew install glew llvm qt cmake`
### Building
## Building on Windows:
To initialize the repository don't forget to execute `git submodule update --init` to pull the submodules.
* __Windows__:
1) Open the *.SLN* file.
2) Build the projects in *__BUILD_BEFORE* folder: right-click on every project > *Build*.
3) Press *BUILD* > *Build Solution* or *Rebuild Solution*.
* __Linux & Mac OSX__:
If you want to build with LLVM, then LLVM 3.8 is required.
`cd rpcs3 && cmake CMakeLists.txt && make && cd ../` then run with `cd bin && ./rpcs3`.
If you are on OSX and want to build with llvm don't forget to add `-DLLVM_DIR=...` (or wherever llvm brew was installed) to cmake invocation.
### Configuring Qt
*If you're using Visual Studio 2017 without Qt plugin support (or simply dont want to use it):*
1) Add `QTDIR` environment variable and set it to `<QtInstallFolder>\5.9.1\msvc2017_64\` </br>
*If you wish to use the Visual Studio plugin for Qt:* </br>
1) Go to the Qt5 menu and edit Qt5 options. Add the path to your Qt installation with compiler e.g. `C:\Qt\5.9.1\msvc2015_64`. </br>
2) While selecting the rpcs3qt project, go to Qt5->Project Setting and select the version you added.
### Building the projects
1) Build the projects in *__BUILD_BEFORE* folder: right-click on every project > *Build*. </br>
2) Press *BUILD* > *Build Solution* or *Rebuild Solution*. </br>
## Building on Linux & Mac OS:
1) `git clone https://github.com/RPCS3/rpcs3.git` </br>
2) `cd rpcs3/` </br>
3) `git submodule update --init` </br>
4) `cmake CMakeLists.txt && make GitVersion && make` </br>
5) Run RPCS3 with `./bin/rpcs3` </br>
If you are on MacOS and want to build with brew llvm and qt don't forget to add the following environment variables
* `LLVM_DIR=/usr/local/opt/llvm/` (or wherever llvm was installed).
* `Qt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5` (or wherever qt was installed).
When using GDB, configure it to ignore SIGSEGV signal (`handle SIGSEGV nostop noprint`).
##### CMake Build Options (Linux & Mac OSX)
- ```-DUSE_SYSTEM_LIBPNG=ON/OFF``` (default = *OFF*) </br>
## CMake Build Options (Linux & Mac OS)
- ```-DUSE_SYSTEM_LIBPNG=ON/OFF``` (default = *OFF*)
Build against the shared libpng instead of using the builtin one. libpng 1.6+ highly recommended. Try this option if you get version conflict errors or only see black game icons.
- ```-DUSE_SYSTEM_FFMPEG=ON/OFF``` (default = *OFF*) </br>
- ```-DUSE_SYSTEM_FFMPEG=ON/OFF``` (default = *OFF*)
Build against the shared ffmpeg libraries instead of using the builtin patched version. Try this if the builtin version breaks the OpenGL renderer for you.
### Support
* [Donate by PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MPJ3S9XQXCE3G)
- ```-DWITHOUT_LLVM=ON/OFF``` (default = *OFF*)
This forces RPCS3 to build without LLVM, not recommended.
- ```-DWITH_GDB=ON/OFF``` (default = *OFF*)
This Builds RPCS3 with support for debugging PS3 games using gdb.
- ```-DUSE_VULKAN=ON/OFF``` (default = *ON*)
This builds RPCS3 with Vulkan support.
## License
Most files are licensed under the terms of GNU GPLv2 License, see LICENSE file for details. Some files may be licensed differently, check appropriate file headers for details.
+103 -42
View File
@@ -1,7 +1,6 @@
#pragma once
#include "types.h"
#include "Platform.h"
// Helper class, provides access to compiler-specific atomic intrinsics
template<typename T, std::size_t Size>
@@ -143,26 +142,38 @@ struct atomic_storage
return atomic_storage<T>::sub_fetch(dest, 1);
}
static inline bool test_and_set(T& dest, T mask)
{
return (atomic_storage<T>::fetch_or(dest, mask) & mask) != 0;
}
static inline bool test_and_reset(T& dest, T mask)
{
return (atomic_storage<T>::fetch_and(dest, ~mask) & mask) != 0;
}
static inline bool test_and_complement(T& dest, T mask)
{
return (atomic_storage<T>::fetch_xor(dest, mask) & mask) != 0;
}
static inline bool bts(T& dest, uint bit)
{
const T mask = static_cast<T>(1) << bit;
return (atomic_storage<T>::fetch_or(dest, mask) & mask) != 0;
return atomic_storage<T>::test_and_set(dest, static_cast<T>(1) << bit);
}
static inline bool btr(T& dest, uint bit)
{
const T mask = static_cast<T>(1) << bit;
return (atomic_storage<T>::fetch_and(dest, ~mask) & mask) != 0;
return atomic_storage<T>::test_and_reset(dest, static_cast<T>(1) << bit);
}
static inline bool btc(T& dest, uint bit)
{
const T mask = static_cast<T>(1) << bit;
return (atomic_storage<T>::fetch_xor(dest, mask) & mask) != 0;
return atomic_storage<T>::test_and_complement(dest, static_cast<T>(1) << bit);
}
};
/* The rest: ugly MSVC intrinsics + possibly __asm__ implementations (TODO) */
/* The rest: ugly MSVC intrinsics + inline asm implementations */
template<typename T>
struct atomic_storage<T, 1> : atomic_storage<T, 0>
@@ -285,6 +296,30 @@ struct atomic_storage<T, 2> : atomic_storage<T, 0>
short r = _InterlockedDecrement16((volatile short*)&dest);
return (T&)r;
}
#else
static inline bool bts(T& dest, uint bit)
{
bool result;
ushort _bit = (ushort)bit;
__asm__("lock btsw %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
static inline bool btr(T& dest, uint bit)
{
bool result;
ushort _bit = (ushort)bit;
__asm__("lock btrw %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
static inline bool btc(T& dest, uint bit)
{
bool result;
ushort _bit = (ushort)bit;
__asm__("lock btcw %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
#endif
};
@@ -363,6 +398,27 @@ struct atomic_storage<T, 4> : atomic_storage<T, 0>
{
return _interlockedbittestandreset((volatile long*)&dest, bit) != 0;
}
#else
static inline bool bts(T& dest, uint bit)
{
bool result;
__asm__("lock btsl %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (bit) : "cc");
return result;
}
static inline bool btr(T& dest, uint bit)
{
bool result;
__asm__("lock btrl %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (bit) : "cc");
return result;
}
static inline bool btc(T& dest, uint bit)
{
bool result;
__asm__("lock btcl %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (bit) : "cc");
return result;
}
#endif
};
@@ -441,6 +497,30 @@ struct atomic_storage<T, 8> : atomic_storage<T, 0>
{
return _interlockedbittestandreset64((volatile llong*)&dest, bit) != 0;
}
#else
static inline bool bts(T& dest, uint bit)
{
bool result;
ullong _bit = bit;
__asm__("lock btsq %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
static inline bool btr(T& dest, uint bit)
{
bool result;
ullong _bit = bit;
__asm__("lock btrq %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
static inline bool btc(T& dest, uint bit)
{
bool result;
ullong _bit = bit;
__asm__("lock btcq %2, %0\n" "setc %1" : "+m" (dest), "=r" (result) : "Ir" (_bit) : "cc");
return result;
}
#endif
};
@@ -456,7 +536,7 @@ struct atomic_storage<T, 16> : atomic_storage<T, 0>
static inline T load(const T& dest)
{
llong result[2];
llong result[2]{0, 0};
_InterlockedCompareExchange128((volatile llong*)&dest, 0, 0, result);
return *(T*)+result;
}
@@ -478,6 +558,8 @@ struct atomic_storage<T, 16> : atomic_storage<T, 0>
return *(T*)+cmp;
}
#endif
// TODO
};
template<typename T1, typename T2, typename>
@@ -630,21 +712,16 @@ struct atomic_test_and_set
{
bool operator()(T1& lhs, const T2& rhs) const
{
return lhs.test_and_set(rhs);
return test_and_set(lhs, rhs);
}
};
template<typename T1, typename T2>
struct atomic_test_and_set<T1, T2, std::enable_if_t<std::is_integral<T1>::value && std::is_convertible<T2, T1>::value>>
{
static inline bool op(T1& lhs, const T2& rhs)
{
return (atomic_storage<T1>::fetch_or(lhs, rhs) & rhs) != 0;
}
static constexpr auto fetch_op = &op;
static constexpr auto op_fetch = &op;
static constexpr auto atomic_op = &op;
static constexpr auto fetch_op = &atomic_storage<T1>::test_and_set;
static constexpr auto op_fetch = &atomic_storage<T1>::test_and_set;
static constexpr auto atomic_op = &atomic_storage<T1>::test_and_set;
};
template<typename T1, typename T2, typename>
@@ -652,21 +729,16 @@ struct atomic_test_and_reset
{
bool operator()(T1& lhs, const T2& rhs) const
{
return lhs.test_and_reset(rhs);
return test_and_reset(lhs, rhs);
}
};
template<typename T1, typename T2>
struct atomic_test_and_reset<T1, T2, std::enable_if_t<std::is_integral<T1>::value && std::is_convertible<T2, T1>::value>>
{
static inline bool op(T1& lhs, const T2& rhs)
{
return (atomic_storage<T1>::fetch_and(lhs, ~rhs) & rhs) != 0;
}
static constexpr auto fetch_op = &op;
static constexpr auto op_fetch = &op;
static constexpr auto atomic_op = &op;
static constexpr auto fetch_op = &atomic_storage<T1>::test_and_reset;
static constexpr auto op_fetch = &atomic_storage<T1>::test_and_reset;
static constexpr auto atomic_op = &atomic_storage<T1>::test_and_reset;
};
template<typename T1, typename T2, typename>
@@ -674,21 +746,16 @@ struct atomic_test_and_complement
{
bool operator()(T1& lhs, const T2& rhs) const
{
return lhs.test_and_complement(rhs);
return test_and_complement(lhs, rhs);
}
};
template<typename T1, typename T2>
struct atomic_test_and_complement<T1, T2, std::enable_if_t<std::is_integral<T1>::value && std::is_convertible<T2, T1>::value>>
{
static inline bool op(T1& lhs, const T2& rhs)
{
return (atomic_storage<T1>::fetch_xor(lhs, rhs) & rhs) != 0;
}
static constexpr auto fetch_op = &op;
static constexpr auto op_fetch = &op;
static constexpr auto atomic_op = &op;
static constexpr auto fetch_op = &atomic_storage<T1>::test_and_complement;
static constexpr auto op_fetch = &atomic_storage<T1>::test_and_complement;
static constexpr auto atomic_op = &atomic_storage<T1>::test_and_complement;
};
// Atomic type with lock-free and standard layout guarantees (and appropriate limitations)
@@ -954,12 +1021,6 @@ public:
return atomic_op(atomic_post_dec<type>{});
}
template<typename T2 = T>
auto test(const T2& rhs) const
{
return load().test(rhs);
}
template<typename T2 = T>
auto test_and_set(const T2& rhs)
{
-73
View File
@@ -1,73 +0,0 @@
#include "stdafx.h"
#include "Config.h"
#include "Emu/System.h"
#include "AutoPause.h"
cfg::bool_entry g_cfg_debug_autopause_syscall(cfg::root.misc, "Auto Pause at System Call");
cfg::bool_entry g_cfg_debug_autopause_func_call(cfg::root.misc, "Auto Pause at Function Call");
debug::autopause& debug::autopause::get_instance()
{
// Use magic static
static autopause instance;
return instance;
}
// Load Auto Pause Configuration from file "pause.bin"
void debug::autopause::reload(void)
{
auto& instance = get_instance();
instance.m_pause_function.clear();
instance.m_pause_syscall.clear();
// TODO: better format, possibly a config entry
if (fs::file list{ fs::get_config_dir() + "pause.bin" })
{
u32 num;
size_t fmax = list.size();
size_t fcur = 0;
list.seek(0);
while (fcur <= fmax - sizeof(u32))
{
list.read(&num, sizeof(u32));
fcur += sizeof(u32);
if (num == 0xFFFFFFFF) break;
if (num < 1024)
{
instance.m_pause_syscall.emplace(num);
LOG_WARNING(HLE, "Set autopause at syscall %lld", num);
}
else
{
instance.m_pause_function.emplace(num);
LOG_WARNING(HLE, "Set autopause at function 0x%08x", num);
}
}
}
}
bool debug::autopause::pause_syscall(u64 code)
{
if (g_cfg_debug_autopause_syscall && get_instance().m_pause_syscall.count(code) != 0)
{
Emu.Pause();
LOG_SUCCESS(HLE, "Autopause triggered at syscall %lld", code);
return true;
}
return false;
}
bool debug::autopause::pause_function(u32 code)
{
if (g_cfg_debug_autopause_func_call && get_instance().m_pause_function.count(code) != 0)
{
Emu.Pause();
LOG_SUCCESS(HLE, "Autopause triggered at function 0x%08x", code);
return true;
}
return false;
}
-22
View File
@@ -1,22 +0,0 @@
#pragma once
#include <unordered_set>
// Regarded as a Debugger Enchantment
namespace debug
{
// To store the pause function/call id, and let those pause there.
// Would be with a GUI to configure those.
class autopause
{
std::unordered_set<u64> m_pause_syscall;
std::unordered_set<u32> m_pause_function;
static autopause& get_instance();
public:
static void reload();
static bool pause_syscall(u64 code);
static bool pause_function(u32 code);
};
}
+245 -360
View File
@@ -1,56 +1,58 @@
#pragma once
#include "types.h"
#include "Platform.h"
// 128-bit vector type and also se_storage<> storage type
union alignas(16) v128
{
char _bytes[16];
template<typename T, std::size_t N, std::size_t M>
template <typename T, std::size_t N, std::size_t M>
struct masked_array_t // array type accessed as (index ^ M)
{
T m_data[N];
public:
T& operator [](std::size_t index)
T& operator[](std::size_t index)
{
return m_data[index ^ M];
}
const T& operator [](std::size_t index) const
const T& operator[](std::size_t index) const
{
return m_data[index ^ M];
}
};
#if IS_LE_MACHINE == 1
template<typename T, std::size_t N = 16 / sizeof(T)> using normal_array_t = masked_array_t<T, N, 0>;
template<typename T, std::size_t N = 16 / sizeof(T)> using reversed_array_t = masked_array_t<T, N, N - 1>;
template <typename T, std::size_t N = 16 / sizeof(T)>
using normal_array_t = masked_array_t<T, N, 0>;
template <typename T, std::size_t N = 16 / sizeof(T)>
using reversed_array_t = masked_array_t<T, N, N - 1>;
#endif
normal_array_t<u64> _u64;
normal_array_t<s64> _s64;
normal_array_t<u64> _u64;
normal_array_t<s64> _s64;
reversed_array_t<u64> u64r;
reversed_array_t<s64> s64r;
normal_array_t<u32> _u32;
normal_array_t<s32> _s32;
normal_array_t<u32> _u32;
normal_array_t<s32> _s32;
reversed_array_t<u32> u32r;
reversed_array_t<s32> s32r;
normal_array_t<u16> _u16;
normal_array_t<s16> _s16;
normal_array_t<u16> _u16;
normal_array_t<s16> _s16;
reversed_array_t<u16> u16r;
reversed_array_t<s16> s16r;
normal_array_t<u8> _u8;
normal_array_t<s8> _s8;
reversed_array_t<u8> u8r;
reversed_array_t<s8> s8r;
normal_array_t<u8> _u8;
normal_array_t<s8> _s8;
reversed_array_t<u8> u8r;
reversed_array_t<s8> s8r;
normal_array_t<f32> _f;
normal_array_t<f64> _d;
normal_array_t<f32> _f;
normal_array_t<f64> _d;
reversed_array_t<f32> fr;
reversed_array_t<f64> dr;
@@ -80,7 +82,7 @@ union alignas(16) v128
return (data & mask) != 0;
}
bit_element& operator =(const bool right)
bit_element& operator=(const bool right)
{
if (right)
{
@@ -93,7 +95,7 @@ union alignas(16) v128
return *this;
}
bit_element& operator =(const bit_element& right)
bit_element& operator=(const bit_element& right)
{
if (right)
{
@@ -108,7 +110,7 @@ union alignas(16) v128
};
// Index 0 returns the MSB and index 127 returns the LSB
bit_element operator [](u32 index)
bit_element operator[](u32 index)
{
#if IS_LE_MACHINE == 1
return bit_element(m_data[1 - (index >> 6)], 0x8000000000000000ull >> (index & 0x3F));
@@ -116,14 +118,13 @@ union alignas(16) v128
}
// Index 0 returns the MSB and index 127 returns the LSB
bool operator [](u32 index) const
bool operator[](u32 index) const
{
#if IS_LE_MACHINE == 1
return (m_data[1 - (index >> 6)] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
#endif
}
}
_bit;
} _bit;
static v128 from64(u64 _0, u64 _1 = 0)
{
@@ -277,12 +278,12 @@ union alignas(16) v128
return fromV(_mm_cmpeq_epi32(left.vi, right.vi));
}
bool operator ==(const v128& right) const
bool operator==(const v128& right) const
{
return _u64[0] == right._u64[0] && _u64[1] == right._u64[1];
}
bool operator !=(const v128& right) const
bool operator!=(const v128& right) const
{
return _u64[0] != right._u64[0] || _u64[1] != right._u64[1];
}
@@ -298,43 +299,79 @@ union alignas(16) v128
_u64[0] = 0;
_u64[1] = 0;
}
std::string to_hex() const;
std::string to_xyzw() const;
};
inline v128 operator |(const v128& left, const v128& right)
template <typename T, std::size_t N, std::size_t M>
struct offset32_array<v128::masked_array_t<T, N, M>>
{
template <typename Arg>
static inline u32 index32(const Arg& arg)
{
return SIZE_32(T) * (static_cast<u32>(arg) ^ static_cast<u32>(M));
}
};
inline v128 operator|(const v128& left, const v128& right)
{
return v128::fromV(_mm_or_si128(left.vi, right.vi));
}
inline v128 operator &(const v128& left, const v128& right)
inline v128 operator&(const v128& left, const v128& right)
{
return v128::fromV(_mm_and_si128(left.vi, right.vi));
}
inline v128 operator ^(const v128& left, const v128& right)
inline v128 operator^(const v128& left, const v128& right)
{
return v128::fromV(_mm_xor_si128(left.vi, right.vi));
}
inline v128 operator ~(const v128& other)
inline v128 operator~(const v128& other)
{
return v128::from64(~other._u64[0], ~other._u64[1]);
}
#define IS_INTEGER(t) (std::is_integral<t>::value || std::is_enum<t>::value)
#define IS_BINARY_COMPARABLE(t1, t2) (IS_INTEGER(t1) && IS_INTEGER(t2) && sizeof(t1) == sizeof(t2))
template<typename T, std::size_t Size = sizeof(T)>
template <typename T, std::size_t Align, std::size_t Size>
struct se_storage
{
static_assert(!Size, "Bad se_storage<> type");
using type = std::aligned_storage_t<Size, Align>;
// Unoptimized generic byteswap for unaligned data
static void reverse(u8* dst, const u8* src)
{
for (std::size_t i = 0; i < Size; i++)
{
dst[i] = src[Size - 1 - i];
}
}
static type to(const T& src)
{
type result;
reverse(reinterpret_cast<u8*>(&result), reinterpret_cast<const u8*>(&src));
return result;
}
static T from(const type& src)
{
T result;
reverse(reinterpret_cast<u8*>(&result), reinterpret_cast<const u8*>(&src));
return result;
}
static type copy(const type& src)
{
type result;
for (std::size_t i = 0; i < Size; i++)
{
reinterpret_cast<u8*>(&result)[i] = reinterpret_cast<const u8*>(&src)[i];
}
return result;
}
};
template<typename T>
struct se_storage<T, 2>
template <typename T>
struct se_storage<T, 2, 2>
{
using type = u16;
@@ -357,10 +394,15 @@ struct se_storage<T, 2>
const u16 result = swap(src);
return reinterpret_cast<const T&>(result);
}
static inline T copy(const T& src)
{
return src;
}
};
template<typename T>
struct se_storage<T, 4>
template <typename T>
struct se_storage<T, 4, 4>
{
using type = u32;
@@ -383,10 +425,15 @@ struct se_storage<T, 4>
const u32 result = swap(src);
return reinterpret_cast<const T&>(result);
}
static inline T copy(const T& src)
{
return src;
}
};
template<typename T>
struct se_storage<T, 8>
template <typename T>
struct se_storage<T, 8, 8>
{
using type = u64;
@@ -409,10 +456,15 @@ struct se_storage<T, 8>
const u64 result = swap(src);
return reinterpret_cast<const T&>(result);
}
static inline T copy(const T& src)
{
return src;
}
};
template<typename T>
struct se_storage<T, 16>
template <typename T>
struct se_storage<T, 16, 16>
{
using type = v128;
@@ -431,43 +483,20 @@ struct se_storage<T, 16>
const v128 result = swap(src);
return reinterpret_cast<const T&>(result);
}
};
template<typename T> using se_storage_t = typename se_storage<T>::type;
template<typename T1, typename T2>
struct se_convert
{
using type_from = std::remove_cv_t<T1>;
using type_to = std::remove_cv_t<T2>;
using stype_from = se_storage_t<std::remove_cv_t<T1>>;
using stype_to = se_storage_t<std::remove_cv_t<T2>>;
using storage_from = se_storage<std::remove_cv_t<T1>>;
using storage_to = se_storage<std::remove_cv_t<T2>>;
static inline std::enable_if_t<std::is_same<type_from, type_to>::value, stype_to> convert(const stype_from& data)
static inline T copy(const T& src)
{
return data;
}
static inline stype_to convert(const stype_from& data, ...)
{
return storage_to::to(storage_from::from(data));
return src;
}
};
static struct se_raw_tag_t {} constexpr se_raw{};
template<typename T, bool Se = true>
class se_t;
// Switched endianness
template<typename T>
class se_t<T, true>
template <typename T, std::size_t Align>
class se_t<T, true, Align>
{
using type = typename std::remove_cv<T>::type;
using stype = se_storage_t<type>;
using storage = se_storage<type>;
using stype = typename se_storage<type, Align>::type;
using storage = se_storage<type, Align>;
stype m_data;
@@ -476,24 +505,6 @@ class se_t<T, true>
static_assert(!std::is_array<type>::value, "se_t<> error: invalid type (array)");
static_assert(sizeof(type) == alignof(type), "se_t<> error: unexpected alignment");
template<typename T2, typename = void>
struct bool_converter
{
static inline bool to_bool(const se_t<T2>& value)
{
return static_cast<bool>(value.value());
}
};
template<typename T2>
struct bool_converter<T2, std::enable_if_t<std::is_integral<T2>::value>>
{
static inline bool to_bool(const se_t<T2>& value)
{
return value.m_data != 0;
}
};
public:
se_t() = default;
@@ -503,27 +514,15 @@ public:
: m_data(storage::to(value))
{
}
// Construct directly from raw data (don't use)
constexpr se_t(const stype& raw_value, const se_raw_tag_t&)
: m_data(raw_value)
{
}
type value() const
{
return storage::from(m_data);
}
// Access underlying raw data (don't use)
constexpr const stype& raw_data() const noexcept
{
return m_data;
}
se_t& operator =(const se_t&) = default;
se_t& operator=(const se_t&) = default;
se_t& operator =(type value)
se_t& operator=(type value)
{
return m_data = storage::to(value), *this;
}
@@ -534,181 +533,127 @@ public:
{
return storage::from(m_data);
}
// Optimization
explicit operator bool() const
{
return bool_converter<type>::to_bool(*this);
}
// Optimization
template<typename T2>
std::enable_if_t<IS_BINARY_COMPARABLE(T, T2), se_t&> operator &=(const se_t<T2>& right)
{
return m_data &= right.raw_data(), *this;
}
// Optimization
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator &=(CT right)
{
return m_data &= storage::to(right), *this;
}
// Optimization
template<typename T2>
std::enable_if_t<IS_BINARY_COMPARABLE(T, T2), se_t&> operator |=(const se_t<T2>& right)
{
return m_data |= right.raw_data(), *this;
}
// Optimization
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator |=(CT right)
{
return m_data |= storage::to(right), *this;
}
// Optimization
template<typename T2>
std::enable_if_t<IS_BINARY_COMPARABLE(T, T2), se_t&> operator ^=(const se_t<T2>& right)
{
return m_data ^= right.raw_data(), *this;
}
// Optimization
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator ^=(CT right)
{
return m_data ^= storage::to(right), *this;
}
};
// Native endianness
template<typename T>
class se_t<T, false>
template <typename T, std::size_t Align>
class se_t<T, false, Align>
{
using type = typename std::remove_cv<T>::type;
using stype = typename se_storage<type, Align>::type;
using storage = se_storage<type, Align>;
static_assert(!std::is_pointer<type>::value, "se_t<> error: invalid type (pointer)");
static_assert(!std::is_reference<type>::value, "se_t<> error: invalid type (reference)");
static_assert(!std::is_array<type>::value, "se_t<> error: invalid type (array)");
static_assert(sizeof(type) == alignof(type), "se_t<> error: unexpected alignment");
type m_data;
stype m_data;
public:
se_t() = default;
constexpr se_t(type value)
: m_data(value)
se_t(type value)
: m_data(reinterpret_cast<const stype&>(value))
{
}
// Construct directly from raw data (don't use)
constexpr se_t(const type& raw_value, const se_raw_tag_t&)
: m_data(raw_value)
type value() const
{
return storage::copy(reinterpret_cast<const type&>(m_data));
}
constexpr type value() const
{
return m_data;
}
se_t& operator=(const se_t& value) = default;
// Access underlying raw data (don't use)
constexpr const type& raw_data() const noexcept
se_t& operator=(type value)
{
return m_data;
}
se_t& operator =(const se_t& value) = default;
se_t& operator =(type value)
{
return m_data = value, *this;
return m_data = reinterpret_cast<const stype&>(value), *this;
}
using simple_type = simple_t<T>;
constexpr operator type() const
operator type() const
{
return m_data;
}
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator &=(const CT& right)
{
return m_data &= right, *this;
}
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator |=(const CT& right)
{
return m_data |= right, *this;
}
template<typename CT>
std::enable_if_t<std::is_integral<T>::value && std::is_convertible<CT, T>::value, se_t&> operator ^=(const CT& right)
{
return m_data ^= right, *this;
return storage::copy(reinterpret_cast<const type&>(m_data));
}
};
// se_t with native endianness (alias)
template<typename T> using nse_t = se_t<T, false>;
// se_t<> with native endianness
template <typename T, std::size_t Align = alignof(T)>
using nse_t = se_t<T, false, Align>;
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator +=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator+=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value += right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator -=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator-=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value -= right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator *=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator*=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value *= right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator /=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator/=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value /= right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator %=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator%=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value %= right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator <<=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator&=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value &= right);
}
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator|=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value |= right);
}
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator^=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value ^= right);
}
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator<<=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value <<= right);
}
template<typename T, bool Se, typename T1>
inline se_t<T, Se>& operator >>=(se_t<T, Se>& left, const T1& right)
template <typename T, bool Se, std::size_t Align, typename T1>
inline se_t<T, Se, Align>& operator>>=(se_t<T, Se, Align>& left, const T1& right)
{
auto value = left.value();
return left = (value >>= right);
}
template<typename T, bool Se>
inline se_t<T, Se> operator ++(se_t<T, Se>& left, int)
template <typename T, bool Se, std::size_t Align>
inline se_t<T, Se, Align> operator++(se_t<T, Se, Align>& left, int)
{
auto value = left.value();
auto result = value++;
@@ -716,8 +661,8 @@ inline se_t<T, Se> operator ++(se_t<T, Se>& left, int)
return result;
}
template<typename T, bool Se>
inline se_t<T, Se> operator --(se_t<T, Se>& left, int)
template <typename T, bool Se, std::size_t Align>
inline se_t<T, Se, Align> operator--(se_t<T, Se, Align>& left, int)
{
auto value = left.value();
auto result = value--;
@@ -725,173 +670,111 @@ inline se_t<T, Se> operator --(se_t<T, Se>& left, int)
return result;
}
template<typename T, bool Se>
inline se_t<T, Se>& operator ++(se_t<T, Se>& right)
template <typename T, bool Se, std::size_t Align>
inline se_t<T, Se, Align>& operator++(se_t<T, Se, Align>& right)
{
auto value = right.value();
return right = ++value;
}
template<typename T, bool Se>
inline se_t<T, Se>& operator --(se_t<T, Se>& right)
template <typename T, bool Se, std::size_t Align>
inline se_t<T, Se, Align>& operator--(se_t<T, Se, Align>& right)
{
auto value = right.value();
return right = --value;
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_BINARY_COMPARABLE(T1, T2), bool> operator ==(const se_t<T1>& left, const se_t<T2>& right)
{
return left.raw_data() == right.raw_data();
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<std::is_integral<T1>::value && IS_INTEGER(T2) && sizeof(T1) >= sizeof(T2), bool> operator ==(const se_t<T1>& left, T2 right)
{
return left.raw_data() == se_storage<T1>::to(right);
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_INTEGER(T1) && std::is_integral<T2>::value && sizeof(T1) <= sizeof(T2), bool> operator ==(T1 left, const se_t<T2>& right)
{
return se_storage<T2>::to(left) == right.raw_data();
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_BINARY_COMPARABLE(T1, T2), bool> operator !=(const se_t<T1>& left, const se_t<T2>& right)
{
return left.raw_data() != right.raw_data();
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<std::is_integral<T1>::value && IS_INTEGER(T2) && sizeof(T1) >= sizeof(T2), bool> operator !=(const se_t<T1>& left, T2 right)
{
return left.raw_data() != se_storage<T1>::to(right);
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_INTEGER(T1) && std::is_integral<T2>::value && sizeof(T1) <= sizeof(T2), bool> operator !=(T1 left, const se_t<T2>& right)
{
return se_storage<T2>::to(left) != right.raw_data();
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_BINARY_COMPARABLE(T1, T2) && sizeof(T1) >= 4, se_t<decltype(T1() & T2())>> operator &(const se_t<T1>& left, const se_t<T2>& right)
{
return{ left.raw_data() & right.raw_data(), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<std::is_integral<T1>::value && IS_INTEGER(T2) && sizeof(T1) >= sizeof(T2) && sizeof(T1) >= 4, se_t<decltype(T1() & T2())>> operator &(const se_t<T1>& left, T2 right)
{
return{ left.raw_data() & se_storage<T1>::to(right), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_INTEGER(T1) && std::is_integral<T2>::value && sizeof(T1) <= sizeof(T2) && sizeof(T2) >= 4, se_t<decltype(T1() & T2())>> operator &(T1 left, const se_t<T2>& right)
{
return{ se_storage<T2>::to(left) & right.raw_data(), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_BINARY_COMPARABLE(T1, T2) && sizeof(T1) >= 4, se_t<decltype(T1() | T2())>> operator |(const se_t<T1>& left, const se_t<T2>& right)
{
return{ left.raw_data() | right.raw_data(), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<std::is_integral<T1>::value && IS_INTEGER(T2) && sizeof(T1) >= sizeof(T2) && sizeof(T1) >= 4, se_t<decltype(T1() | T2())>> operator |(const se_t<T1>& left, T2 right)
{
return{ left.raw_data() | se_storage<T1>::to(right), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_INTEGER(T1) && std::is_integral<T2>::value && sizeof(T1) <= sizeof(T2) && sizeof(T2) >= 4, se_t<decltype(T1() | T2())>> operator |(T1 left, const se_t<T2>& right)
{
return{ se_storage<T2>::to(left) | right.raw_data(), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_BINARY_COMPARABLE(T1, T2) && sizeof(T1) >= 4, se_t<decltype(T1() ^ T2())>> operator ^(const se_t<T1>& left, const se_t<T2>& right)
{
return{ left.raw_data() ^ right.raw_data(), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<std::is_integral<T1>::value && IS_INTEGER(T2) && sizeof(T1) >= sizeof(T2) && sizeof(T1) >= 4, se_t<decltype(T1() ^ T2())>> operator ^(const se_t<T1>& left, T2 right)
{
return{ left.raw_data() ^ se_storage<T1>::to(right), se_raw };
}
// Optimization
template<typename T1, typename T2>
inline std::enable_if_t<IS_INTEGER(T1) && std::is_integral<T2>::value && sizeof(T1) <= sizeof(T2) && sizeof(T2) >= 4, se_t<decltype(T1() ^ T2())>> operator ^(T1 left, const se_t<T2>& right)
{
return{ se_storage<T2>::to(left) ^ right.raw_data(), se_raw };
}
// Optimization
template<typename T>
inline std::enable_if_t<std::is_integral<T>::value && sizeof(T) >= 4, se_t<decltype(~T())>> operator ~(const se_t<T>& right)
{
return{ ~right.raw_data(), se_raw };
}
#if IS_LE_MACHINE == 1
template<typename T> using be_t = se_t<T, true>;
template<typename T> using le_t = se_t<T, false>;
template <typename T, std::size_t Align = alignof(T)>
using be_t = se_t<T, true, Align>;
template <typename T, std::size_t Align = alignof(T)>
using le_t = se_t<T, false, Align>;
#endif
// Type converter: converts native endianness arithmetic/enum types to appropriate se_t<> type
template<typename T, bool Se, typename = void>
template <typename T, bool Se, typename = void>
struct to_se
{
template <typename T2, typename = void>
struct to_se_
{
using type = T2;
};
template <typename T2>
struct to_se_<T2, std::enable_if_t<std::is_arithmetic<T2>::value || std::is_enum<T2>::value>>
{
using type = se_t<T2, Se>;
};
// Convert arithmetic and enum types
using type = typename std::conditional<std::is_arithmetic<T>::value || std::is_enum<T>::value, se_t<T, Se>, T>::type;
using type = typename to_se_<T>::type;
};
template<bool Se> struct to_se<v128, Se> { using type = se_t<v128, Se>; };
template<bool Se> struct to_se<bool, Se> { using type = bool; };
template<bool Se> struct to_se<char, Se> { using type = char; };
template<bool Se> struct to_se<u8, Se> { using type = u8; };
template<bool Se> struct to_se<s8, Se> { using type = s8; };
template <bool Se>
struct to_se<v128, Se>
{
using type = se_t<v128, Se>;
};
template<typename T, bool Se>
struct to_se<const T, Se, std::enable_if_t<!std::is_array<T>::value>>
template <bool Se>
struct to_se<u128, Se>
{
using type = se_t<u128, Se>;
};
template <bool Se>
struct to_se<s128, Se>
{
using type = se_t<s128, Se>;
};
template <bool Se>
struct to_se<bool, Se>
{
using type = bool;
};
template <bool Se>
struct to_se<char, Se>
{
using type = char;
};
template <bool Se>
struct to_se<u8, Se>
{
using type = u8;
};
template <bool Se>
struct to_se<s8, Se>
{
using type = s8;
};
template <typename T, bool Se>
struct to_se<const T, Se, std::enable_if_t<!std::is_array<T>::value>>
{
// Move const qualifier
using type = const typename to_se<T, Se>::type;
};
template<typename T, bool Se>
template <typename T, bool Se>
struct to_se<volatile T, Se, std::enable_if_t<!std::is_array<T>::value && !std::is_const<T>::value>>
{
// Move volatile qualifier
using type = volatile typename to_se<T, Se>::type;
};
template<typename T, bool Se>
template <typename T, bool Se>
struct to_se<T[], Se>
{
// Move array qualifier
using type = typename to_se<T, Se>::type[];
};
template<typename T, bool Se, std::size_t N>
template <typename T, bool Se, std::size_t N>
struct to_se<T[N], Se>
{
// Move array qualifier
@@ -900,25 +783,27 @@ struct to_se<T[N], Se>
// BE/LE aliases for to_se<>
#if IS_LE_MACHINE == 1
template<typename T> using to_be_t = typename to_se<T, true>::type;
template<typename T> using to_le_t = typename to_se<T, false>::type;
template <typename T>
using to_be_t = typename to_se<T, true>::type;
template <typename T>
using to_le_t = typename to_se<T, false>::type;
#endif
// BE/LE aliases for atomic_t
#if IS_LE_MACHINE == 1
template<typename T> using atomic_be_t = atomic_t<be_t<T>>;
template<typename T> using atomic_le_t = atomic_t<le_t<T>>;
template <typename T>
using atomic_be_t = atomic_t<be_t<T>>;
template <typename T>
using atomic_le_t = atomic_t<le_t<T>>;
#endif
// Formatting for BE/LE data
template<typename T, bool Se>
struct unveil<se_t<T, Se>, void>
template <typename T, bool Se, std::size_t Align>
struct fmt_unveil<se_t<T, Se, Align>, void>
{
static inline auto get(const se_t<T, Se>& arg)
using type = typename fmt_unveil<T>::type;
static inline auto get(const se_t<T, Se, Align>& arg)
{
return unveil<T>::get(arg);
return fmt_unveil<T>::get(arg);
}
};
#undef IS_BINARY_COMPARABLE
#undef IS_INTEGER
+58 -19
View File
@@ -7,15 +7,19 @@ struct bf_base
{
using type = T;
using vtype = simple_t<type>;
using utype = typename std::make_unsigned<vtype>::type;
// Datatype bitsize
static constexpr uint bitmax = sizeof(T) * CHAR_BIT; static_assert(N - 1 < bitmax, "bf_base<> error: N out of bounds");
static constexpr uint bitmax = sizeof(T) * 8; static_assert(N - 1 < bitmax, "bf_base<> error: N out of bounds");
// Field bitsize
static constexpr uint bitsize = N;
// Value mask
static constexpr vtype vmask = static_cast<vtype>(~std::make_unsigned_t<vtype>{} >> (bitmax - bitsize));
static constexpr utype vmask = static_cast<utype>(~utype{} >> (bitmax - bitsize));
// All ones mask
static constexpr utype mask1 = static_cast<utype>(~utype{});
protected:
type m_data;
@@ -27,14 +31,15 @@ struct bf_t : bf_base<T, N>
{
using type = typename bf_t::type;
using vtype = typename bf_t::vtype;
using utype = typename bf_t::utype;
// Field offset
static constexpr uint bitpos = I; static_assert(bitpos + N <= bf_t::bitmax, "bf_t<> error: I out of bounds");
// Get bitmask of size N, at I pos
static constexpr vtype data_mask()
static constexpr utype data_mask()
{
return bf_t::vmask << bitpos;
return static_cast<utype>(static_cast<utype>(bf_t::mask1 >> (bf_t::bitmax - bf_t::bitsize)) << bitpos);
}
// Bitfield extraction helper
@@ -50,7 +55,7 @@ struct bf_t : bf_base<T, N>
// Load unsigned value
static constexpr T2 extract(const T& data)
{
return (data >> bitpos) & bf_t::vmask;
return static_cast<T2>((static_cast<utype>(data) >> bitpos) & bf_t::vmask);
}
};
@@ -60,7 +65,7 @@ struct bf_t : bf_base<T, N>
// Load signed value (sign-extended)
static constexpr T2 extract(const T& data)
{
return data << (bf_t::bitmax - bitpos - N) >> (bf_t::bitmax - N);
return static_cast<T2>(static_cast<vtype>(static_cast<utype>(data) << (bf_t::bitmax - bitpos - N)) >> (bf_t::bitmax - N));
}
};
@@ -73,7 +78,7 @@ struct bf_t : bf_base<T, N>
// Bitfield insertion
static constexpr vtype insert(vtype value)
{
return (value & bf_t::vmask) << bitpos;
return static_cast<vtype>((value & bf_t::vmask) << bitpos);
}
// Load bitfield value
@@ -85,7 +90,7 @@ struct bf_t : bf_base<T, N>
// Load raw data with mask applied
constexpr T unshifted() const
{
return this->m_data & data_mask();
return static_cast<T>(this->m_data & data_mask());
}
// Optimized bool conversion (must be removed if inappropriate)
@@ -97,14 +102,14 @@ struct bf_t : bf_base<T, N>
// Store bitfield value
bf_t& operator =(vtype value)
{
this->m_data = (this->m_data & ~data_mask()) | insert(value);
this->m_data = static_cast<vtype>((this->m_data & ~data_mask()) | insert(value));
return *this;
}
vtype operator ++(int)
{
vtype result = *this;
*this = result + 1;
utype result = *this;
*this = static_cast<vtype>(result + 1);
return result;
}
@@ -115,8 +120,8 @@ struct bf_t : bf_base<T, N>
vtype operator --(int)
{
vtype result = *this;
*this = result - 1;
utype result = *this;
*this = static_cast<vtype>(result - 1);
return result;
}
@@ -142,19 +147,19 @@ struct bf_t : bf_base<T, N>
bf_t& operator &=(vtype right)
{
this->m_data &= (right & bf_t::vmask) << bitpos;
this->m_data &= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
return *this;
}
bf_t& operator |=(vtype right)
{
this->m_data |= (right & bf_t::vmask) << bitpos;
this->m_data |= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
return *this;
}
bf_t& operator ^=(vtype right)
{
this->m_data ^= (right & bf_t::vmask) << bitpos;
this->m_data ^= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
return *this;
}
};
@@ -165,23 +170,24 @@ struct cf_t : bf_base<typename F::type, F::bitsize + cf_t<Fields...>::bitsize>
{
using type = typename cf_t::type;
using vtype = typename cf_t::vtype;
using utype = typename cf_t::utype;
// Get disjunction of all "data" masks of concatenated values
static constexpr vtype data_mask()
{
return F::data_mask() | cf_t<Fields...>::data_mask();
return static_cast<vtype>(F::data_mask() | cf_t<Fields...>::data_mask());
}
// Extract all bitfields and concatenate
static constexpr vtype extract(const type& data)
{
return F::extract(data) << cf_t<Fields...>::bitsize | cf_t<Fields...>::extract(data);
return static_cast<vtype>(static_cast<utype>(F::extract(data)) << cf_t<Fields...>::bitsize | cf_t<Fields...>::extract(data));
}
// Split bitfields and insert them
static constexpr vtype insert(vtype value)
{
return F::insert(value >> cf_t<Fields...>::bitsize) | cf_t<Fields...>::insert(value);
return static_cast<vtype>(F::insert(value >> cf_t<Fields...>::bitsize) | cf_t<Fields...>::insert(value));
}
// Load value
@@ -242,3 +248,36 @@ struct ff_t : bf_base<T, N>
return V;
}
};
template<typename T, uint I, uint N>
struct fmt_unveil<bf_t<T, I, N>, void>
{
using type = typename fmt_unveil<simple_t<T>>::type;
static inline auto get(const bf_t<T, I, N>& bf)
{
return fmt_unveil<type>::get(bf);
}
};
template<typename F, typename... Fields>
struct fmt_unveil<cf_t<F, Fields...>, void>
{
using type = typename fmt_unveil<simple_t<typename F::type>>::type;
static inline auto get(const cf_t<F, Fields...>& cf)
{
return fmt_unveil<type>::get(cf);
}
};
template<typename T, T V, uint N>
struct fmt_unveil<ff_t<T, V, N>, void>
{
using type = typename fmt_unveil<simple_t<T>>::type;
static inline auto get(const ff_t<T, V, N>& ff)
{
return fmt_unveil<type>::get(ff);
}
};
-258
View File
@@ -1,258 +0,0 @@
#pragma once
#include "types.h"
// Small bitset for enum class types with available values [0, BitSize).
// T must be either enum type or convertible to (registered with via simple_t<T>).
// Internal representation is single value of type T.
template<typename T, std::size_t BitSize = sizeof(T) * CHAR_BIT>
struct bitset_t
{
using type = simple_t<T>;
using under = std::underlying_type_t<type>;
enum class raw_type : under {};
static constexpr auto bitsize = BitSize;
bitset_t() = default;
constexpr bitset_t(type _enum_const)
: m_value(static_cast<type>(shift(_enum_const)))
{
}
constexpr bitset_t(raw_type raw_value)
: m_value(static_cast<T>(static_cast<under>(raw_value)))
{
}
// Get underlying value
constexpr under _value() const
{
return static_cast<under>(m_value);
}
explicit constexpr operator bool() const
{
return _value() ? true : false;
}
bitset_t& operator +=(bitset_t rhs)
{
return *this = static_cast<raw_type>(_value() | rhs._value());
}
bitset_t& operator -=(bitset_t rhs)
{
return *this = static_cast<raw_type>(_value() & ~rhs._value());
}
bitset_t& operator &=(bitset_t rhs)
{
return *this = static_cast<raw_type>(_value() & rhs._value());
}
bitset_t& operator ^=(bitset_t rhs)
{
return *this = static_cast<raw_type>(_value() ^ rhs._value());
}
friend constexpr bitset_t operator +(bitset_t lhs, bitset_t rhs)
{
return static_cast<raw_type>(lhs._value() | rhs._value());
}
friend constexpr bitset_t operator -(bitset_t lhs, bitset_t rhs)
{
return static_cast<raw_type>(lhs._value() & ~rhs._value());
}
friend constexpr bitset_t operator &(bitset_t lhs, bitset_t rhs)
{
return static_cast<raw_type>(lhs._value() & rhs._value());
}
friend constexpr bitset_t operator ^(bitset_t lhs, bitset_t rhs)
{
return static_cast<raw_type>(lhs._value() ^ rhs._value());
}
bool test(bitset_t rhs) const
{
const under v = _value();
const under s = rhs._value();
return (v & s) != 0;
}
bool test_and_set(bitset_t rhs)
{
const under v = _value();
const under s = rhs._value();
*this = static_cast<raw_type>(v | s);
return (v & s) != 0;
}
bool test_and_reset(bitset_t rhs)
{
const under v = _value();
const under s = rhs._value();
*this = static_cast<raw_type>(v & ~s);
return (v & s) != 0;
}
bool test_and_complement(bitset_t rhs)
{
const under v = _value();
const under s = rhs._value();
*this = static_cast<raw_type>(v ^ s);
return (v & s) != 0;
}
private:
static constexpr under shift(const T& value)
{
return static_cast<under>(value) < BitSize ? static_cast<under>(1) << static_cast<under>(value) : throw value;
}
T m_value;
};
template<typename T, typename RT = T>
constexpr RT make_bitset()
{
return RT{};
}
// Fold enum constants into bitset_t<> (must be implemented with constexpr initializer_list constructor instead)
template<typename T = void, typename Arg, typename... Args, typename RT = std::conditional_t<std::is_void<T>::value, bitset_t<Arg>, T>>
constexpr RT make_bitset(Arg&& _enum_const, Args&&... args)
{
return RT{ std::forward<Arg>(_enum_const) } + make_bitset<RT>(std::forward<Args>(args)...);
}
template<typename T, typename CT>
struct atomic_add<bitset_t<T>, CT, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
using raw_type = typename bitset_t<T>::raw_type;
static inline bitset_t<T> op1(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::fetch_or(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto fetch_op = &op1;
static inline bitset_t<T> op2(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::or_fetch(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T, typename CT>
struct atomic_sub<bitset_t<T>, CT, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
using raw_type = typename bitset_t<T>::raw_type;
static inline bitset_t<T> op1(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), ~right._value()));
}
static constexpr auto fetch_op = &op1;
static inline bitset_t<T> op2(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), ~right._value()));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T, typename CT>
struct atomic_and<bitset_t<T>, CT, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
using raw_type = typename bitset_t<T>::raw_type;
static inline bitset_t<T> op1(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto fetch_op = &op1;
static inline bitset_t<T> op2(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T, typename CT>
struct atomic_xor<bitset_t<T>, CT, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
using raw_type = typename bitset_t<T>::raw_type;
static inline bitset_t<T> op1(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::fetch_xor(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto fetch_op = &op1;
static inline bitset_t<T> op2(bitset_t<T>& left, bitset_t<T> right)
{
return static_cast<raw_type>(atomic_storage<under>::xor_fetch(reinterpret_cast<under&>(left), right._value()));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_test_and_set<bitset_t<T>, T, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
static inline bool _op(bitset_t<T>& left, const T& value)
{
return atomic_storage<under>::bts(reinterpret_cast<under&>(left), static_cast<uint>(value));
}
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_reset<bitset_t<T>, T, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
static inline bool _op(bitset_t<T>& left, const T& value)
{
return atomic_storage<under>::btr(reinterpret_cast<under&>(left), static_cast<uint>(value));
}
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_complement<bitset_t<T>, T, std::enable_if_t<std::is_enum<T>::value>>
{
using under = typename bitset_t<T>::under;
static inline bool _op(bitset_t<T>& left, const T& value)
{
return atomic_storage<under>::btc(reinterpret_cast<under&>(left), static_cast<uint>(value));
}
static constexpr auto atomic_op = &_op;
};
+1702
View File
File diff suppressed because it is too large Load Diff
+177 -40
View File
@@ -3,54 +3,56 @@
#include "yaml-cpp/yaml.h"
#include <typeinfo>
namespace cfg
{
logs::channel cfg("CFG", logs::level::notice);
logs::channel cfg("CFG");
entry_base::entry_base(type _type)
_base::_base(type _type)
: m_type(_type)
{
if (_type != type::node)
{
throw std::logic_error("Invalid root node");
fmt::throw_exception<std::logic_error>("Invalid root node" HERE);
}
}
entry_base::entry_base(type _type, node& owner, const std::string& name)
_base::_base(type _type, node* owner, const std::string& name)
: m_type(_type)
{
if (!owner.m_nodes.emplace(name, this).second)
for (const auto& pair : owner->m_nodes)
{
throw std::logic_error("Node already exists");
if (pair.first == name)
{
fmt::throw_exception<std::logic_error>("Node already exists: %s" HERE, name);
}
}
owner->m_nodes.emplace_back(name, this);
}
entry_base& entry_base::operator[](const std::string& name) const
bool _base::from_string(const std::string&)
{
if (m_type == type::node)
{
return *static_cast<const node&>(*this).m_nodes.at(name);
}
throw std::logic_error("Invalid node type");
fmt::throw_exception<std::logic_error>("from_string() purecall" HERE);
}
entry_base& entry_base::operator[](const char* name) const
bool _base::from_list(std::vector<std::string>&&)
{
if (m_type == type::node)
{
return *static_cast<const node&>(*this).m_nodes.at(name);
}
throw std::logic_error("Invalid node type");
fmt::throw_exception<std::logic_error>("from_list() purecall" HERE);
}
// Emit YAML
static void encode(YAML::Emitter& out, const class entry_base& rhs);
static void encode(YAML::Emitter& out, const class _base& rhs);
// Incrementally load config entries from YAML::Node.
// The config value is preserved if the corresponding YAML node doesn't exist.
static void decode(const YAML::Node& data, class entry_base& rhs);
static void decode(const YAML::Node& data, class _base& rhs);
}
std::vector<std::string> cfg::make_int_range(s64 min, s64 max)
{
return {std::to_string(min), std::to_string(max)};
}
bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
@@ -85,7 +87,81 @@ bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
return true;
}
void cfg::encode(YAML::Emitter& out, const cfg::entry_base& rhs)
bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, const std::string& value)
{
u64 max = -1;
for (u64 i = 0;; i++)
{
std::string var;
func(var, i);
if (var == value)
{
if (out) *out = i;
return true;
}
std::string hex;
fmt_class_string<u64>::format(hex, i);
if (var == hex)
{
break;
}
max = i;
}
try
{
std::size_t pos;
const auto val = std::stoull(value, &pos, 0);
if (pos != value.size())
{
if (out) cfg.error("cfg::try_to_enum_value('%s'): unexpected characters (pos=%zu)", value, pos);
return false;
}
if (val > max)
{
if (out) cfg.error("cfg::try_to_enum_value('%s'): out of bounds(0..%u)", value, max);
return false;
}
if (out) *out = val;
return true;
}
catch (const std::exception& e)
{
if (out) cfg.error("cfg::try_to_enum_value('%s'): invalid enum value: %s", value, e.what());
return false;
}
}
std::vector<std::string> cfg::try_to_enum_list(decltype(&fmt_class_string<int>::format) func)
{
std::vector<std::string> result;
for (u64 i = 0;; i++)
{
std::string var;
func(var, i);
std::string hex;
fmt_class_string<u64>::format(hex, i);
if (var == hex)
{
break;
}
result.emplace_back(std::move(var));
}
return result;
}
void cfg::encode(YAML::Emitter& out, const cfg::_base& rhs)
{
switch (rhs.get_type())
{
@@ -95,7 +171,8 @@ void cfg::encode(YAML::Emitter& out, const cfg::entry_base& rhs)
for (const auto& np : static_cast<const node&>(rhs).get_nodes())
{
out << YAML::Key << np.first;
out << YAML::Value; encode(out, *np.second);
out << YAML::Value;
encode(out, *np.second);
}
out << YAML::EndMap;
@@ -112,12 +189,25 @@ void cfg::encode(YAML::Emitter& out, const cfg::entry_base& rhs)
out << YAML::EndSeq;
return;
}
case type::log:
{
out << YAML::BeginMap;
for (const auto& np : static_cast<const log_entry&>(rhs).get_map())
{
if (np.second == logs::level::notice) continue;
out << YAML::Key << np.first;
out << YAML::Value << fmt::format("%s", np.second);
}
out << YAML::EndMap;
return;
}
}
out << rhs.to_string();
}
void cfg::decode(const YAML::Node& data, cfg::entry_base& rhs)
void cfg::decode(const YAML::Node& data, cfg::_base& rhs)
{
switch (rhs.get_type())
{
@@ -133,16 +223,12 @@ void cfg::decode(const YAML::Node& data, cfg::entry_base& rhs)
if (!pair.first.IsScalar()) continue;
// Find the key among existing nodes
const auto name = pair.first.Scalar();
const auto found = static_cast<node&>(rhs).get_nodes().find(name);
if (found != static_cast<node&>(rhs).get_nodes().cend())
for (const auto& _pair : static_cast<node&>(rhs).get_nodes())
{
decode(pair.second, *found->second);
}
else
{
// ???
if (_pair.first == pair.first.Scalar())
{
decode(pair.second, *_pair.second);
}
}
}
@@ -159,6 +245,29 @@ void cfg::decode(const YAML::Node& data, cfg::entry_base& rhs)
break;
}
case type::log:
{
if (data.IsScalar() || data.IsSequence())
{
return; // ???
}
std::map<std::string, logs::level> values;
for (const auto& pair : data)
{
if (!pair.first.IsScalar() || !pair.second.IsScalar()) continue;
u64 value;
if (cfg::try_to_enum_value(&value, &fmt_class_string<logs::level>::format, pair.second.Scalar()))
{
values.emplace(pair.first.Scalar(), static_cast<logs::level>(static_cast<int>(value)));
}
}
static_cast<log_entry&>(rhs).set_map(std::move(values));
break;
}
default:
{
std::string value;
@@ -178,14 +287,19 @@ std::string cfg::node::to_string() const
YAML::Emitter out;
cfg::encode(out, *this);
return{ out.c_str(), out.size() };
return {out.c_str(), out.size()};
}
bool cfg::node::from_string(const std::string& value)
bool cfg::node::from_string(const std::string& value) try
{
cfg::decode(YAML::Load(value), *this);
return true;
}
catch (const std::exception& e)
{
cfg.fatal("%s thrown: %s", typeid(e).name(), e.what());
return false;
}
void cfg::node::from_default()
{
@@ -195,9 +309,32 @@ void cfg::node::from_default()
}
}
cfg::root_node& cfg::get_root()
void cfg::_bool::from_default()
{
// Magic static
static root_node root;
return root;
m_value = def;
}
void cfg::string::from_default()
{
m_value = def;
}
void cfg::set_entry::from_default()
{
m_set = {};
}
void cfg::log_entry::set_map(std::map<std::string, logs::level>&& map)
{
logs::reset();
for (auto&& pair : (m_map = std::move(map)))
{
logs::set_level(pair.first, pair.second);
}
}
void cfg::log_entry::from_default()
{
set_map({});
}
+99 -263
View File
@@ -1,57 +1,60 @@
#pragma once
#include "Utilities/types.h"
#include "Utilities/Atomic.h"
#include "Utilities/StrFmt.h"
#include "Utilities/Log.h"
#include <initializer_list>
#include <exception>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <unordered_map>
#include <map>
#include <mutex>
namespace cfg
{
// Format min and max values
std::vector<std::string> make_int_range(s64 min, s64 max);
// Convert string to signed integer
bool try_to_int64(s64* out, const std::string& value, s64 min, s64 max);
// Internal hack
bool try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, const std::string&);
// Internal hack
std::vector<std::string> try_to_enum_list(decltype(&fmt_class_string<int>::format) func);
// Config tree entry type.
enum class type : uint
{
node = 0, // cfg::node type
boolean, // cfg::bool_entry type
fixed_map, // cfg::map_entry type
enumeration, // cfg::enum_entry type
integer, // cfg::int_entry type
string, // cfg::string_entry type
_bool, // cfg::_bool type
_enum, // cfg::_enum type
_int, // cfg::_int type
string, // cfg::string type
set, // cfg::set_entry type
log,
};
// Config tree entry abstract base class
class entry_base
class _base
{
const type m_type;
protected:
// Ownerless entry constructor
entry_base(type _type);
_base(type _type);
// Owned entry constructor
entry_base(type _type, class node& owner, const std::string& name);
_base(type _type, class node* owner, const std::string& name);
public:
// Disallow copy/move constructors and assignments
entry_base(const entry_base&) = delete;
_base(const _base&) = delete;
// Get type
type get_type() const { return m_type; }
// Access child node (must exist)
entry_base& operator [](const std::string& name) const; entry_base& operator [](const char* name) const;
// Reset defaults
virtual void from_default() = 0;
@@ -62,10 +65,7 @@ namespace cfg
}
// Try to convert from string (optional)
virtual bool from_string(const std::string&)
{
throw std::logic_error("from_string() not specified");
}
virtual bool from_string(const std::string&);
// Get string list (optional)
virtual std::vector<std::string> to_list() const
@@ -74,34 +74,31 @@ namespace cfg
}
// Set multiple values. Implementation-specific, optional.
virtual bool from_list(std::vector<std::string>&&)
{
throw std::logic_error("from_list() not specified");
}
virtual bool from_list(std::vector<std::string>&&);
};
// Config tree node which contains another nodes
class node : public entry_base
class node : public _base
{
std::map<std::string, entry_base*> m_nodes;
std::vector<std::pair<std::string, _base*>> m_nodes;
friend class entry_base;
friend class _base;
public:
// Root node constructor
node()
: entry_base(type::node)
: _base(type::node)
{
}
// Registered node constructor
node(node& owner, const std::string& name)
: entry_base(type::node, owner, name)
node(node* owner, const std::string& name)
: _base(type::node, owner, name)
{
}
// Get child nodes
const std::map<std::string, entry_base*>& get_nodes() const
const auto& get_nodes() const
{
return m_nodes;
}
@@ -116,46 +113,38 @@ namespace cfg
void from_default() override;
};
struct bool_entry final : public entry_base
class _bool final : public _base
{
atomic_t<bool> value;
bool m_value;
public:
const bool def;
bool_entry(node& owner, const std::string& name, bool def = false)
: entry_base(type::boolean, owner, name)
, value(def)
_bool(node* owner, const std::string& name, bool def = false)
: _base(type::_bool, owner, name)
, m_value(def)
, def(def)
{
}
explicit operator bool() const
{
return value.load();
return m_value;
}
bool_entry& operator =(bool value)
{
value = value;
return *this;
}
void from_default() override
{
value = def;
}
void from_default() override;
std::string to_string() const override
{
return value.load() ? "true" : "false";
return m_value ? "true" : "false";
}
bool from_string(const std::string& value) override
{
if (value == "false")
this->value = false;
m_value = false;
else if (value == "true")
this->value = true;
m_value = true;
else
return false;
@@ -163,116 +152,17 @@ namespace cfg
}
};
// Value node with fixed set of possible values, each maps to a value of type T.
template<typename T>
struct map_entry final : public entry_base
{
using init_type = std::initializer_list<std::pair<std::string, T>>;
using map_type = std::unordered_map<std::string, T>;
using list_type = std::vector<std::string>;
using value_type = typename map_type::value_type;
static map_type make_map(init_type init)
{
map_type map(init.size());
for (const auto& v : init)
{
// Ensure elements are unique
VERIFY(map.emplace(v.first, v.second).second);
}
return map;
}
static list_type make_list(init_type init)
{
list_type list; list.reserve(init.size());
for (const auto& v : init)
{
list.emplace_back(v.first);
}
return list;
}
public:
const map_type map;
const list_type list; // Element list sorted in original order
const value_type& def; // Pointer to the default value
private:
atomic_t<const value_type*> m_value;
public:
map_entry(node& owner, const std::string& name, const std::string& def, init_type init)
: entry_base(type::fixed_map, owner, name)
, map(make_map(init))
, list(make_list(init))
, def(*map.find(def))
, m_value(&this->def)
{
}
map_entry(node& owner, const std::string& name, std::size_t def_index, init_type init)
: map_entry(owner, name, def_index < init.size() ? (init.begin() + def_index)->first : throw std::logic_error("Invalid default value index"), init)
{
}
map_entry(node& owner, const std::string& name, init_type init)
: map_entry(owner, name, 0, init)
{
}
const T& get() const
{
return m_value.load()->second;
}
void from_default() override
{
m_value = &def;
}
std::string to_string() const override
{
return m_value.load()->first;
}
bool from_string(const std::string& value) override
{
const auto found = map.find(value);
if (found == map.end())
{
return false;
}
else
{
m_value = &*found;
return true;
}
}
std::vector<std::string> to_list() const override
{
return list;
}
};
// Value node with fixed set of possible values, each maps to an enum value of type T.
template<typename T, bool External = false>
class enum_entry final : public entry_base
template <typename T>
class _enum final : public _base
{
// Value or reference
std::conditional_t<External, atomic_t<T>&, atomic_t<T>> m_value;
T m_value;
public:
const T def;
enum_entry(node& owner, const std::string& name, std::conditional_t<External, atomic_t<T>&, T> value)
: entry_base(type::enumeration, owner, name)
_enum(node* owner, const std::string& name, T value = {})
: _base(type::_enum, owner, name)
, m_value(value)
, def(value)
{
@@ -280,13 +170,7 @@ namespace cfg
operator T() const
{
return m_value.load();
}
enum_entry& operator =(T value)
{
m_value = value;
return *this;
return m_value;
}
void from_default() override
@@ -296,26 +180,20 @@ namespace cfg
std::string to_string() const override
{
for (std::size_t i = 0; i < sizeof(bijective<T, const char*>::map) / sizeof(bijective_pair<T, const char*>); i++)
{
if (bijective<T, const char*>::map[i].v1 == m_value)
{
return bijective<T, const char*>::map[i].v2;
}
}
return{}; // TODO: ???
std::string result;
fmt_class_string<T>::format(result, fmt_unveil<T>::get(m_value));
return result; // TODO: ???
}
bool from_string(const std::string& value) override
{
for (std::size_t i = 0; i < sizeof(bijective<T, const char*>::map) / sizeof(bijective_pair<T, const char*>); i++)
u64 result;
if (try_to_enum_value(&result, &fmt_class_string<T>::format, value))
{
if (bijective<T, const char*>::map[i].v2 == value)
{
m_value = bijective<T, const char*>::map[i].v1;
return true;
}
// No narrowing check, it's hard to do right there
m_value = static_cast<T>(static_cast<std::underlying_type_t<T>>(result));
return true;
}
return false;
@@ -323,33 +201,26 @@ namespace cfg
std::vector<std::string> to_list() const override
{
std::vector<std::string> result;
for (std::size_t i = 0; i < sizeof(bijective<T, const char*>::map) / sizeof(bijective_pair<T, const char*>); i++)
{
result.emplace_back(bijective<T, const char*>::map[i].v2);
}
return result;
return try_to_enum_list(&fmt_class_string<T>::format);
}
};
// Signed 32/64-bit integer entry with custom Min/Max range.
template<s64 Min, s64 Max>
class int_entry final : public entry_base
template <s64 Min, s64 Max>
class _int final : public _base
{
static_assert(Min < Max, "Invalid cfg::int_entry range");
static_assert(Min < Max, "Invalid cfg::_int range");
// Prefer 32 bit type if possible
using int_type = std::conditional_t<Min >= INT32_MIN && Max <= INT32_MAX, s32, s64>;
atomic_t<int_type> m_value;
int_type m_value;
public:
const int_type def;
int_entry(node& owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)))
: entry_base(type::integer, owner, name)
_int(node* owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)))
: _base(type::_int, owner, name)
, m_value(def)
, def(def)
{
@@ -357,18 +228,7 @@ namespace cfg
operator int_type() const
{
return m_value.load();
}
int_entry& operator =(int_type value)
{
if (value < Min || value > Max)
{
throw fmt::exception("Value out of the valid range: %lld" HERE, s64{ value });
}
m_value = value;
return *this;
return m_value;
}
void from_default() override
@@ -378,7 +238,7 @@ namespace cfg
std::string to_string() const override
{
return std::to_string(m_value.load());
return std::to_string(m_value);
}
bool from_string(const std::string& value) override
@@ -392,25 +252,29 @@ namespace cfg
return false;
}
std::vector<std::string> to_list() const override
{
return make_int_range(Min, Max);
}
};
// Alias for 32 bit int
using int32_entry = int_entry<INT32_MIN, INT32_MAX>;
using int32 = _int<INT32_MIN, INT32_MAX>;
// Alias for 64 bit int
using int64_entry = int_entry<INT64_MIN, INT64_MAX>;
using int64 = _int<INT64_MIN, INT64_MAX>;
// Simple string entry with mutex
class string_entry final : public entry_base
class string final : public _base
{
mutable std::mutex m_mutex;
std::string m_value;
public:
const std::string def;
string_entry(node& owner, const std::string& name, const std::string& def = {})
: entry_base(type::string, owner, name)
string(node* owner, const std::string& name, const std::string& def = {})
: _base(type::string, owner, name)
, m_value(def)
, def(def)
{
@@ -418,115 +282,87 @@ namespace cfg
operator std::string() const
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_value;
}
std::string get() const
const std::string& get() const
{
return *this;
}
string_entry& operator =(const std::string& value)
{
std::lock_guard<std::mutex> lock(m_mutex);
m_value = value;
return *this;
return m_value;
}
std::size_t size() const
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_value.size();
}
void from_default() override
{
*this = def;
}
void from_default() override;
std::string to_string() const override
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_value;
}
bool from_string(const std::string& value) override
{
*this = value;
m_value = value;
return true;
}
};
// Simple set entry with mutex (TODO: template for various types)
class set_entry final : public entry_base
class set_entry final : public _base
{
mutable std::mutex m_mutex;
std::set<std::string> m_set;
public:
// Default value is empty list in current implementation
set_entry(node& owner, const std::string& name)
: entry_base(type::set, owner, name)
set_entry(node* owner, const std::string& name)
: _base(type::set, owner, name)
{
}
std::set<std::string> get_set() const
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_set;
}
void set_set(std::set<std::string>&& set)
{
std::lock_guard<std::mutex> lock(m_mutex);
m_set = std::move(set);
}
void from_default() override
{
std::lock_guard<std::mutex> lock(m_mutex);
m_set = {};
}
void from_default() override;
std::vector<std::string> to_list() const override
{
std::lock_guard<std::mutex> lock(m_mutex);
return{ m_set.begin(), m_set.end() };
}
bool from_list(std::vector<std::string>&& list) override
{
std::lock_guard<std::mutex> lock(m_mutex);
m_set = { std::make_move_iterator(list.begin()), std::make_move_iterator(list.end()) };
return true;
}
};
// Root type with some predefined nodes. Don't change it, this is not mandatory for adding nodes.
struct root_node : node
class log_entry final : public _base
{
node core { *this, "Core" };
node vfs { *this, "VFS" };
node log { *this, "Log" };
node video { *this, "Video" };
node audio { *this, "Audio" };
node io { *this, "Input/Output" };
node sys { *this, "System" };
node net { *this, "Net" };
node misc { *this, "Miscellaneous" };
std::map<std::string, logs::level> m_map;
public:
log_entry(node* owner, const std::string& name)
: _base(type::log, owner, name)
{
}
std::map<std::string, logs::level> get_map() const
{
return m_map;
}
void set_map(std::map<std::string, logs::level>&& map);
void from_default() override;
};
// Get global configuration root instance
extern root_node& get_root();
// Global configuration root instance (cached reference)
static root_node& root = get_root();
}
// Registered log channel
#define LOG_CHANNEL(name) extern logs::channel name; namespace logs { static cfg::enum_entry<logs::level, true> name(cfg::root.log, #name, ::name.enabled); }
+465 -264
View File
File diff suppressed because it is too large Load Diff
+194 -27
View File
@@ -1,17 +1,23 @@
#pragma once
#include "types.h"
#include "bit_set.h"
#include <memory>
#include <string>
#include <vector>
#include <type_traits>
#include "types.h"
#include "BitSet.h"
#include <algorithm>
namespace fs
{
#ifdef _WIN32
using native_handle = void*;
#else
using native_handle = int;
#endif
// File open mode flags
enum struct open_mode : u32
enum class open_mode : u32
{
read,
write,
@@ -19,16 +25,20 @@ namespace fs
create,
trunc,
excl,
unshare,
__bitset_enum_max
};
constexpr bitset_t<open_mode> read = open_mode::read; // Enable reading
constexpr bitset_t<open_mode> write = open_mode::write; // Enable writing
constexpr bitset_t<open_mode> append = open_mode::append; // Always append to the end of the file
constexpr bitset_t<open_mode> create = open_mode::create; // Create file if it doesn't exist
constexpr bitset_t<open_mode> trunc = open_mode::trunc; // Clear opened file if it's not empty
constexpr bitset_t<open_mode> excl = open_mode::excl; // Failure if the file already exists (used with `create`)
constexpr auto read = +open_mode::read; // Enable reading
constexpr auto write = +open_mode::write; // Enable writing
constexpr auto append = +open_mode::append; // Always append to the end of the file
constexpr auto create = +open_mode::create; // Create file if it doesn't exist
constexpr auto trunc = +open_mode::trunc; // Clear opened file if it's not empty
constexpr auto excl = +open_mode::excl; // Failure if the file already exists (used with `create`)
constexpr auto unshare = +open_mode::unshare; // Prevent opening the file twice
constexpr bitset_t<open_mode> rewrite = write + create + trunc;
constexpr auto rewrite = open_mode::write + open_mode::create + open_mode::trunc;
// File seek mode
enum class seek_mode : u32
@@ -53,12 +63,19 @@ namespace fs
s64 ctime;
};
// Native handle getter
struct get_native_handle
{
virtual native_handle get() = 0;
};
// File handle base
struct file_base
{
virtual ~file_base() = default;
virtual ~file_base();
virtual stat_t stat() = 0;
virtual stat_t stat();
virtual void sync();
virtual bool trunc(u64 length) = 0;
virtual u64 read(void* buffer, u64 size) = 0;
virtual u64 write(const void* buffer, u64 size) = 0;
@@ -75,25 +92,36 @@ namespace fs
// Directory handle base
struct dir_base
{
virtual ~dir_base() = default;
virtual ~dir_base();
virtual bool read(dir_entry&) = 0;
virtual void rewind() = 0;
};
// Device information
struct device_stat
{
u64 block_size;
u64 total_size;
u64 total_free; // Total size of free space
u64 avail_free; // Free space available to unprivileged user
};
// Virtual device
struct device_base
{
virtual ~device_base() = default;
virtual ~device_base();
virtual bool stat(const std::string& path, stat_t& info) = 0;
virtual bool statfs(const std::string& path, device_stat& info) = 0;
virtual bool remove_dir(const std::string& path) = 0;
virtual bool create_dir(const std::string& path) = 0;
virtual bool rename(const std::string& from, const std::string& to) = 0;
virtual bool remove(const std::string& path) = 0;
virtual bool trunc(const std::string& path, u64 length) = 0;
virtual bool utime(const std::string& path, s64 atime, s64 mtime) = 0;
virtual std::unique_ptr<file_base> open(const std::string& path, bitset_t<open_mode> mode) = 0;
virtual std::unique_ptr<file_base> open(const std::string& path, bs_t<open_mode> mode) = 0;
virtual std::unique_ptr<dir_base> open_dir(const std::string& path) = 0;
};
@@ -118,6 +146,9 @@ namespace fs
// Check whether the directory exists and is NOT a file
bool is_dir(const std::string& path);
// Get filesystem information
bool statfs(const std::string& path, device_stat& info);
// Delete empty directory
bool remove_dir(const std::string& path);
@@ -128,7 +159,7 @@ namespace fs
bool create_path(const std::string& path);
// Rename (move) file or directory
bool rename(const std::string& from, const std::string& to);
bool rename(const std::string& from, const std::string& to, bool overwrite);
// Copy file contents
bool copy_file(const std::string& from, const std::string& to, bool overwrite);
@@ -139,6 +170,9 @@ namespace fs
// Change file size (possibly appending zeros)
bool truncate_file(const std::string& path, u64 length);
// Set file access/modification time
bool utime(const std::string& path, s64 atime, s64 mtime);
class file final
{
std::unique_ptr<file_base> m_file;
@@ -151,17 +185,19 @@ namespace fs
file() = default;
// Open file with specified mode
explicit file(const std::string& path, bitset_t<open_mode> mode = ::fs::read)
{
open(path, mode);
}
// Open file with specified mode
bool open(const std::string& path, bitset_t<open_mode> mode = ::fs::read);
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
// Open memory for read
explicit file(const void* ptr, std::size_t size);
// Open file with specified args (forward to constructor)
template <typename... Args>
bool open(Args&&... args)
{
*this = fs::file(std::forward<Args>(args)...);
return m_file.operator bool();
}
// Check whether the handle is valid (opened file)
explicit operator bool() const
{
@@ -198,6 +234,13 @@ namespace fs
return m_file->stat();
}
// Sync file buffers
void sync() const
{
if (!m_file) xnull();
return m_file->sync();
}
// Read the data from the file and return the amount of data written in buffer
u64 read(void* buffer, u64 count) const
{
@@ -318,6 +361,9 @@ namespace fs
if (seek(0), !read(result)) xfail();
return result;
}
// Get native handle if available
native_handle get_handle() const;
};
class dir final
@@ -436,8 +482,11 @@ namespace fs
// Get configuration directory
const std::string& get_config_dir();
// Get executable directory
const std::string& get_executable_dir();
// Get data/cache directory for specified prefix and suffix
std::string get_data_dir(const std::string& prefix, const std::string& location, const std::string& suffix);
// Get data/cache directory for specified prefix and path (suffix will be filename)
std::string get_data_dir(const std::string& prefix, const std::string& path);
// Delete directory and all its contents recursively
void remove_all(const std::string& path, bool remove_root = true);
@@ -452,8 +501,126 @@ namespace fs
inval,
noent,
exist,
acces,
notempty,
};
// Error code returned
extern thread_local error g_tls_error;
template <typename T>
struct container_stream final : file_base
{
// T can be a reference, but this is not recommended
using value_type = typename std::remove_reference_t<T>::value_type;
T obj;
u64 pos;
container_stream(T&& obj)
: obj(std::forward<T>(obj))
, pos(0)
{
}
~container_stream() override
{
}
bool trunc(u64 length) override
{
obj.resize(length);
return true;
}
u64 read(void* buffer, u64 size) override
{
const u64 end = obj.size();
if (pos < end)
{
// Get readable size
if (const u64 max = std::min<u64>(size, end - pos))
{
std::copy(obj.cbegin() + pos, obj.cbegin() + pos + max, static_cast<value_type*>(buffer));
pos = pos + max;
return max;
}
}
return 0;
}
u64 write(const void* buffer, u64 size) override
{
const u64 old_size = obj.size();
if (old_size + size < old_size)
{
fmt::raw_error("fs::container_stream<>::write(): overflow");
}
if (pos > old_size)
{
// Fill gap if necessary (default-initialized)
obj.resize(pos);
}
const auto src = static_cast<const value_type*>(buffer);
// Overwrite existing part
const u64 overlap = std::min<u64>(obj.size() - pos, size);
std::copy(src, src + overlap, obj.begin() + pos);
// Append new data
obj.insert(obj.end(), src + overlap, src + size);
pos += size;
return size;
}
u64 seek(s64 offset, seek_mode whence) override
{
const s64 new_pos =
whence == fs::seek_set ? offset :
whence == fs::seek_cur ? offset + pos :
whence == fs::seek_end ? offset + size() :
(fmt::raw_error("fs::container_stream<>::seek(): invalid whence"), 0);
if (new_pos < 0)
{
fs::g_tls_error = fs::error::inval;
return -1;
}
pos = new_pos;
return pos;
}
u64 size() override
{
return obj.size();
}
};
template <typename T>
file make_stream(T&& container = T{})
{
file result;
result.reset(std::make_unique<container_stream<T>>(std::forward<T>(container)));
return result;
}
template <typename... Args>
bool write_file(const std::string& path, bs_t<fs::open_mode> mode, const Args&... args)
{
if (fs::file f{path, mode})
{
// Write args sequentially
int seq[]{ (f.write(args), 0)... };
return true;
}
return false;
}
}
+817
View File
@@ -0,0 +1,817 @@
#include "stdafx.h"
#ifdef WITH_GDB_DEBUGGER
#include "GDBDebugServer.h"
#include "Log.h"
#include <algorithm>
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"
#include "Emu/CPU/CPUThread.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/RawSPUThread.h"
#include "Emu/Cell/SPUThread.h"
#ifndef _WIN32
#include"fcntl.h"
#endif
extern void ppu_set_breakpoint(u32 addr);
extern void ppu_remove_breakpoint(u32 addr);
logs::channel gdbDebugServer("gdbDebugServer");
int sock_init(void)
{
#ifdef _WIN32
WSADATA wsa_data;
return WSAStartup(MAKEWORD(1, 1), &wsa_data);
#else
return 0;
#endif
}
int sock_quit(void)
{
#ifdef _WIN32
return WSACleanup();
#else
return 0;
#endif
}
#ifndef _WIN32
int closesocket(socket_t s) {
return close(s);
}
const int SOCKET_ERROR = -1;
const socket_t INVALID_SOCKET = -1;
#define sscanf_s sscanf
#define HEX_U32 "x"
#define HEX_U64 "lx"
#else
#define HEX_U32 "lx"
#define HEX_U64 "llx"
#endif
bool check_errno_again() {
#ifdef _WIN32
int err = GetLastError();
return (err == WSAEWOULDBLOCK);
#else
int err = errno;
return (err == EAGAIN) || (err == EWOULDBLOCK);
#endif
}
std::string u32_to_hex(u32 i) {
return fmt::format("%" HEX_U32, i);
}
std::string u64_to_padded_hex(u64 value) {
return fmt::format("%.16" HEX_U64, value);
}
std::string u32_to_padded_hex(u32 value) {
return fmt::format("%.8" HEX_U32, value);
}
u8 hex_to_u8(std::string val) {
u8 result;
sscanf_s(val.c_str(), "%02hhX", &result);
return result;
}
u32 hex_to_u32(std::string val) {
u32 result;
sscanf_s(val.c_str(), "%" HEX_U32, &result);
return result;
}
u64 hex_to_u64(std::string val) {
u64 result;
sscanf_s(val.c_str(), "%" HEX_U64, &result);
return result;
}
void GDBDebugServer::start_server()
{
server_socket = socket(AF_INET, SOCK_STREAM, 0);
if (server_socket == INVALID_SOCKET) {
gdbDebugServer.error("Error creating server socket");
return;
}
#ifdef WIN32
{
int mode = 1;
ioctlsocket(server_socket, FIONBIO, (u_long FAR *)&mode);
}
#else
fcntl(server_socket, F_SETFL, fcntl(server_socket, F_GETFL) | O_NONBLOCK);
#endif
int err;
sockaddr_in server_saddr;
server_saddr.sin_family = AF_INET;
int port = g_cfg.misc.gdb_server_port;
server_saddr.sin_port = htons(port);
server_saddr.sin_addr.s_addr = htonl(INADDR_ANY);
err = bind(server_socket, (struct sockaddr *) &server_saddr, sizeof(server_saddr));
if (err == SOCKET_ERROR) {
gdbDebugServer.error("Error binding to port %d", port);
return;
}
err = listen(server_socket, 1);
if (err == SOCKET_ERROR) {
gdbDebugServer.error("Error listening on port %d", port);
return;
}
gdbDebugServer.success("GDB Debug Server listening on port %d", port);
}
int GDBDebugServer::read(void * buf, int cnt)
{
while (!stop) {
int result = recv(client_socket, reinterpret_cast<char*>(buf), cnt, 0);
if (result == SOCKET_ERROR) {
if (check_errno_again()) {
thread_ctrl::wait_for(50);
continue;
}
gdbDebugServer.error("Error during socket read");
fmt::throw_exception("Error during socket read" HERE);
}
return result;
}
return 0;
}
char GDBDebugServer::read_char()
{
char result;
int cnt = read(&result, 1);
if (!cnt) {
fmt::throw_exception("Tried to read char, but no data was available" HERE);
}
return result;
}
u8 GDBDebugServer::read_hexbyte()
{
char buf[2];
read(buf, 2);
return static_cast<u8>(strtol(buf, nullptr, 16));
}
void GDBDebugServer::try_read_cmd(gdb_cmd & out_cmd)
{
char c = read_char();
//interrupt
if (UNLIKELY(c == 0x03)) {
out_cmd.cmd = "\0x03";
out_cmd.data = "";
out_cmd.checksum = 0;
return;
}
if (UNLIKELY(c != '$')) {
//gdb starts conversation with + for some reason
if (c == '+') {
c = read_char();
}
if (c != '$') {
fmt::throw_exception("Expected start of packet character '$', got '%c' instead" HERE, c);
}
}
//clear packet data
out_cmd.cmd = "";
out_cmd.data = "";
out_cmd.checksum = 0;
bool cmd_part = true;
u8 checksum = 0;
while(true) {
c = read_char();
if (c == '#') {
break;
}
checksum = (checksum + reinterpret_cast<u8&>(c)) % 256;
//escaped char
if (c == '}') {
c = read_char() ^ 0x20;
checksum = (checksum + reinterpret_cast<u8&>(c)) % 256;
}
//cmd-data splitters
if (cmd_part && ((c == ':') || (c == '.') || (c == ';'))) {
cmd_part = false;
}
if (cmd_part) {
out_cmd.cmd += c;
//only q and v commands can have multi-char command
if ((out_cmd.cmd.length() == 1) && (c != 'q') && (c != 'v')) {
cmd_part = false;
}
} else {
out_cmd.data += c;
}
}
out_cmd.checksum = read_hexbyte();
if (out_cmd.checksum != checksum) {
throw new wrong_checksum_exception("Wrong checksum for packet" HERE);
}
}
bool GDBDebugServer::read_cmd(gdb_cmd & out_cmd)
{
while (true) {
try {
try_read_cmd(out_cmd);
ack(true);
return true;
}
catch (wrong_checksum_exception) {
ack(false);
}
catch (std::runtime_error e) {
gdbDebugServer.error(e.what());
return false;
}
}
}
void GDBDebugServer::send(const char * buf, int cnt)
{
gdbDebugServer.trace("Sending %s (%d bytes)", buf, cnt);
while (!stop) {
int res = ::send(client_socket, buf, cnt, 0);
if (res == SOCKET_ERROR) {
if (check_errno_again()) {
thread_ctrl::wait_for(50);
continue;
}
gdbDebugServer.error("Failed sending %d bytes", cnt);
return;
}
return;
}
}
void GDBDebugServer::send_char(char c)
{
send(&c, 1);
}
void GDBDebugServer::ack(bool accepted)
{
send_char(accepted ? '+' : '-');
}
void GDBDebugServer::send_cmd(const std::string & cmd)
{
u8 checksum = 0;
std::string buf;
buf.reserve(cmd.length() + 4);
buf += "$";
for (int i = 0; i < cmd.length(); ++i) {
checksum = (checksum + append_encoded_char(cmd[i], buf)) % 256;
}
buf += "#";
buf += to_hexbyte(checksum);
send(buf.c_str(), static_cast<int>(buf.length()));
}
bool GDBDebugServer::send_cmd_ack(const std::string & cmd)
{
while (true) {
send_cmd(cmd);
char c = read_char();
if (LIKELY(c == '+')) {
return true;
}
if (UNLIKELY(c != '-')) {
gdbDebugServer.error("Wrong acknowledge character received %c", c);
return false;
}
gdbDebugServer.warning("Client rejected our cmd");
}
}
u8 GDBDebugServer::append_encoded_char(char c, std::string & str)
{
u8 checksum = 0;
if (UNLIKELY((c == '#') || (c == '$') || (c == '}'))) {
str += '}';
c ^= 0x20;
checksum = '}';
}
checksum = (checksum + reinterpret_cast<u8&>(c)) % 256;
str += c;
return checksum;
}
std::string GDBDebugServer::to_hexbyte(u8 i)
{
std::string result = "00";
u8 i1 = i & 0xF;
u8 i2 = i >> 4;
result[0] = i2 > 9 ? 'a' + i2 - 10 : '0' + i2;
result[1] = i1 > 9 ? 'a' + i1 - 10 : '0' + i1;
return result;
}
bool GDBDebugServer::select_thread(u64 id)
{
//in case we have none at all
selected_thread.reset();
const auto on_select = [&](u32, cpu_thread& cpu)
{
return (id == ALL_THREADS) || (id == ANY_THREAD) || (cpu.id == id);
};
if (auto ppu = idm::select<ppu_thread>(on_select)) {
selected_thread = ppu.ptr;
return true;
}
return false;
}
std::string GDBDebugServer::get_reg(std::shared_ptr<ppu_thread> thread, u32 rid)
{
std::string result;
//ids from gdb/features/rs6000/powerpc-64.c
//pc
switch (rid) {
case 64:
return u64_to_padded_hex(thread->cia);
//msr?
case 65:
return std::string(16, 'x');
case 66:
return u32_to_padded_hex(thread->cr_pack());
case 67:
return u64_to_padded_hex(thread->lr);
case 68:
return u64_to_padded_hex(thread->ctr);
//xer
case 69:
return std::string(8, 'x');
//fpscr
case 70:
return std::string(8, 'x');
default:
if (rid > 70) return "";
return (rid > 31)
? u64_to_padded_hex(reinterpret_cast<u64&>(thread->fpr[rid - 32])) //fpr
: u64_to_padded_hex(thread->gpr[rid]); //gpr
}
}
bool GDBDebugServer::set_reg(std::shared_ptr<ppu_thread> thread, u32 rid, std::string value)
{
switch (rid) {
case 64:
thread->cia = static_cast<u32>(hex_to_u64(value));
return true;
//msr?
case 65:
return true;
case 66:
thread->cr_unpack(hex_to_u32(value));
return true;
case 67:
thread->lr = hex_to_u64(value);
return true;
case 68:
thread->ctr = hex_to_u64(value);
return true;
//xer
case 69:
return true;
//fpscr
case 70:
return true;
default:
if (rid > 70) return false;
if (rid > 31) {
u64 val = hex_to_u64(value);
thread->fpr[rid - 32] = reinterpret_cast<f64&>(val);
} else {
thread->gpr[rid] = hex_to_u64(value);
}
return true;
}
}
u32 GDBDebugServer::get_reg_size(std::shared_ptr<ppu_thread> thread, u32 rid)
{
switch (rid) {
case 66:
case 69:
case 70:
return 4;
default:
if (rid > 70) {
return 0;
}
return 8;
}
}
bool GDBDebugServer::send_reason()
{
return send_cmd_ack("S05");
}
bool GDBDebugServer::cmd_extended_mode(gdb_cmd & cmd)
{
return send_cmd_ack("OK");
}
bool GDBDebugServer::cmd_reason(gdb_cmd & cmd)
{
return send_reason();
}
bool GDBDebugServer::cmd_supported(gdb_cmd & cmd)
{
return send_cmd_ack("PacketSize=1200");
}
bool GDBDebugServer::cmd_thread_info(gdb_cmd & cmd)
{
std::string result = "";
const auto on_select = [&](u32, cpu_thread& cpu)
{
if (result.length()) {
result += ",";
}
result += u64_to_padded_hex(static_cast<u64>(cpu.id));
};
idm::select<ppu_thread>(on_select);
idm::select<ARMv7Thread>(on_select);
idm::select<RawSPUThread>(on_select);
idm::select<SPUThread>(on_select);
//todo: this may exceed max command length
result = "m" + result + "l";
return send_cmd_ack(result);;
}
bool GDBDebugServer::cmd_current_thread(gdb_cmd & cmd)
{
return send_cmd_ack(selected_thread.expired() ? "" : u64_to_padded_hex(selected_thread.lock()->id));
}
bool GDBDebugServer::cmd_read_register(gdb_cmd & cmd)
{
select_thread(general_ops_thread_id);
auto th = selected_thread.lock();
if (th->id_type() == 1) {
auto ppu = std::static_pointer_cast<ppu_thread>(th);
u32 rid = hex_to_u32(cmd.data);
std::string result = get_reg(ppu, rid);
if (!result.length()) {
gdbDebugServer.warning("Wrong register id %d", rid);
return send_cmd_ack("E01");
}
return send_cmd_ack(result);
}
gdbDebugServer.warning("Unimplemented thread type %d", th->id_type());
return send_cmd_ack("");
}
bool GDBDebugServer::cmd_write_register(gdb_cmd & cmd)
{
select_thread(general_ops_thread_id);
auto th = selected_thread.lock();
if (th->id_type() == 1) {
auto ppu = std::static_pointer_cast<ppu_thread>(th);
size_t eq_pos = cmd.data.find('=');
if (eq_pos == std::string::npos) {
gdbDebugServer.warning("Wrong write_register cmd data %s", cmd.data.c_str());
return send_cmd_ack("E02");
}
u32 rid = hex_to_u32(cmd.data.substr(0, eq_pos));
std::string value = cmd.data.substr(eq_pos + 1);
if (!set_reg(ppu, rid, value)) {
gdbDebugServer.warning("Wrong register id %d", rid);
return send_cmd_ack("E01");
}
return send_cmd_ack("OK");
}
gdbDebugServer.warning("Unimplemented thread type %d", th->id_type());
return send_cmd_ack("");
}
bool GDBDebugServer::cmd_read_memory(gdb_cmd & cmd)
{
size_t s = cmd.data.find(',');
u32 addr = hex_to_u32(cmd.data.substr(0, s));
u32 len = hex_to_u32(cmd.data.substr(s + 1));
std::string result;
result.reserve(len * 2);
for (u32 i = 0; i < len; ++i) {
if (vm::check_addr(addr + i)) {
result += to_hexbyte(vm::read8(addr + i));
} else {
break;
//result += "xx";
}
}
if (len && !result.length()) {
//nothing read
return send_cmd_ack("E01");
}
return send_cmd_ack(result);
}
bool GDBDebugServer::cmd_write_memory(gdb_cmd & cmd)
{
size_t s = cmd.data.find(',');
size_t s2 = cmd.data.find(':');
if ((s == std::string::npos) || (s2 == std::string::npos)) {
gdbDebugServer.warning("Malformed write memory request received: %s", cmd.data.c_str());
return send_cmd_ack("E01");
}
u32 addr = hex_to_u32(cmd.data.substr(0, s));
u32 len = hex_to_u32(cmd.data.substr(s + 1, s2 - s - 1));
const char* data_ptr = (cmd.data.c_str()) + s2 + 1;
for (u32 i = 0; i < len; ++i) {
if (vm::check_addr(addr + i)) {
u8 val;
int res = sscanf_s(data_ptr, "%02hhX", &val);
if (!res) {
gdbDebugServer.warning("Couldn't read u8 from string %s", data_ptr);
return send_cmd_ack("E02");
}
data_ptr += 2;
vm::write8(addr + i, val);
} else {
return send_cmd_ack("E03");
}
}
return send_cmd_ack("OK");
}
bool GDBDebugServer::cmd_read_all_registers(gdb_cmd & cmd)
{
std::string result;
select_thread(general_ops_thread_id);
auto th = selected_thread.lock();
if (th->id_type() == 1) {
auto ppu = std::static_pointer_cast<ppu_thread>(th);
//68 64-bit registers, and 3 32-bit
result.reserve(68*16 + 3*8);
for (int i = 0; i < 71; ++i) {
result += get_reg(ppu, i);
}
return send_cmd_ack(result);
}
gdbDebugServer.warning("Unimplemented thread type %d", th->id_type());
return send_cmd_ack("");
}
bool GDBDebugServer::cmd_write_all_registers(gdb_cmd & cmd)
{
select_thread(general_ops_thread_id);
auto th = selected_thread.lock();
if (th->id_type() == 1) {
auto ppu = std::static_pointer_cast<ppu_thread>(th);
int ptr = 0;
for (int i = 0; i < 71; ++i) {
int sz = get_reg_size(ppu, i);
set_reg(ppu, i, cmd.data.substr(ptr, sz * 2));
ptr += sz * 2;
}
return send_cmd_ack("OK");
}
gdbDebugServer.warning("Unimplemented thread type %d", th->id_type());
return send_cmd_ack("E01");
}
bool GDBDebugServer::cmd_set_thread_ops(gdb_cmd & cmd)
{
char type = cmd.data[0];
std::string thread = cmd.data.substr(1);
u64 id = thread == "-1" ? ALL_THREADS : hex_to_u64(thread);
if (type == 'c') {
continue_ops_thread_id = id;
} else {
general_ops_thread_id = id;
}
if (select_thread(id)) {
return send_cmd_ack("OK");
}
gdbDebugServer.warning("Client asked to use thread %llx for %s, but no matching thread was found", id, type == 'c' ? "continue ops" : "general ops");
return send_cmd_ack("E01");
}
bool GDBDebugServer::cmd_attached_to_what(gdb_cmd & cmd)
{
//creating processes from client is not available yet
return send_cmd_ack("1");
}
bool GDBDebugServer::cmd_kill(gdb_cmd & cmd)
{
Emu.Stop();
return true;
}
bool GDBDebugServer::cmd_continue_support(gdb_cmd & cmd)
{
return send_cmd_ack("vCont;c;s;C;S");
}
bool GDBDebugServer::cmd_vcont(gdb_cmd & cmd)
{
//todo: handle multiple actions and thread ids
this->from_breakpoint = false;
if (cmd.data[1] == 'c') {
select_thread(continue_ops_thread_id);
auto ppu = std::static_pointer_cast<ppu_thread>(selected_thread.lock());
ppu->state -= cpu_flag::dbg_pause;
if (Emu.IsPaused()) {
Emu.Resume();
}
thread_ctrl::wait();
//we are in all-stop mode
Emu.Pause();
return send_reason();
} else if (cmd.data[1] == 's') {
select_thread(continue_ops_thread_id);
auto ppu = std::static_pointer_cast<ppu_thread>(selected_thread.lock());
ppu->state += cpu_flag::dbg_step;
ppu->state -= cpu_flag::dbg_pause;
if (Emu.IsPaused()) {
Emu.Resume();
} else {
ppu->notify();
}
thread_ctrl::wait();
//we are in all-stop mode
Emu.Pause();
return send_reason();
}
return send_cmd_ack("");
}
static const u32 INVALID_PTR = 0xffffffff;
bool GDBDebugServer::cmd_set_breakpoint(gdb_cmd & cmd)
{
char type = cmd.data[0];
//software breakpoint
if (type == '0') {
u32 addr = INVALID_PTR;
if (cmd.data.find(';') != std::string::npos) {
gdbDebugServer.warning("Received request to set breakpoint with condition, but they are not supported");
return send_cmd_ack("E01");
}
sscanf_s(cmd.data.c_str(), "0,%x", &addr);
if (addr == INVALID_PTR) {
gdbDebugServer.warning("Can't parse breakpoint request, data: %s", cmd.data.c_str());
return send_cmd_ack("E02");
}
ppu_set_breakpoint(addr);
return send_cmd_ack("OK");
}
//other breakpoint types are not supported
return send_cmd_ack("");
}
bool GDBDebugServer::cmd_remove_breakpoint(gdb_cmd & cmd)
{
char type = cmd.data[0];
//software breakpoint
if (type == '0') {
u32 addr = INVALID_PTR;
sscanf_s(cmd.data.c_str(), "0,%x", &addr);
if (addr == INVALID_PTR) {
gdbDebugServer.warning("Can't parse breakpoint remove request, data: %s", cmd.data.c_str());
return send_cmd_ack("E01");
}
ppu_remove_breakpoint(addr);
return send_cmd_ack("OK");
}
//other breakpoint types are not supported
return send_cmd_ack("");
}
#define PROCESS_CMD(cmds,handler) if (cmd.cmd == cmds) { if (!handler(cmd)) break; else continue; }
void GDBDebugServer::on_task()
{
sock_init();
start_server();
while (!stop) {
sockaddr_in client;
socklen_t client_len = sizeof(client);
client_socket = accept(server_socket, (struct sockaddr *) &client, &client_len);
if (client_socket == INVALID_SOCKET) {
if (check_errno_again()) {
thread_ctrl::wait_for(50);
continue;
}
gdbDebugServer.error("Could not establish new connection\n");
return;
}
//stop immediately
Emu.Pause();
try {
char hostbuf[32];
inet_ntop(client.sin_family, reinterpret_cast<void*>(&client.sin_addr), hostbuf, 32);
gdbDebugServer.success("Got connection to GDB debug server from %s:%d", hostbuf, client.sin_port);
gdb_cmd cmd;
while (!stop) {
if (!read_cmd(cmd)) {
break;
}
gdbDebugServer.trace("Command %s with data %s received", cmd.cmd.c_str(), cmd.data.c_str());
PROCESS_CMD("!", cmd_extended_mode);
PROCESS_CMD("?", cmd_reason);
PROCESS_CMD("qSupported", cmd_supported);
PROCESS_CMD("qfThreadInfo", cmd_thread_info);
PROCESS_CMD("qC", cmd_current_thread);
PROCESS_CMD("p", cmd_read_register);
PROCESS_CMD("P", cmd_write_register);
PROCESS_CMD("m", cmd_read_memory);
PROCESS_CMD("M", cmd_write_memory);
PROCESS_CMD("g", cmd_read_all_registers);
PROCESS_CMD("G", cmd_write_all_registers);
PROCESS_CMD("H", cmd_set_thread_ops);
PROCESS_CMD("qAttached", cmd_attached_to_what);
PROCESS_CMD("k", cmd_kill);
PROCESS_CMD("vCont?", cmd_continue_support);
PROCESS_CMD("vCont", cmd_vcont);
PROCESS_CMD("z", cmd_remove_breakpoint);
PROCESS_CMD("Z", cmd_set_breakpoint);
gdbDebugServer.trace("Unsupported command received %s", cmd.cmd.c_str());
if (!send_cmd_ack("")) {
break;
}
}
}
catch (std::runtime_error& e)
{
if (client_socket) {
closesocket(client_socket);
client_socket = 0;
}
gdbDebugServer.error(e.what());
}
}
}
#undef PROCESS_CMD
void GDBDebugServer::on_exit()
{
if (server_socket) {
closesocket(server_socket);
}
if (client_socket) {
closesocket(client_socket);
}
sock_quit();
}
std::string GDBDebugServer::get_name() const
{
return "GDBDebugger";
}
void GDBDebugServer::on_stop()
{
this->stop = true;
//just in case we are waiting for breakpoint
this->notify();
named_thread::on_stop();
}
u32 g_gdb_debugger_id = 0;
#ifndef _WIN32
#undef sscanf_s
#endif
#undef HEX_U32
#undef HEX_U64
#endif
+131
View File
@@ -0,0 +1,131 @@
#pragma once
#ifdef WITH_GDB_DEBUGGER
#include "Thread.h"
#include <Emu/IdManager.h>
#include "Emu/CPU/CPUThread.h"
#include "Emu/Cell/PPUThread.h"
#ifdef _WIN32
#include <winsock2.h>
#include <WS2tcpip.h>
#else
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#ifdef _WIN32
using socket_t = SOCKET;
#else
using socket_t = int;
#endif
typedef struct gdb_cmd {
std::string cmd;
std::string data;
u8 checksum;
} gdb_cmd;
class wrong_checksum_exception : public std::runtime_error {
public:
wrong_checksum_exception(char const* const message) : runtime_error(message) {}
};
const u64 ALL_THREADS = 0xffffffffffffffff;
const u64 ANY_THREAD = 0;
class GDBDebugServer : public named_thread {
socket_t server_socket;
socket_t client_socket;
std::weak_ptr<cpu_thread> selected_thread;
u64 continue_ops_thread_id = ANY_THREAD;
u64 general_ops_thread_id = ANY_THREAD;
//initialize server socket and start listening
void start_server();
//read at most cnt bytes to buf, returns nubmer of bytes actually read
int read(void* buf, int cnt);
//reads one character
char read_char();
//reads pairs of hex characters and returns their integer value
u8 read_hexbyte();
//tries to read command, throws exceptions if anything goes wrong
void try_read_cmd(gdb_cmd& out_cmd);
//reads commands until receiveing one with valid checksum
//in case of other exception (i.e. wrong first char of command)
//it will log exception text and return false
//in that case best for caller would be to stop reading, because
//chance of getting correct command is low
bool read_cmd(gdb_cmd& out_cmd);
//send cnt bytes from buf to client
void send(const char* buf, int cnt);
//send character to client
void send_char(char c);
//acknowledge packet, either as accepted or declined
void ack(bool accepted);
//sends command body cmd to client
void send_cmd(const std::string & cmd);
//sends command to client until receives positive acknowledgement
//returns false in case some error happened, and command wasn't sent
bool send_cmd_ack(const std::string & cmd);
//appends encoded char c to string str, and returns checksum. encoded byte can occupy 2 bytes
static u8 append_encoded_char(char c, std::string& str);
//convert u8 to 2 byte hexademical representation
static std::string to_hexbyte(u8 i);
//choose thread, support ALL_THREADS and ANY_THREAD values, returns true if some thread was selected
bool select_thread(u64 id);
//returns register value as hex string by register id (in gdb), in case of wrong id returns empty string
static std::string get_reg(std::shared_ptr<ppu_thread> thread, u32 rid);
//sets register value to hex string by register id (in gdb), in case of wrong id returns false
static bool set_reg(std::shared_ptr<ppu_thread> thread, u32 rid, std::string value);
//returns size of register with id rid in bytes, zero if invalid rid is provided
static u32 get_reg_size(std::shared_ptr<ppu_thread> thread, u32 rid);
//send reason of stop, returns false if sending response failed
bool send_reason();
//commands
bool cmd_extended_mode(gdb_cmd& cmd);
bool cmd_reason(gdb_cmd& cmd);
bool cmd_supported(gdb_cmd& cmd);
bool cmd_thread_info(gdb_cmd& cmd);
bool cmd_current_thread(gdb_cmd& cmd);
bool cmd_read_register(gdb_cmd& cmd);
bool cmd_write_register(gdb_cmd& cmd);
bool cmd_read_memory(gdb_cmd& cmd);
bool cmd_write_memory(gdb_cmd& cmd);
bool cmd_read_all_registers(gdb_cmd& cmd);
bool cmd_write_all_registers(gdb_cmd& cmd);
bool cmd_set_thread_ops(gdb_cmd& cmd);
bool cmd_attached_to_what(gdb_cmd& cmd);
bool cmd_kill(gdb_cmd& cmd);
bool cmd_continue_support(gdb_cmd& cmd);
bool cmd_vcont(gdb_cmd& cmd);
bool cmd_set_breakpoint(gdb_cmd& cmd);
bool cmd_remove_breakpoint(gdb_cmd& cmd);
protected:
void on_task() override final;
void on_exit() override final;
public:
static const u32 id_base = 1;
static const u32 id_step = 1;
static const u32 id_count = 0x100000;
bool from_breakpoint = true;
bool stop = false;
virtual std::string get_name() const;
virtual void on_stop() override final;
};
extern u32 g_gdb_debugger_id;
#endif
+1 -1
View File
@@ -4,7 +4,7 @@
#pragma push_macro("new")
#undef new
#include <gsl.h>
#include <gsl/gsl>
#pragma pop_macro("new")
#undef Expects
#undef Ensures
+365 -192
View File
@@ -5,12 +5,15 @@
#include <unordered_set>
#include <set>
#include <array>
#include <deque>
#include "types.h"
#include "Macro.h"
#include "StrFmt.h"
#include "File.h"
#include "Log.h"
#include "mutex.h"
#include "sysinfo.h"
#include "VirtualMemory.h"
#ifdef _MSC_VER
#pragma warning(push, 0)
@@ -20,24 +23,19 @@
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/ObjectCache.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef _WIN32
#include <Windows.h>
#else
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#endif
#include "JIT.h"
// Global LLVM context (thread-unsafe)
llvm::LLVMContext g_llvm_ctx;
// Memory manager mutex
shared_mutex s_mutex;
// Size of virtual memory area reserved: 512 MB
static const u64 s_memory_size = 0x20000000;
@@ -45,69 +43,133 @@ static const u64 s_memory_size = 0x20000000;
// Try to reserve a portion of virtual memory in the first 2 GB address space beforehand, if possible.
static void* const s_memory = []() -> void*
{
#ifdef _WIN32
for (u64 addr = 0x1000000; addr <= 0x60000000; addr += 0x1000000)
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
LLVMLinkInMCJIT();
for (u64 addr = 0x10000000; addr <= 0x80000000 - s_memory_size; addr += 0x1000000)
{
if (VirtualAlloc((void*)addr, s_memory_size, MEM_RESERVE, PAGE_NOACCESS))
if (auto ptr = utils::memory_reserve(s_memory_size, (void*)addr))
{
return (void*)addr;
return ptr;
}
}
return VirtualAlloc(NULL, s_memory_size, MEM_RESERVE, PAGE_NOACCESS);
#else
return ::mmap((void*)0x10000000, s_memory_size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
#endif
return utils::memory_reserve(s_memory_size);
}();
// EH frames
static u8* s_unwind_info;
static u64 s_unwind_size;
static void* s_next = s_memory;
#ifdef _WIN32
static std::vector<RUNTIME_FUNCTION> s_unwind; // Custom .pdata section replacement
static std::deque<std::vector<RUNTIME_FUNCTION>> s_unwater;
static std::vector<std::vector<RUNTIME_FUNCTION>> s_unwind; // .pdata
#endif
// Helper class
struct MemoryManager final : llvm::RTDyldMemoryManager
// Reset memory manager
extern void jit_finalize()
{
std::unordered_map<std::string, std::uintptr_t> table;
#ifdef _WIN32
for (auto&& unwind : s_unwind)
{
if (!RtlDeleteFunctionTable(unwind.data()))
{
LOG_FATAL(GENERAL, "RtlDeleteFunctionTable() failed! Error %u", GetLastError());
}
}
MemoryManager(std::unordered_map<std::string, std::uintptr_t>&& table)
: table(std::move(table))
s_unwind.clear();
#else
// TODO: unregister EH frames if necessary
#endif
utils::memory_decommit(s_memory, s_memory_size);
s_next = s_memory;
}
// Helper class
struct MemoryManager : llvm::RTDyldMemoryManager
{
std::unordered_map<std::string, u64>& m_link;
std::array<u8, 16>* m_tramps{};
u8* m_code_addr{}; // TODO
MemoryManager(std::unordered_map<std::string, u64>& table)
: m_link(table)
{
}
[[noreturn]] static void null()
{
throw std::runtime_error("Null function" HERE);
fmt::throw_exception("Null function" HERE);
}
virtual u64 getSymbolAddress(const std::string& name) override
llvm::JITSymbol findSymbol(const std::string& name) override
{
if (u64 addr = RTDyldMemoryManager::getSymbolAddress(name))
auto& addr = m_link[name];
// Find function address
if (!addr)
{
// This may be bad if LLVM requests some built-in functions like fma.
LOG_ERROR(GENERAL, "LLVM: Symbol requested %s -> 0x%016llx", name, addr);
return addr;
addr = RTDyldMemoryManager::getSymbolAddress(name);
if (addr)
{
LOG_WARNING(GENERAL, "LLVM: Symbol requested: %s -> 0x%016llx", name, addr);
}
else
{
LOG_ERROR(GENERAL, "LLVM: Linkage failed: %s", name);
addr = (u64)null;
}
}
const auto found = table.find(name);
if (found != table.end())
// Verify address for small code model
if ((u64)s_memory > 0x80000000 - s_memory_size ? (u64)addr - (u64)s_memory >= s_memory_size : addr >= 0x80000000)
{
return found->second;
// Lock memory manager
writer_lock lock(s_mutex);
// Allocate memory for trampolines
if (!m_tramps)
{
m_tramps = reinterpret_cast<decltype(m_tramps)>(s_next);
utils::memory_commit(s_next, 4096, utils::protection::wx);
s_next = (u8*)((u64)s_next + 4096);
}
// Create a trampoline
auto& data = *m_tramps++;
data[0x0] = 0xff; // JMP [rip+2]
data[0x1] = 0x25;
data[0x2] = 0x02;
data[0x3] = 0x00;
data[0x4] = 0x00;
data[0x5] = 0x00;
data[0x6] = 0x48; // MOV rax, imm64 (not executed)
data[0x7] = 0xb8;
std::memcpy(data.data() + 8, &addr, 8);
addr = (u64)&data;
// Reset pointer (memory page exhausted)
if (((u64)m_tramps % 4096) == 0)
{
m_tramps = nullptr;
}
}
// It's fine if some function is never called, for example.
LOG_ERROR(GENERAL, "LLVM: Linkage failed for %s", name);
return (u64)null;
return {addr, llvm::JITSymbolFlags::Exported};
}
virtual u8* allocateCodeSection(std::uintptr_t size, uint align, uint sec_id, llvm::StringRef sec_name) override
{
// Lock memory manager
writer_lock lock(s_mutex);
// Simple allocation
const u64 next = ::align((u64)m_next + size, 4096);
const u64 next = ::align((u64)s_next + size, 4096);
if (next > (u64)s_memory + s_memory_size)
{
@@ -115,24 +177,20 @@ struct MemoryManager final : llvm::RTDyldMemoryManager
return nullptr;
}
#ifdef _WIN32
if (!VirtualAlloc(m_next, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE))
#else
if (::mprotect(m_next, size, PROT_READ | PROT_WRITE | PROT_EXEC))
#endif
{
LOG_FATAL(GENERAL, "LLVM: Failed to allocate memory at 0x%p", m_next);
return nullptr;
}
utils::memory_commit(s_next, size, utils::protection::wx);
m_code_addr = (u8*)s_next;
LOG_SUCCESS(GENERAL, "LLVM: Code section %u '%s' allocated -> 0x%p (size=0x%llx, aligned 0x%x)", sec_id, sec_name.data(), m_next, size, align);
return (u8*)std::exchange(m_next, (void*)next);
LOG_NOTICE(GENERAL, "LLVM: Code section %u '%s' allocated -> %p (size=0x%llx, aligned 0x%x)", sec_id, sec_name.data(), s_next, size, align);
return (u8*)std::exchange(s_next, (void*)next);
}
virtual u8* allocateDataSection(std::uintptr_t size, uint align, uint sec_id, llvm::StringRef sec_name, bool is_ro) override
{
// Lock memory manager
writer_lock lock(s_mutex);
// Simple allocation
const u64 next = ::align((u64)m_next + size, 4096);
const u64 next = ::align((u64)s_next + size, 4096);
if (next > (u64)s_memory + s_memory_size)
{
@@ -140,188 +198,303 @@ struct MemoryManager final : llvm::RTDyldMemoryManager
return nullptr;
}
#ifdef _WIN32
if (!VirtualAlloc(m_next, size, MEM_COMMIT, PAGE_READWRITE))
#else
if (::mprotect(m_next, size, PROT_READ | PROT_WRITE))
#endif
if (!is_ro)
{
LOG_FATAL(GENERAL, "LLVM: Failed to allocate memory at 0x%p", m_next);
return nullptr;
LOG_ERROR(GENERAL, "LLVM: Writeable data section not supported!");
}
LOG_SUCCESS(GENERAL, "LLVM: Data section %u '%s' allocated -> 0x%p (size=0x%llx, aligned 0x%x, %s)", sec_id, sec_name.data(), m_next, size, align, is_ro ? "ro" : "rw");
return (u8*)std::exchange(m_next, (void*)next);
utils::memory_commit(s_next, size);
LOG_NOTICE(GENERAL, "LLVM: Data section %u '%s' allocated -> %p (size=0x%llx, aligned 0x%x, %s)", sec_id, sec_name.data(), s_next, size, align, is_ro ? "ro" : "rw");
return (u8*)std::exchange(s_next, (void*)next);
}
virtual bool finalizeMemory(std::string* = nullptr) override
{
// TODO: make sections read-only when necessary
// Lock memory manager
writer_lock lock(s_mutex);
// TODO: make only read-only sections read-only
//#ifdef _WIN32
// DWORD op;
// VirtualProtect(s_memory, (u64)m_next - (u64)s_memory, PAGE_READONLY, &op);
// VirtualProtect(s_code_addr, s_code_size, PAGE_EXECUTE_READ, &op);
//#else
// ::mprotect(s_memory, (u64)m_next - (u64)s_memory, PROT_READ);
// ::mprotect(s_code_addr, s_code_size, PROT_READ | PROT_EXEC);
//#endif
return false;
}
virtual void registerEHFrames(u8* addr, u64 load_addr, std::size_t size) override
{
s_unwind_info = addr;
s_unwind_size = size;
#ifdef _WIN32
// Lock memory manager
writer_lock lock(s_mutex);
// Use s_memory as a BASE, compute the difference
const u64 unwind_diff = (u64)addr - (u64)s_memory;
// Fix RUNTIME_FUNCTION records (.pdata section)
auto pdata = std::move(s_unwater.front());
s_unwater.pop_front();
for (auto& rf : pdata)
{
rf.UnwindData += static_cast<DWORD>(unwind_diff);
}
// Register .xdata UNWIND_INFO structs
if (!RtlAddFunctionTable(pdata.data(), (DWORD)pdata.size(), (u64)s_memory))
{
LOG_ERROR(GENERAL, "RtlAddFunctionTable() failed! Error %u", GetLastError());
}
else
{
s_unwind.emplace_back(std::move(pdata));
}
#endif
return RTDyldMemoryManager::registerEHFrames(addr, load_addr, size);
}
virtual void deregisterEHFrames(u8* addr, u64 load_addr, std::size_t size) override
virtual void deregisterEHFrames() override
{
LOG_ERROR(GENERAL, "deregisterEHFrames() called"); // Not expected
return RTDyldMemoryManager::deregisterEHFrames(addr, load_addr, size);
return RTDyldMemoryManager::deregisterEHFrames();
}
~MemoryManager()
{
#ifdef _WIN32
if (!RtlDeleteFunctionTable(s_unwind.data()))
{
LOG_FATAL(GENERAL, "RtlDeleteFunctionTable(addr=0x%p) failed! Error %u", s_unwind_info, GetLastError());
}
if (!VirtualFree(s_memory, 0, MEM_DECOMMIT))
{
LOG_FATAL(GENERAL, "VirtualFree(0x%p) failed! Error %u", s_memory, GetLastError());
}
#else
if (::mprotect(s_memory, s_memory_size, PROT_NONE))
{
LOG_FATAL(GENERAL, "mprotect(0x%p) failed! Error %d", s_memory, errno);
}
// TODO: unregister EH frames if necessary
#endif
}
private:
void* m_next = s_memory;
};
// Helper class
struct EventListener final : llvm::JITEventListener
struct EventListener : llvm::JITEventListener
{
MemoryManager& m_mem;
EventListener(MemoryManager& mem)
: m_mem(mem)
{
}
virtual void NotifyObjectEmitted(const llvm::object::ObjectFile& obj, const llvm::RuntimeDyld::LoadedObjectInfo& inf) override
{
const llvm::StringRef elf = obj.getData();
fs::file(fs::get_config_dir() + "LLVM.obj", fs::rewrite)
.write(elf.data(), elf.size());
#ifdef _WIN32
for (auto it = obj.section_begin(), end = obj.section_end(); it != end; ++it)
{
llvm::StringRef name;
it->getName(name);
if (name == ".pdata")
{
llvm::StringRef data;
it->getContents(data);
std::vector<RUNTIME_FUNCTION> rfs(data.size() / sizeof(RUNTIME_FUNCTION));
auto offsets = reinterpret_cast<DWORD*>(rfs.data());
// Initialize .pdata section using relocation info
for (auto ri = it->relocation_begin(), end = it->relocation_end(); ri != end; ++ri)
{
if (ri->getType() == 3 /*R_X86_64_GOT32*/)
{
const u64 value = *reinterpret_cast<const DWORD*>(data.data() + ri->getOffset());
offsets[ri->getOffset() / sizeof(DWORD)] = static_cast<DWORD>(value + ri->getSymbol()->getAddress().get());
}
}
// Lock memory manager
writer_lock lock(s_mutex);
// Use s_memory as a BASE, compute the difference
const u64 code_diff = (u64)m_mem.m_code_addr - (u64)s_memory;
// Fix RUNTIME_FUNCTION records (.pdata section)
for (auto& rf : rfs)
{
rf.BeginAddress += static_cast<DWORD>(code_diff);
rf.EndAddress += static_cast<DWORD>(code_diff);
}
s_unwater.emplace_back(std::move(rfs));
}
}
#endif
}
};
static EventListener s_listener;
jit_compiler::jit_compiler(std::unique_ptr<llvm::Module>&& _module, std::unordered_map<std::string, std::uintptr_t>&& table)
// Helper class
class ObjectCache final : public llvm::ObjectCache
{
EXPECTS(s_memory);
const std::string& m_path;
public:
ObjectCache(const std::string& path)
: m_path(path)
{
}
~ObjectCache() override = default;
void notifyObjectCompiled(const llvm::Module* module, llvm::MemoryBufferRef obj) override
{
std::string name = m_path;
name.append(module->getName());
fs::file(name, fs::rewrite).write(obj.getBufferStart(), obj.getBufferSize());
LOG_SUCCESS(GENERAL, "LLVM: Created module: %s", module->getName().data());
}
static std::unique_ptr<llvm::MemoryBuffer> load(const std::string& path)
{
if (fs::file cached{path, fs::read})
{
auto buf = llvm::MemoryBuffer::getNewUninitMemBuffer(cached.size());
cached.read(const_cast<char*>(buf->getBufferStart()), buf->getBufferSize());
return buf;
}
return nullptr;
}
std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module* module) override
{
std::string path = m_path;
path.append(module->getName());
if (auto buf = load(path))
{
LOG_SUCCESS(GENERAL, "LLVM: Loaded module: %s", module->getName().data());
return buf;
}
return nullptr;
}
};
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, std::string _cpu)
: m_link(std::move(_link))
, m_cpu(std::move(_cpu))
{
if (m_cpu.empty())
{
m_cpu = llvm::sys::getHostCPUName();
if (m_cpu == "sandybridge" ||
m_cpu == "ivybridge" ||
m_cpu == "haswell" ||
m_cpu == "broadwell" ||
m_cpu == "skylake" ||
m_cpu == "skylake-avx512" ||
m_cpu == "cannonlake")
{
if (!utils::has_avx())
{
m_cpu = "nehalem";
}
}
}
std::string result;
const auto module_ptr = _module.get();
// Initialization
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
LLVMLinkInMCJIT();
m_engine.reset(llvm::EngineBuilder(std::move(_module))
.setErrorStr(&result)
.setMCJITMemoryManager(std::make_unique<MemoryManager>(std::move(table)))
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setRelocationModel(llvm::Reloc::PIC_)
.setCodeModel((u64)s_memory <= 0x60000000 ? llvm::CodeModel::Medium : llvm::CodeModel::Large) // TODO
.setMCPU(llvm::sys::getHostCPUName())
.create());
if (!m_engine)
if (m_link.empty())
{
throw fmt::exception("LLVM: Failed to create ExecutionEngine: %s", result);
}
m_engine->setProcessAllSections(true); // ???
m_engine->RegisterJITEventListener(&s_listener);
m_engine->finalizeObject();
for (auto& func : module_ptr->functions())
{
if (!func.empty())
{
const std::string& name = func.getName();
// Register compiled function
m_map[name] = m_engine->getFunctionAddress(name);
}
// Delete IR to lower memory consumption
func.deleteBody();
}
#ifdef _WIN32
// Register .xdata UNWIND_INFO (.pdata section is empty for some reason)
std::set<u64> func_set;
for (const auto& pair : m_map)
{
func_set.emplace(pair.second);
}
// Hack (cannot obtain last function size)
func_set.emplace(::align(*--func_set.end() + 4096, 4096));
const u64 base = (u64)s_memory;
const u8* bits = s_unwind_info;
s_unwind.clear();
s_unwind.reserve(m_map.size());
for (auto it = func_set.begin(), end = --func_set.end(); it != end; it++)
{
const u64 addr = *it;
const u64 next = *func_set.upper_bound(addr);
// Generate RUNTIME_FUNCTION record
RUNTIME_FUNCTION uw;
uw.BeginAddress = static_cast<u32>(addr - base);
uw.EndAddress = static_cast<u32>(next - base);
uw.UnwindData = static_cast<u32>((u64)bits - base);
s_unwind.emplace_back(uw);
// Parse .xdata UNWIND_INFO record
const u8 flags = *bits++; // Version and flags
const u8 prolog = *bits++; // Size of prolog
const u8 count = *bits++; // Count of unwind codes
const u8 frame = *bits++; // Frame Reg + Off
bits += ::align(std::max<u8>(1, count), 2) * sizeof(u16); // UNWIND_CODE array
if (flags != 1)
{
LOG_ERROR(GENERAL, "LLVM: unsupported UNWIND_INFO version/flags (0x%02x)", flags);
break;
}
LOG_TRACE(GENERAL, "LLVM: .xdata at 0x%llx: function 0x%x..0x%x: p0x%02x, c0x%02x, f0x%02x", uw.UnwindData + base, uw.BeginAddress + base, uw.EndAddress + base, prolog, count, frame);
}
if (s_unwind_info + s_unwind_size != bits)
{
LOG_FATAL(GENERAL, "LLVM: .xdata analysis failed! (0x%p != 0x%p)", s_unwind_info + s_unwind_size, bits);
}
else if (!RtlAddFunctionTable(s_unwind.data(), (DWORD)s_unwind.size(), base))
{
LOG_FATAL(GENERAL, "RtlAddFunctionTable(addr=0x%p) failed! Error %u", s_unwind_info, GetLastError());
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
m_engine.reset(llvm::EngineBuilder(std::make_unique<llvm::Module>("null_", m_context))
.setErrorStr(&result)
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(llvm::CodeModel::Small)
.setMCPU(m_cpu)
.create());
}
else
{
LOG_SUCCESS(GENERAL, "LLVM: UNWIND_INFO registered (addr=0x%p, size=0x%llx)", s_unwind_info, s_unwind_size);
// Primary JIT
auto mem = std::make_unique<MemoryManager>(m_link);
m_jit_el = std::make_unique<EventListener>(*mem);
m_engine.reset(llvm::EngineBuilder(std::make_unique<llvm::Module>("null", m_context))
.setErrorStr(&result)
.setMCJITMemoryManager(std::move(mem))
.setOptLevel(llvm::CodeGenOpt::Aggressive)
.setCodeModel(llvm::CodeModel::Small)
.setMCPU(m_cpu)
.create());
if (m_engine)
{
m_engine->RegisterJITEventListener(m_jit_el.get());
}
}
if (!m_engine)
{
fmt::throw_exception("LLVM: Failed to create ExecutionEngine: %s", result);
}
#endif
}
jit_compiler::~jit_compiler()
{
}
void jit_compiler::add(std::unique_ptr<llvm::Module> module, const std::string& path)
{
ObjectCache cache{path};
m_engine->setObjectCache(&cache);
const auto ptr = module.get();
m_engine->addModule(std::move(module));
m_engine->generateCodeForModule(ptr);
m_engine->setObjectCache(nullptr);
for (auto& func : ptr->functions())
{
// Delete IR to lower memory consumption
func.deleteBody();
}
}
void jit_compiler::add(const std::string& path)
{
m_engine->addObjectFile(std::move(llvm::object::ObjectFile::createObjectFile(*ObjectCache::load(path)).get()));
}
void jit_compiler::fin()
{
m_engine->finalizeObject();
}
u64 jit_compiler::get(const std::string& name)
{
return m_engine->getGlobalValueAddress(name);
}
std::unordered_map<std::string, u64> jit_compiler::add(std::unordered_map<std::string, std::string> data)
{
// Lock memory manager
writer_lock lock(s_mutex);
std::unordered_map<std::string, u64> result;
std::size_t size = 0;
for (auto&& pair : data)
{
size += ::align(pair.second.size(), 16);
}
utils::memory_commit(s_next, size, utils::protection::wx);
std::memset(s_next, 0xc3, ::align(size, 4096));
for (auto&& pair : data)
{
std::memcpy(s_next, pair.second.data(), pair.second.size());
result.emplace(pair.first, (u64)s_next);
s_next = (void*)::align((u64)s_next + pair.second.size(), 16);
}
s_next = (void*)::align((u64)s_next, 4096);
return result;
}
#endif
+44 -14
View File
@@ -7,7 +7,9 @@
#include <unordered_map>
#include "types.h"
#include "mutex.h"
#include "restore_new.h"
#ifdef _MSC_VER
#pragma warning(push, 0)
#endif
@@ -17,33 +19,61 @@
#ifdef _MSC_VER
#pragma warning(pop)
#endif
extern llvm::LLVMContext g_llvm_ctx;
#include "define_new_memleakdetect.h"
// Temporary compiler interface
class jit_compiler final
{
// Local LLVM context
llvm::LLVMContext m_context;
// JIT Event Listener
std::unique_ptr<struct EventListener> m_jit_el;
// Execution instance
std::unique_ptr<llvm::ExecutionEngine> m_engine;
// Compiled functions
std::unordered_map<std::string, std::uintptr_t> m_map;
// Link table
std::unordered_map<std::string, u64> m_link;
// Arch
std::string m_cpu;
public:
jit_compiler(std::unique_ptr<llvm::Module>&&, std::unordered_map<std::string, std::uintptr_t>&&);
jit_compiler(const std::unordered_map<std::string, u64>& _link, std::string _cpu);
~jit_compiler();
// Get compiled function address
std::uintptr_t get(const std::string& name) const
// Get LLVM context
auto& get_context()
{
const auto found = m_map.find(name);
if (found != m_map.end())
{
return found->second;
}
return m_context;
}
return 0;
// Add module (path to obj cache dir)
void add(std::unique_ptr<llvm::Module> module, const std::string& path);
// Add object (path to obj file)
void add(const std::string& path);
// Finalize
void fin();
// Get compiled function address
u64 get(const std::string& name);
// Add functions directly to the memory manager (name -> code)
static std::unordered_map<std::string, u64> add(std::unordered_map<std::string, std::string>);
// Get CPU info
const std::string& cpu() const
{
return m_cpu;
}
// Check JIT purpose
bool is_primary() const
{
return !m_link.empty();
}
};
+23
View File
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+265
View File
@@ -0,0 +1,265 @@
/*
* Lightweight URL & URI parser (RFC 1738, RFC 3986)
* https://github.com/corporateshark/LUrlParser
*
* The MIT License (MIT)
*
* Copyright (C) 2015 Sergey Kosarevsky (sk@linderdaum.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "LUrlParser.h"
#include <algorithm>
#include <cstring>
#include <stdlib.h>
// check if the scheme name is valid
static bool IsSchemeValid( const std::string& SchemeName )
{
for ( auto c : SchemeName )
{
if ( !isalpha( c ) && c != '+' && c != '-' && c != '.' ) return false;
}
return true;
}
bool LUrlParser::clParseURL::GetPort( int* OutPort ) const
{
if ( !IsValid() ) { return false; }
int Port = atoi( m_Port.c_str() );
if ( Port <= 0 || Port > 65535 ) { return false; }
if ( OutPort ) { *OutPort = Port; }
return true;
}
// based on RFC 1738 and RFC 3986
LUrlParser::clParseURL LUrlParser::clParseURL::ParseURL( const std::string& URL )
{
LUrlParser::clParseURL Result;
const char* CurrentString = URL.c_str();
/*
* <scheme>:<scheme-specific-part>
* <scheme> := [a-z\+\-\.]+
* For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names
*/
// try to read scheme
{
const char* LocalString = strchr( CurrentString, ':' );
if ( !LocalString )
{
return clParseURL( LUrlParserError_NoUrlCharacter );
}
// save the scheme name
Result.m_Scheme = std::string( CurrentString, LocalString - CurrentString );
if ( !IsSchemeValid( Result.m_Scheme ) )
{
return clParseURL( LUrlParserError_InvalidSchemeName );
}
// scheme should be lowercase
std::transform( Result.m_Scheme.begin(), Result.m_Scheme.end(), Result.m_Scheme.begin(), ::tolower );
// skip ':'
CurrentString = LocalString+1;
}
/*
* //<user>:<password>@<host>:<port>/<url-path>
* any ":", "@" and "/" must be normalized
*/
// skip "//"
if ( *CurrentString++ != '/' ) return clParseURL( LUrlParserError_NoDoubleSlash );
if ( *CurrentString++ != '/' ) return clParseURL( LUrlParserError_NoDoubleSlash );
// check if the user name and password are specified
bool bHasUserName = false;
const char* LocalString = CurrentString;
while ( *LocalString )
{
if ( *LocalString == '@' )
{
// user name and password are specified
bHasUserName = true;
break;
}
else if ( *LocalString == '/' )
{
// end of <host>:<port> specification
bHasUserName = false;
break;
}
LocalString++;
}
// user name and password
LocalString = CurrentString;
if ( bHasUserName )
{
// read user name
while ( *LocalString && *LocalString != ':' && *LocalString != '@' ) LocalString++;
Result.m_UserName = std::string( CurrentString, LocalString - CurrentString );
// proceed with the current pointer
CurrentString = LocalString;
if ( *CurrentString == ':' )
{
// skip ':'
CurrentString++;
// read password
LocalString = CurrentString;
while ( *LocalString && *LocalString != '@' ) LocalString++;
Result.m_Password = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
}
// skip '@'
if ( *CurrentString != '@' )
{
return clParseURL( LUrlParserError_NoAtSign );
}
CurrentString++;
}
bool bHasBracket = ( *CurrentString == '[' );
// go ahead, read the host name
LocalString = CurrentString;
while ( *LocalString )
{
if ( bHasBracket && *LocalString == ']' )
{
// end of IPv6 address
LocalString++;
break;
}
else if ( !bHasBracket && ( *LocalString == ':' || *LocalString == '/' ) )
{
// port number is specified
break;
}
LocalString++;
}
Result.m_Host = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
// is port number specified?
if ( *CurrentString == ':' )
{
CurrentString++;
// read port number
LocalString = CurrentString;
while ( *LocalString && *LocalString != '/' ) LocalString++;
Result.m_Port = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
}
// end of string
if ( !*CurrentString )
{
Result.m_ErrorCode = LUrlParserError_Ok;
return Result;
}
// skip '/'
if ( *CurrentString != '/' )
{
return clParseURL( LUrlParserError_NoSlash );
}
CurrentString++;
// parse the path
LocalString = CurrentString;
while ( *LocalString && *LocalString != '#' && *LocalString != '?' ) LocalString++;
Result.m_Path = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
// check for query
if ( *CurrentString == '?' )
{
// skip '?'
CurrentString++;
// read query
LocalString = CurrentString;
while ( *LocalString && *LocalString != '#' ) LocalString++;
Result.m_Query = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
}
// check for fragment
if ( *CurrentString == '#' )
{
// skip '#'
CurrentString++;
// read fragment
LocalString = CurrentString;
while ( *LocalString ) LocalString++;
Result.m_Fragment = std::string( CurrentString, LocalString - CurrentString );
CurrentString = LocalString;
}
Result.m_ErrorCode = LUrlParserError_Ok;
return Result;
}
+78
View File
@@ -0,0 +1,78 @@
/*
* Lightweight URL & URI parser (RFC 1738, RFC 3986)
* https://github.com/corporateshark/LUrlParser
*
* The MIT License (MIT)
*
* Copyright (C) 2015 Sergey Kosarevsky (sk@linderdaum.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma once
#include <string>
namespace LUrlParser
{
enum LUrlParserError
{
LUrlParserError_Ok = 0,
LUrlParserError_Uninitialized = 1,
LUrlParserError_NoUrlCharacter = 2,
LUrlParserError_InvalidSchemeName = 3,
LUrlParserError_NoDoubleSlash = 4,
LUrlParserError_NoAtSign = 5,
LUrlParserError_UnexpectedEndOfLine = 6,
LUrlParserError_NoSlash = 7,
};
class clParseURL
{
public:
LUrlParserError m_ErrorCode;
std::string m_Scheme;
std::string m_Host;
std::string m_Port;
std::string m_Path;
std::string m_Query;
std::string m_Fragment;
std::string m_UserName;
std::string m_Password;
clParseURL()
: m_ErrorCode( LUrlParserError_Uninitialized )
{}
/// return 'true' if the parsing was successful
bool IsValid() const { return m_ErrorCode == LUrlParserError_Ok; }
/// helper to convert the port number to int, return 'true' if the port is valid (within the 0..65535 range)
bool GetPort( int* OutPort ) const;
/// parse the URL
static clParseURL ParseURL( const std::string& URL );
private:
explicit clParseURL( LUrlParserError ErrorCode )
: m_ErrorCode( ErrorCode )
{}
};
} // namespace LUrlParser
+377 -74
View File
@@ -1,92 +1,318 @@
#include "Log.h"
#include "File.h"
#include "StrFmt.h"
#include "sema.h"
#include <cstdarg>
#include "Utilities/sysinfo.h"
#include "rpcs3_version.h"
#include <string>
#include <unordered_map>
#ifdef _WIN32
#define NOMINMAX
#include <Windows.h>
#else
#include <chrono>
#include <sys/mman.h>
#endif
#include <zlib.h>
static std::string empty_string()
{
return {};
}
// Thread-specific log prefix provider
thread_local std::string(*g_tls_log_prefix)() = nullptr;
thread_local std::string(*g_tls_log_prefix)() = &empty_string;
#ifndef _MSC_VER
constexpr DECLARE(bijective<logs::level, const char*>::map);
#endif
template<>
void fmt_class_string<logs::level>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto lev)
{
switch (lev)
{
case logs::level::always: return "Nothing";
case logs::level::fatal: return "Fatal";
case logs::level::error: return "Error";
case logs::level::todo: return "TODO";
case logs::level::success: return "Success";
case logs::level::warning: return "Warning";
case logs::level::notice: return "Notice";
case logs::level::trace: return "Trace";
}
return unknown;
});
}
namespace logs
{
struct listener
{
listener() = default;
virtual ~listener() = default;
virtual void log(const channel& ch, level sev, const std::string& text) = 0;
};
constexpr std::size_t s_log_size = 128 * 1024 * 1024;
constexpr std::size_t s_log_size_s = s_log_size / 2;
constexpr std::size_t s_log_size_t = s_log_size / 4 + s_log_size_s;
constexpr std::size_t s_log_size_e = s_log_size / 8 + s_log_size_t;
constexpr std::size_t s_log_size_f = s_log_size / 16 + s_log_size_e;
class file_writer
{
// Could be memory-mapped file
fs::file m_file;
std::string m_name;
#ifdef _WIN32
::HANDLE m_fmap;
#endif
atomic_t<std::size_t> m_pos{0};
std::size_t m_size{0};
uchar* m_fptr{};
public:
file_writer(const std::string& name);
virtual ~file_writer() = default;
virtual ~file_writer();
// Append raw data
void log(const std::string& text);
void log(logs::level sev, const char* text, std::size_t size);
};
// Get current file size (may be used by secondary readers)
std::size_t size() const;
struct channel_info
{
channel* pointer = nullptr;
level enabled = level::notice;
void set_level(level value)
{
enabled = value;
if (pointer)
{
pointer->enabled = value;
}
}
};
struct stored_message
{
message m;
u64 stamp;
std::string prefix;
std::string text;
};
struct file_listener : public file_writer, public listener
{
file_listener(const std::string& name)
: file_writer(name)
, listener()
{
}
file_listener(const std::string& name);
virtual ~file_listener() = default;
// Encode level, current thread name, channel name and write log message
virtual void log(const channel& ch, level sev, const std::string& text) override;
virtual void log(u64 stamp, const message& msg, const std::string& prefix, const std::string& text) override;
// Channel registry
std::unordered_map<std::string, channel_info> channels;
// Messages for delayed listener initialization
std::vector<stored_message> messages;
};
static file_listener& get_logger()
static file_listener* get_logger()
{
// Use magic static
static file_listener logger("RPCS3.log");
return logger;
return &logger;
}
channel GENERAL(nullptr, level::notice);
channel LOADER("LDR", level::notice);
channel MEMORY("MEM", level::notice);
channel RSX("RSX", level::notice);
channel HLE("HLE", level::notice);
channel PPU("PPU", level::notice);
channel SPU("SPU", level::notice);
static u64 get_stamp()
{
static struct time_initializer
{
#ifdef _WIN32
LARGE_INTEGER freq;
LARGE_INTEGER start;
time_initializer()
{
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&start);
}
#else
std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
#endif
u64 get() const
{
#ifdef _WIN32
LARGE_INTEGER now;
QueryPerformanceCounter(&now);
const LONGLONG diff = now.QuadPart - start.QuadPart;
return diff / freq.QuadPart * 1'000'000 + diff % freq.QuadPart * 1'000'000 / freq.QuadPart;
#else
return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - start).count();
#endif
}
} timebase{};
return timebase.get();
}
channel GENERAL("");
channel LOADER("LDR");
channel MEMORY("MEM");
channel RSX("RSX");
channel HLE("HLE");
channel PPU("PPU");
channel SPU("SPU");
channel ARMv7("ARMv7");
// Channel registry mutex
semaphore<> g_mutex;
// Must be set to true in main()
atomic_t<bool> g_init{false};
void reset()
{
semaphore_lock lock(g_mutex);
for (auto&& pair : get_logger()->channels)
{
pair.second.set_level(level::notice);
}
}
void set_level(const std::string& ch_name, level value)
{
semaphore_lock lock(g_mutex);
get_logger()->channels[ch_name].set_level(value);
}
// Must be called in main() to stop accumulating messages in g_messages
void set_init()
{
if (!g_init)
{
semaphore_lock lock(g_mutex);
get_logger()->messages.clear();
g_init = true;
}
}
}
void logs::channel::broadcast(const logs::channel& ch, logs::level sev, const char* fmt...)
logs::listener::~listener()
{
va_list args;
va_start(args, fmt);
get_logger().log(ch, sev, fmt::unsafe_vformat(fmt, args));
va_end(args);
}
void logs::listener::add(logs::listener* _new)
{
// Get first (main) listener
listener* lis = get_logger();
semaphore_lock lock(g_mutex);
// Install new listener at the end of linked list
while (lis->m_next || !lis->m_next.compare_and_swap_test(nullptr, _new))
{
lis = lis->m_next;
}
// Send initial messages
for (const auto& msg : get_logger()->messages)
{
_new->log(msg.stamp, msg.m, msg.prefix, msg.text);
}
}
void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, const u64* args)
{
// Get timestamp
const u64 stamp = get_stamp();
// Register channel
if (ch->enabled == level::_uninit)
{
semaphore_lock lock(g_mutex);
auto& info = get_logger()->channels[ch->name];
if (info.pointer && info.pointer != ch)
{
fmt::throw_exception("logs::channel repetition: %s", ch->name);
}
else if (!info.pointer)
{
info.pointer = ch;
ch->enabled = info.enabled;
// Check level again
if (info.enabled < sev)
{
return;
}
}
}
// Get text
thread_local std::string text; text.clear();
fmt::raw_append(text, fmt, sup, args);
std::string prefix = g_tls_log_prefix();
// Get first (main) listener
listener* lis = get_logger();
if (!g_init)
{
semaphore_lock lock(g_mutex);
if (!g_init)
{
while (lis)
{
lis->log(stamp, *this, prefix, text);
lis = lis->m_next;
}
// Store message additionally
get_logger()->messages.emplace_back(stored_message{*this, stamp, std::move(prefix), text});
}
}
// Send message to all listeners
while (lis)
{
lis->log(stamp, *this, prefix, text);
lis = lis->m_next;
}
}
[[noreturn]] extern void catch_all_exceptions();
logs::file_writer::file_writer(const std::string& name)
: m_name(name)
{
try
{
if (!m_file.open(fs::get_config_dir() + name, fs::rewrite + fs::append))
if (!m_file.open(fs::get_config_dir() + name, fs::read + fs::write + fs::create + fs::trunc + fs::unshare))
{
throw fmt::exception("Can't create log file %s (error %d)", name, fs::g_tls_error);
fmt::throw_exception("Can't create file %s (error %s)", name, fs::g_tls_error);
}
#ifdef _WIN32
m_fmap = CreateFileMappingW(m_file.get_handle(), 0, PAGE_READWRITE, s_log_size >> 32, s_log_size & 0xffffffff, 0);
m_fptr = m_fmap ? (uchar*)MapViewOfFile(m_fmap, FILE_MAP_WRITE, 0, 0, 0) : nullptr;
#else
m_file.trunc(s_log_size);
m_fptr = (uchar*)::mmap(0, s_log_size, PROT_READ | PROT_WRITE, MAP_SHARED, m_file.get_handle(), 0);
#endif
verify(name.c_str()), m_fptr;
std::memset(m_fptr, '\n', s_log_size);
// Rotate backups (TODO)
fs::remove_file(fs::get_config_dir() + name + "1.gz");
fs::create_dir(fs::get_config_dir() + "old_logs");
fs::rename(fs::get_config_dir() + m_name + ".gz", fs::get_config_dir() + "old_logs/" + m_name + ".gz", true);
}
catch (...)
{
@@ -94,54 +320,131 @@ logs::file_writer::file_writer(const std::string& name)
}
}
void logs::file_writer::log(const std::string& text)
logs::file_writer::~file_writer()
{
m_file.write(text);
if (m_size == 0)
{
m_size = std::min<std::size_t>(+m_pos, s_log_size);
}
// Compress
z_stream zs{};
if (deflateInit2(&zs, 9, Z_DEFLATED, 16 + 15, 9, Z_DEFAULT_STRATEGY) == Z_OK)
{
auto buf = std::make_unique<uchar[]>(s_log_size);
zs.avail_in = ::narrow<u32>(m_size);
zs.avail_out = s_log_size;
zs.next_in = m_fptr;
zs.next_out = buf.get();
if (deflate(&zs, Z_FINISH) != Z_STREAM_ERROR)
{
fs::file(fs::get_config_dir() + m_name + ".gz", fs::rewrite).write(buf.get(), zs.total_out);
}
if (deflateEnd(&zs) != Z_OK)
{
}
}
#ifdef _WIN32
UnmapViewOfFile(m_fptr);
CloseHandle(m_fmap);
#else
::munmap(m_fptr, s_log_size);
#endif
m_file.trunc(m_size);
}
std::size_t logs::file_writer::size() const
void logs::file_writer::log(logs::level sev, const char* text, std::size_t size)
{
return m_file.pos();
// Adaptive log limit
const auto lim =
sev >= logs::level::success ? s_log_size_s :
sev == logs::level::todo ? s_log_size_t :
sev == logs::level::error ? s_log_size_e : s_log_size_f;
if (m_pos >= lim)
{
return;
}
// Acquire memory
const auto pos = m_pos.fetch_add(size);
// Write if possible
if (pos + size <= s_log_size)
{
std::memcpy(m_fptr + pos, text, size);
}
else if (pos <= s_log_size)
{
m_size = pos;
}
}
void logs::file_listener::log(const logs::channel& ch, logs::level sev, const std::string& text)
logs::file_listener::file_listener(const std::string& name)
: file_writer(name)
, listener()
{
std::string msg; msg.reserve(text.size() + 200);
// Write UTF-8 BOM
file_writer::log(logs::level::always, "\xEF\xBB\xBF", 3);
// Write initial message
stored_message ver;
ver.m.ch = nullptr;
ver.m.sev = level::always;
ver.stamp = 0;
ver.text = fmt::format("RPCS3 v%s | %s\n%s", rpcs3::version.to_string(), rpcs3::get_branch(), utils::get_system_info());
file_writer::log(logs::level::always, ver.text.data(), ver.text.size());
file_writer::log(logs::level::always, "\n", 1);
messages.emplace_back(std::move(ver));
}
void logs::file_listener::log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& _text)
{
thread_local std::string text;
// Used character: U+00B7 (Middle Dot)
switch (sev)
switch (msg.sev)
{
case level::always: msg = u8"·A "; break;
case level::fatal: msg = u8"·F "; break;
case level::error: msg = u8"·E "; break;
case level::todo: msg = u8"·U "; break;
case level::success: msg = u8"·S "; break;
case level::warning: msg = u8"·W "; break;
case level::notice: msg = u8"·! "; break;
case level::trace: msg = u8"·T "; break;
case level::always: text = u8"·A "; break;
case level::fatal: text = u8"·F "; break;
case level::error: text = u8"·E "; break;
case level::todo: text = u8"·U "; break;
case level::success: text = u8"·S "; break;
case level::warning: text = u8"·W "; break;
case level::notice: text = u8"·! "; break;
case level::trace: text = u8"·T "; break;
}
// TODO: print time?
// Print miscosecond timestamp
const u64 hours = stamp / 3600'000'000;
const u64 mins = (stamp % 3600'000'000) / 60'000'000;
const u64 secs = (stamp % 60'000'000) / 1'000'000;
const u64 frac = (stamp % 1'000'000);
fmt::append(text, "%u:%02u:%02u.%06u ", hours, mins, secs, frac);
if (auto prefix = g_tls_log_prefix)
if (prefix.size() > 0)
{
msg += '{';
msg += prefix();
msg += "} ";
text += "{";
text += prefix;
text += "} ";
}
if (ch.name)
{
msg += ch.name;
msg += sev == level::todo ? " TODO: " : ": ";
}
else if (sev == level::todo)
{
msg += "TODO: ";
}
msg += text;
msg += '\n';
file_writer::log(msg);
if (msg.ch && '\0' != *msg.ch->name)
{
text += msg.ch->name;
text += msg.sev == level::todo ? " TODO: " : ": ";
}
else if (msg.sev == level::todo)
{
text += "TODO: ";
}
text += _text;
text += '\n';
file_writer::log(msg.sev, text.data(), text.size());
}
+59 -40
View File
@@ -2,19 +2,54 @@
#include "types.h"
#include "Atomic.h"
#include "StrFmt.h"
#include <climits>
namespace logs
{
enum class level : uint
{
always, // highest level (unused, cannot be disabled)
always, // Highest log severity (unused, cannot be disabled)
fatal,
error,
todo,
success,
warning,
notice,
trace, // lowest level (usually disabled)
trace, // Lowest severity (usually disabled)
_uninit = UINT_MAX, // Special value for delayed initialization
};
struct channel;
// Message information (temporary data)
struct message
{
channel* ch;
level sev;
// Send log message to global logger instance
void broadcast(const char*, const fmt_type_info*, const u64*);
};
class listener
{
// Next listener (linked list)
atomic_t<listener*> m_next{};
friend struct message;
public:
constexpr listener() = default;
virtual ~listener();
// Process log message
virtual void log(u64 stamp, const message& msg, const std::string& prefix, const std::string& text) = 0;
// Add new listener
static void add(listener*);
};
struct channel
@@ -25,28 +60,26 @@ namespace logs
// The lowest logging level enabled for this channel (used for early filtering)
atomic_t<level> enabled;
// Constant initialization: name and initial log level
constexpr channel(const char* name, level enabled = level::trace)
// Constant initialization: channel name
constexpr channel(const char* name)
: name(name)
, enabled(enabled)
, enabled(level::_uninit)
{
}
// Formatting function
template<typename... Args>
void format(level sev, const char* fmt, const Args&... args) const
SAFE_BUFFERS FORCE_INLINE void format(level sev, const char* fmt, const Args&... args)
{
#ifdef _MSC_VER
if (sev <= enabled)
#else
if (__builtin_expect(sev <= enabled, 0))
#endif
broadcast(*this, sev, fmt, ::unveil<Args>::get(args)...);
if (UNLIKELY(sev <= enabled))
{
message{this, sev}.broadcast(fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
}
#define GEN_LOG_METHOD(_sev)\
template<typename... Args>\
void _sev(const char* fmt, const Args&... args) const\
SAFE_BUFFERS void _sev(const char* fmt, const Args&... args)\
{\
return format<Args...>(level::_sev, fmt, args...);\
}
@@ -60,10 +93,6 @@ namespace logs
GEN_LOG_METHOD(trace)
#undef GEN_LOG_METHOD
private:
// Send log message to global logger instance
static void broadcast(const channel& ch, level sev, const char* fmt...);
};
/* Small set of predefined channels */
@@ -76,30 +105,20 @@ namespace logs
extern channel PPU;
extern channel SPU;
extern channel ARMv7;
}
template<>
struct bijective<logs::level, const char*>
{
static constexpr bijective_pair<logs::level, const char*> map[]
{
{ logs::level::always, "Nothing" },
{ logs::level::fatal, "Fatal" },
{ logs::level::error, "Error" },
{ logs::level::todo, "TODO" },
{ logs::level::success, "Success" },
{ logs::level::warning, "Warning" },
{ logs::level::notice, "Notice" },
{ logs::level::trace, "Trace" },
};
};
// Log level control: set all channels to level::notice
void reset();
// Log level control: register channel if necessary, set channel level
void set_level(const std::string&, level);
}
// Legacy:
#define LOG_SUCCESS(ch, fmt, ...) logs::ch.success(fmt, ##__VA_ARGS__)
#define LOG_NOTICE(ch, fmt, ...) logs::ch.notice (fmt, ##__VA_ARGS__)
#define LOG_WARNING(ch, fmt, ...) logs::ch.warning(fmt, ##__VA_ARGS__)
#define LOG_ERROR(ch, fmt, ...) logs::ch.error (fmt, ##__VA_ARGS__)
#define LOG_TODO(ch, fmt, ...) logs::ch.todo (fmt, ##__VA_ARGS__)
#define LOG_TRACE(ch, fmt, ...) logs::ch.trace (fmt, ##__VA_ARGS__)
#define LOG_FATAL(ch, fmt, ...) logs::ch.fatal (fmt, ##__VA_ARGS__)
#define LOG_SUCCESS(ch, fmt, ...) logs::ch.success("" fmt, ##__VA_ARGS__)
#define LOG_NOTICE(ch, fmt, ...) logs::ch.notice ("" fmt, ##__VA_ARGS__)
#define LOG_WARNING(ch, fmt, ...) logs::ch.warning("" fmt, ##__VA_ARGS__)
#define LOG_ERROR(ch, fmt, ...) logs::ch.error ("" fmt, ##__VA_ARGS__)
#define LOG_TODO(ch, fmt, ...) logs::ch.todo ("" fmt, ##__VA_ARGS__)
#define LOG_TRACE(ch, fmt, ...) logs::ch.trace ("" fmt, ##__VA_ARGS__)
#define LOG_FATAL(ch, fmt, ...) logs::ch.fatal ("" fmt, ##__VA_ARGS__)
-98
View File
@@ -1,98 +0,0 @@
#pragma once
class MTProgressDialog : public wxDialog
{
wxGauge** m_gauge;
wxStaticText** m_msg;
wxArrayLong m_maximum;
const u8 m_cores;
static const uint layout = 16;
static const uint maxdial = 65536;
wxArrayInt m_lastupdate;
public:
MTProgressDialog(wxWindow* parent, const wxSize& size, const wxString& title,
const wxString& msg, const wxArrayLong& maximum, const u8 cores)
: wxDialog(parent, wxID_ANY, title, wxDefaultPosition)
, m_maximum(maximum)
, m_cores(cores)
{
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
m_gauge = new wxGauge*[m_cores];
m_msg = new wxStaticText*[m_cores];
m_lastupdate.SetCount(cores);
for(uint i=0; i<m_cores; ++i)
{
m_lastupdate[i] = -1;
m_msg[i] = new wxStaticText(this, wxID_ANY, msg);
sizer->Add(m_msg[i], 0, wxLEFT | wxTOP, layout);
m_gauge[i] = new wxGauge(this, wxID_ANY, maxdial,
wxDefaultPosition, wxDefaultSize,
wxGA_HORIZONTAL );
sizer->Add(m_gauge[i], 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, layout);
m_gauge[i]->SetValue(0);
sizer->AddSpacer(5);
}
SetSizerAndFit(sizer);
if(size != wxDefaultSize)
{
SetSize(size);
}
else
{
wxSize ws;
ws.x = 400;
ws.y = GetSize().y + 8;
SetSize(ws);
}
m_maximum.SetCount(m_cores);
Show();
}
force_inline void Update(const u8 thread_id, const u64 value, const wxString& msg)
{
if(thread_id > m_cores) return;
const int curupdate = (int)(((double)value/(double)m_maximum[thread_id])*1000);
if(curupdate == m_lastupdate[thread_id]) return;
m_lastupdate[thread_id] = curupdate;
m_msg[thread_id]->SetLabel(msg);
if(value >= (u32)m_maximum[thread_id]) return;
m_gauge[thread_id]->SetValue(((double)value / (double)m_maximum[thread_id]) * maxdial);
}
const u32 GetMaxValue(const uint thread_id) const
{
if(thread_id > m_cores) return 0;
return m_maximum[thread_id];
}
void SetMaxFor(const uint thread_id, const u64 val)
{
if(thread_id > m_cores) return;
m_maximum[thread_id] = val;
m_lastupdate[thread_id] = 0;
}
virtual void Close(bool force = false)
{
m_lastupdate.Empty();
m_maximum.Empty();
wxDialog::Close(force);
}
};
-83
View File
@@ -1,83 +0,0 @@
#pragma once
#include <cstdint>
#include <exception>
template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
constexpr T align(const T& value, std::uint64_t align)
{
return static_cast<T>((value + (align - 1)) & ~(align - 1));
}
template<typename To, typename From>
constexpr To narrow_impl(const To& result, const From& value, const char* message)
{
return static_cast<From>(result) != value ? throw std::runtime_error(message) : result;
}
// Narrow cast (similar to gsl::narrow) with fixed message
template<typename To, typename From>
constexpr auto narrow(const From& value, const char* fixed_msg = "::narrow() failed") -> decltype(static_cast<To>(static_cast<From>(std::declval<To>())))
{
return narrow_impl(static_cast<To>(value), value, fixed_msg);
}
// Return 32 bit .size() for container
template<typename CT>
constexpr auto size32(const CT& container, const char* fixed_msg = "::size32() failed") -> decltype(static_cast<std::uint32_t>(container.size()))
{
return narrow<std::uint32_t>(container.size(), fixed_msg);
}
// Return 32 bit size for an array
template<typename T, std::size_t Size>
constexpr std::uint32_t size32(const T(&)[Size])
{
static_assert(Size <= UINT32_MAX, "size32() error: too big");
return static_cast<std::uint32_t>(Size);
}
#define CHECK_SIZE(type, size) static_assert(sizeof(type) == size, "Invalid " #type " type size")
#define CHECK_ALIGN(type, align) static_assert(alignof(type) == align, "Invalid " #type " type alignment")
#define CHECK_MAX_SIZE(type, size) static_assert(sizeof(type) <= size, #type " type size is too big")
#define CHECK_SIZE_ALIGN(type, size, align) CHECK_SIZE(type, size); CHECK_ALIGN(type, align)
#define CHECK_STORAGE(type, storage) static_assert(sizeof(type) <= sizeof(storage) && alignof(type) <= alignof(decltype(storage)), #type " is too small")
// Return 32 bit sizeof() to avoid widening/narrowing conversions with size_t
#define SIZE_32(type) static_cast<std::uint32_t>(sizeof(type))
// Return 32 bit alignof() to avoid widening/narrowing conversions with size_t
#define ALIGN_32(type) static_cast<std::uint32_t>(alignof(type))
// Return 32 bit custom offsetof()
#define OFFSET_32(type, x) static_cast<std::uint32_t>(reinterpret_cast<std::uintptr_t>(&reinterpret_cast<const volatile char&>(reinterpret_cast<type*>(0ull)->x)))
// Sometimes to avoid writing std::remove_cv_t<>, example: std::is_same<CV T1, CV T2>
#define CV const volatile
#define CONCATENATE_DETAIL(x, y) x ## y
#define CONCATENATE(x, y) CONCATENATE_DETAIL(x, y)
#define STRINGIZE_DETAIL(x) #x
#define STRINGIZE(x) STRINGIZE_DETAIL(x)
// Macro set, wraps an expression into lambda
#define WRAP_EXPR(expr, ...) [&](__VA_ARGS__) { return expr; }
#define COPY_EXPR(expr, ...) [=](__VA_ARGS__) { return expr; }
#define PURE_EXPR(expr, ...) [] (__VA_ARGS__) { return expr; }
#define return_ return
#define HERE "\n(in file " __FILE__ ":" STRINGIZE(__LINE__) ")"
// Ensure that the expression is evaluated to true. Always evaluated and allowed to have side effects (unlike assert() macro).
#define VERIFY(expr) do { if (!(expr)) throw std::runtime_error("Verification failed: " #expr HERE); } while (0)
// EXPECTS() and ENSURES() are intended to check function arguments and results.
// Expressions are not guaranteed to evaluate.
#define EXPECTS(expr) do { if (!(expr)) throw std::runtime_error("Precondition failed: " #expr HERE); } while (0)
#define ENSURES(expr) do { if (!(expr)) throw std::runtime_error("Postcondition failed: " #expr HERE); } while (0)
#define DECLARE(...) decltype(__VA_ARGS__) __VA_ARGS__
#define STR_CASE(value) case value: return #value
-51
View File
@@ -1,51 +0,0 @@
#include "Platform.h"
#ifdef __APPLE__
#include <sys/types.h>
#include <sys/_types/_timespec.h>
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_time.h>
#undef CPU_STATE_MAX
#define MT_NANO (+1.0E-9)
#define MT_GIGA UINT64_C(1000000000)
// TODO create a list of timers,
static double mt_timebase = 0.0;
static uint64_t mt_timestart = 0;
// TODO be more careful in a multithreaded environement
int clock_gettime(clockid_t clk_id, struct timespec *tp)
{
kern_return_t retval = KERN_SUCCESS;
if( clk_id == TIMER_ABSTIME)
{
if (!mt_timestart) { // only one timer, initilized on the first call to the TIMER
mach_timebase_info_data_t tb = { 0 };
mach_timebase_info(&tb);
mt_timebase = tb.numer;
mt_timebase /= tb.denom;
mt_timestart = mach_absolute_time();
}
double diff = (mach_absolute_time() - mt_timestart) * mt_timebase;
tp->tv_sec = diff * MT_NANO;
tp->tv_nsec = diff - (tp->tv_sec * MT_GIGA);
}
else // other clk_ids are mapped to the coresponding mach clock_service
{
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), clk_id, &cclock);
retval = clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self(), cclock);
tp->tv_sec = mts.tv_sec;
tp->tv_nsec = mts.tv_nsec;
}
return retval;
}
#endif /* __APPLE__ */
-122
View File
@@ -1,122 +0,0 @@
#pragma once
#include <cstdint>
#include <immintrin.h>
#include <emmintrin.h>
#define IS_LE_MACHINE 1
#define IS_BE_MACHINE 0
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <x86intrin.h>
#endif
#ifdef _MSC_VER
#define ASSUME(cond) __assume(cond)
#define LIKELY(cond) (cond)
#define UNLIKELY(cond) (cond)
#else
#define ASSUME(cond) do { if (!(cond)) __builtin_unreachable(); } while (0)
#define LIKELY(cond) __builtin_expect(!!(cond), 1)
#define UNLIKELY(cond) __builtin_expect(!!(cond), 0)
#endif
// Some platforms don't support thread_local well yet.
#ifndef _MSC_VER
#define thread_local __thread
#endif
#ifdef _MSC_VER
#define never_inline __declspec(noinline)
#else
#define never_inline __attribute__((noinline))
#endif
#ifdef _MSC_VER
#define force_inline __forceinline
#else
#define force_inline __attribute__((always_inline)) inline
#endif
#if defined(__GNUG__)
#include <stdlib.h>
#define _fpclass(x) std::fpclassify(x)
#define INFINITE 0xFFFFFFFF
#ifdef __APPLE__
// XXX only supports a single timer
#define TIMER_ABSTIME -1
/* The opengroup spec isn't clear on the mapping from REALTIME to CALENDAR
being appropriate or not.
http://pubs.opengroup.org/onlinepubs/009695299/basedefs/time.h.html */
#define CLOCK_REALTIME 1 // #define CALENDAR_CLOCK 1 from mach/clock_types.h
#define CLOCK_MONOTONIC 0 // #define SYSTEM_CLOCK 0
typedef int clockid_t;
/* the mach kernel uses struct mach_timespec, so struct timespec
is loaded from <sys/_types/_timespec.h> for compatability */
// struct timespec { time_t tv_sec; long tv_nsec; };
int clock_gettime(clockid_t clk_id, struct timespec *tp);
#endif /* __APPLE__ */
#endif /* __GNUG__ */
inline std::uint32_t cntlz32(std::uint32_t arg)
{
#if defined(_MSC_VER)
unsigned long res;
return _BitScanReverse(&res, arg) ? res ^ 31 : 32;
#else
return arg ? __builtin_clzll(arg) - 32 : 32;
#endif
}
inline std::uint64_t cntlz64(std::uint64_t arg)
{
#if defined(_MSC_VER)
unsigned long res;
return _BitScanReverse64(&res, arg) ? res ^ 63 : 64;
#else
return arg ? __builtin_clzll(arg) : 64;
#endif
}
// Helper function, used by ""_u16, ""_u32, ""_u64
constexpr std::uint8_t to_u8(char c)
{
return static_cast<std::uint8_t>(c);
}
// Convert 2-byte string to u16 value like reinterpret_cast does
constexpr std::uint16_t operator""_u16(const char* s, std::size_t length)
{
return length != 2 ? throw s :
#if IS_LE_MACHINE == 1
to_u8(s[1]) << 8 | to_u8(s[0]);
#endif
}
// Convert 4-byte string to u32 value like reinterpret_cast does
constexpr std::uint32_t operator""_u32(const char* s, std::size_t length)
{
return length != 4 ? throw s :
#if IS_LE_MACHINE == 1
to_u8(s[3]) << 24 | to_u8(s[2]) << 16 | to_u8(s[1]) << 8 | to_u8(s[0]);
#endif
}
// Convert 8-byte string to u64 value like reinterpret_cast does
constexpr std::uint64_t operator""_u64(const char* s, std::size_t length)
{
return length != 8 ? throw s :
#if IS_LE_MACHINE == 1
static_cast<std::uint64_t>(to_u8(s[7]) << 24 | to_u8(s[6]) << 16 | to_u8(s[5]) << 8 | to_u8(s[4])) << 32 | to_u8(s[3]) << 24 | to_u8(s[2]) << 16 | to_u8(s[1]) << 8 | to_u8(s[0]);
#endif
}
-90
View File
@@ -1,90 +0,0 @@
#include "Utilities/Semaphore.h"
#include <mutex>
#include <condition_variable>
struct benaphore::internal
{
std::mutex mutex;
std::size_t acq_order{};
std::size_t rel_order{};
std::condition_variable cond;
};
void benaphore::wait_hard()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
// Notify non-zero waiter queue size
if (m_value.exchange(-1) == 1)
{
// Return immediately (acquired)
m_value = 0;
return;
}
// Remember the order
const std::size_t order = ++m_data->acq_order;
// Wait for the appropriate rel_order (TODO)
while (m_data->rel_order < order)
{
m_data->cond.wait(lock);
}
if (order == m_data->acq_order && m_data->acq_order == m_data->rel_order)
{
// Cleaup
m_data->acq_order = 0;
m_data->rel_order = 0;
m_value.compare_and_swap(-1, 0);
}
}
void benaphore::post_hard()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
if (m_value.compare_and_swap(0, 1) != -1)
{
// Do nothing (released)
return;
}
if (m_data->acq_order == m_data->rel_order)
{
m_value = 1;
return;
}
// Awake one thread
m_data->rel_order += 1;
// Unlock and notify
lock.unlock();
m_data->cond.notify_one();
}
void benaphore::initialize_once()
{
if (UNLIKELY(!m_data))
{
auto ptr = new benaphore::internal;
if (!m_data.compare_and_swap_test(nullptr, ptr))
{
delete ptr;
}
}
}
benaphore::~benaphore()
{
delete m_data;
}
-48
View File
@@ -1,48 +0,0 @@
#pragma once
#include "types.h"
#include "Atomic.h"
#include "Platform.h"
// Binary semaphore
class benaphore
{
struct internal;
// Reserved value (-1) enforces *_hard() calls
atomic_t<u32> m_value{};
atomic_t<internal*> m_data{};
void wait_hard();
void post_hard();
public:
constexpr benaphore() = default;
~benaphore();
// Initialize internal data
void initialize_once();
void wait()
{
if (UNLIKELY(!m_value.compare_and_swap_test(1, 0)))
{
wait_hard();
}
}
bool try_wait()
{
return m_value.compare_and_swap_test(1, 0);
}
void post()
{
if (UNLIKELY(!m_value.compare_and_swap_test(0, 1)))
{
post_hard();
}
}
};
-187
View File
@@ -1,187 +0,0 @@
#include "SharedMutex.h"
#include <mutex>
#include <condition_variable>
struct shared_mutex::internal
{
std::mutex mutex;
std::size_t rq_size{}; // Reader queue size (threads waiting on m_rcv)
std::size_t wq_size{}; // Writer queue size (threads waiting on m_wcv and m_ocv)
std::condition_variable rcv; // Reader queue
std::condition_variable wcv; // Writer queue
std::condition_variable ocv; // For current exclusive owner
};
void shared_mutex::lock_shared_hard()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
// Validate
if ((m_ctrl & SM_INVALID_BIT) != 0) throw std::runtime_error("shared_mutex::lock_shared(): Invalid bit");
if ((m_ctrl & SM_READER_MASK) == 0) throw std::runtime_error("shared_mutex::lock_shared(): No readers");
// Notify non-zero reader queue size
m_ctrl |= SM_WAITERS_BIT, m_data->rq_size++;
// Fix excess reader count
if ((--m_ctrl & SM_READER_MASK) == 0 && m_data->wq_size)
{
// Notify exclusive owner
m_data->ocv.notify_one();
}
// Obtain the reader lock
while (true)
{
const auto ctrl = m_ctrl.load();
// Check writers and reader limit
if (m_data->wq_size || (ctrl & ~SM_WAITERS_BIT) >= SM_READER_MAX)
{
m_data->rcv.wait(lock);
continue;
}
if (m_ctrl.compare_and_swap_test(ctrl, ctrl + 1))
{
break;
}
}
if (!--m_data->rq_size && !m_data->wq_size)
{
m_ctrl &= ~SM_WAITERS_BIT;
}
}
void shared_mutex::unlock_shared_notify()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
if ((m_ctrl & SM_READER_MASK) == 0 && m_data->wq_size)
{
// Notify exclusive owner
lock.unlock();
m_data->ocv.notify_one();
}
else if (m_data->rq_size)
{
// Notify other readers
lock.unlock();
m_data->rcv.notify_one();
}
}
void shared_mutex::lock_hard()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
// Validate
if ((m_ctrl & SM_INVALID_BIT) != 0) throw std::runtime_error("shared_mutex::lock(): Invalid bit");
// Notify non-zero writer queue size
m_ctrl |= SM_WAITERS_BIT, m_data->wq_size++;
// Obtain the writer lock
while (true)
{
const auto ctrl = m_ctrl.load();
if (ctrl & SM_WRITER_LOCK)
{
m_data->wcv.wait(lock);
continue;
}
if (m_ctrl.compare_and_swap_test(ctrl, ctrl | SM_WRITER_LOCK))
{
break;
}
}
// Wait for remaining readers
while ((m_ctrl & SM_READER_MASK) != 0)
{
m_data->ocv.wait(lock);
}
if (!--m_data->wq_size && !m_data->rq_size)
{
m_ctrl &= ~SM_WAITERS_BIT;
}
}
void shared_mutex::unlock_notify()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
if (m_data->wq_size)
{
// Notify next exclusive owner
lock.unlock();
m_data->wcv.notify_one();
}
else if (m_data->rq_size)
{
// Notify all readers
lock.unlock();
m_data->rcv.notify_all();
}
}
void shared_mutex::lock_upgrade_hard()
{
unlock_shared();
lock();
}
void shared_mutex::lock_degrade_hard()
{
initialize_once();
std::unique_lock<std::mutex> lock(m_data->mutex);
m_ctrl -= SM_WRITER_LOCK - 1;
if (m_data->rq_size)
{
// Notify all readers
lock.unlock();
m_data->rcv.notify_all();
}
else if (m_data->wq_size)
{
// Notify next exclusive owner
lock.unlock();
m_data->wcv.notify_one();
}
}
void shared_mutex::initialize_once()
{
if (UNLIKELY(!m_data))
{
auto ptr = new shared_mutex::internal;
if (!m_data.compare_and_swap_test(nullptr, ptr))
{
delete ptr;
}
}
}
shared_mutex::~shared_mutex()
{
delete m_data;
}
-180
View File
@@ -1,180 +0,0 @@
#pragma once
#include "types.h"
#include "Atomic.h"
#include "Platform.h"
//! An attempt to create effective implementation of "shared mutex", lock-free in optimistic case.
//! All locking and unlocking may be done by a single LOCK XADD or LOCK CMPXCHG instruction.
//! MSVC implementation of std::shared_timed_mutex seems suboptimal.
//! std::shared_mutex is not available until C++17.
class shared_mutex final
{
enum : u32
{
SM_WRITER_LOCK = 1u << 31, // Exclusive lock flag, must be MSB
SM_WAITERS_BIT = 1u << 30, // Flag set if m_wq_size or m_rq_size is non-zero
SM_INVALID_BIT = 1u << 29, // Unreachable reader count bit (may be set by incorrect unlock_shared() call)
SM_READER_MASK = SM_WAITERS_BIT - 1, // Valid reader count bit mask
SM_READER_MAX = 1u << 24, // Max reader count
};
atomic_t<u32> m_ctrl{}; // Control variable: reader count | SM_* flags
struct internal;
atomic_t<internal*> m_data{}; // Internal data
void lock_shared_hard();
void unlock_shared_notify();
void lock_hard();
void unlock_notify();
void lock_upgrade_hard();
void lock_degrade_hard();
public:
constexpr shared_mutex() = default;
// Initialize internal data
void initialize_once();
~shared_mutex();
bool try_lock_shared()
{
const u32 ctrl = m_ctrl.load();
return ctrl < SM_READER_MAX && m_ctrl.compare_and_swap_test(ctrl, ctrl + 1);
}
void lock_shared()
{
// Optimization: unconditional increment, compensated later
if (UNLIKELY(m_ctrl++ >= SM_READER_MAX))
{
lock_shared_hard();
}
}
void unlock_shared()
{
if (UNLIKELY(m_ctrl-- >= SM_READER_MAX))
{
unlock_shared_notify();
}
}
bool try_lock()
{
return !m_ctrl && m_ctrl.compare_and_swap_test(0, SM_WRITER_LOCK);
}
void lock()
{
if (UNLIKELY(!m_ctrl.compare_and_swap_test(0, SM_WRITER_LOCK)))
{
lock_hard();
}
}
void unlock()
{
m_ctrl &= ~SM_WRITER_LOCK;
if (UNLIKELY(m_ctrl))
{
unlock_notify();
}
}
bool try_lock_upgrade()
{
return m_ctrl == 1 && m_ctrl.compare_and_swap_test(1, SM_WRITER_LOCK);
}
bool try_lock_degrade()
{
return m_ctrl == SM_WRITER_LOCK && m_ctrl.compare_and_swap_test(SM_WRITER_LOCK, 1);
}
void lock_upgrade()
{
if (UNLIKELY(!m_ctrl.compare_and_swap_test(1, SM_WRITER_LOCK)))
{
lock_upgrade_hard();
}
}
void lock_degrade()
{
if (UNLIKELY(!m_ctrl.compare_and_swap_test(SM_WRITER_LOCK, 1)))
{
lock_degrade_hard();
}
}
};
//! Simplified shared (reader) lock implementation.
//! std::shared_lock may be used instead if necessary.
class reader_lock final
{
shared_mutex& m_mutex;
public:
reader_lock(const reader_lock&) = delete;
reader_lock(shared_mutex& mutex)
: m_mutex(mutex)
{
m_mutex.lock_shared();
}
~reader_lock()
{
m_mutex.unlock_shared();
}
};
//! Simplified exclusive (writer) lock implementation.
//! std::lock_guard may or std::unique_lock be used instead if necessary.
class writer_lock final
{
shared_mutex& m_mutex;
public:
writer_lock(const writer_lock&) = delete;
writer_lock(shared_mutex& mutex)
: m_mutex(mutex)
{
m_mutex.lock();
}
~writer_lock()
{
m_mutex.unlock();
}
};
// Exclusive (writer) lock in the scope of shared (reader) lock.
class upgraded_lock final
{
shared_mutex& m_mutex;
public:
upgraded_lock(const writer_lock&) = delete;
upgraded_lock(shared_mutex& mutex)
: m_mutex(mutex)
{
m_mutex.lock_upgrade();
}
~upgraded_lock()
{
m_mutex.lock_degrade();
}
};
-85
View File
@@ -1,85 +0,0 @@
#pragma once
#include <deque>
// Tag used in sleep_entry<> constructor
static struct defer_sleep_tag {} constexpr defer_sleep{};
// Define sleep queue as std::deque with T* pointers, T - thread type
template<typename T> using sleep_queue = std::deque<T*>;
// Automatic object handling a thread pointer (T*) in the sleep queue
// Sleep is called in the constructor (if not null)
// Awake is called in the destructor (if not null)
// Sleep queue is actually std::deque with pointers, be careful about the lifetime
template<typename T, void(T::*Sleep)() = &T::sleep, void(T::*Awake)() = &T::awake>
class sleep_entry final
{
sleep_queue<T>& m_queue;
T& m_thread;
public:
// Constructor; enter() not called
sleep_entry(sleep_queue<T>& queue, T& entry, const defer_sleep_tag&)
: m_queue(queue)
, m_thread(entry)
{
if (Sleep) (m_thread.*Sleep)();
}
// Constructor; calls enter()
sleep_entry(sleep_queue<T>& queue, T& entry)
: sleep_entry(queue, entry, defer_sleep)
{
enter();
}
// Destructor; calls leave()
~sleep_entry()
{
leave();
if (Awake) (m_thread.*Awake)();
}
// Add thread to the sleep queue
void enter()
{
for (auto t : m_queue)
{
if (t == &m_thread)
{
// Already exists, is it an error?
return;
}
}
m_queue.emplace_back(&m_thread);
}
// Remove thread from the sleep queue
void leave()
{
for (auto it = m_queue.begin(), end = m_queue.end(); it != end; it++)
{
if (*it == &m_thread)
{
m_queue.erase(it);
return;
}
}
}
// Check whether the thread exists in the sleep queue
explicit operator bool() const
{
for (auto it = m_queue.begin(), end = m_queue.end(); it != end; it++)
{
if (*it == &m_thread)
{
return true;
}
}
return false;
}
};
+291 -59
View File
@@ -1,73 +1,305 @@
#include "StrFmt.h"
#include "BEType.h"
#include "StrUtil.h"
#include "cfmt.h"
#include <cassert>
#include <array>
#include <memory>
#include <algorithm>
std::string v128::to_hex() const
#ifdef _WIN32
#include <Windows.h>
#else
#include <errno.h>
#endif
template <>
void fmt_class_string<std::pair<const fmt_type_info*, u64>>::format(std::string& out, u64 arg)
{
return fmt::format("%016llx%016llx", _u64[1], _u64[0]);
}
// Dynamic format arg
const auto& pair = get_object(arg);
std::string v128::to_xyzw() const
{
return fmt::format("x: %g y: %g z: %g w: %g", _f[3], _f[2], _f[1], _f[0]);
}
std::string fmt::unsafe_vformat(const char* fmt, va_list _args) noexcept
{
// Fixed stack buffer for the first attempt
std::array<char, 4096> fixed_buf;
// Possibly dynamically allocated buffer for the second attempt
std::unique_ptr<char[]> buf;
// Pointer to the current buffer
char* buf_addr = fixed_buf.data();
for (std::size_t buf_size = fixed_buf.size();;)
if (pair.first)
{
va_list args;
va_copy(args, _args);
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"
#endif
const std::size_t len = std::vsnprintf(buf_addr, buf_size, fmt, args);
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
va_end(args);
assert(len <= INT_MAX);
if (len < buf_size)
{
return{ buf_addr, len };
}
buf.reset(buf_addr = new char[buf_size = len + 1]);
pair.first->fmt_string(out, pair.second);
}
}
std::string fmt::unsafe_format(const char* fmt...) noexcept
void fmt_class_string<const void*>::format(std::string& out, u64 arg)
{
va_list args;
va_start(args, fmt);
auto result = unsafe_vformat(fmt, args);
va_end(args);
return result;
if (arg)
{
fmt::append(out, "%p", reinterpret_cast<const void*>(static_cast<std::uintptr_t>(arg)));
}
else
{
out += "(NULL)";
}
}
fmt::exception_base::exception_base(const char* fmt...)
: std::runtime_error((va_start(m_args, fmt), unsafe_vformat(fmt, m_args)))
void fmt_class_string<const char*>::format(std::string& out, u64 arg)
{
va_end(m_args);
if (arg)
{
out += reinterpret_cast<const char*>(static_cast<std::uintptr_t>(arg));
}
else
{
out += "(NULL)";
}
}
template <>
void fmt_class_string<std::string>::format(std::string& out, u64 arg)
{
out += get_object(arg).c_str(); // TODO?
}
template <>
void fmt_class_string<std::vector<char>>::format(std::string& out, u64 arg)
{
const std::vector<char>& obj = get_object(arg);
out.append(obj.cbegin(), obj.cend());
}
template <>
void fmt_class_string<char>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#hhx", static_cast<char>(arg));
}
template <>
void fmt_class_string<uchar>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#hhx", static_cast<uchar>(arg));
}
template <>
void fmt_class_string<schar>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#hhx", static_cast<schar>(arg));
}
template <>
void fmt_class_string<short>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#hx", static_cast<short>(arg));
}
template <>
void fmt_class_string<ushort>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#hx", static_cast<ushort>(arg));
}
template <>
void fmt_class_string<int>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#x", static_cast<int>(arg));
}
template <>
void fmt_class_string<uint>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#x", static_cast<uint>(arg));
}
template <>
void fmt_class_string<long>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#lx", static_cast<long>(arg));
}
template <>
void fmt_class_string<ulong>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#lx", static_cast<ulong>(arg));
}
template <>
void fmt_class_string<llong>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#llx", static_cast<llong>(arg));
}
template <>
void fmt_class_string<ullong>::format(std::string& out, u64 arg)
{
fmt::append(out, "%#llx", static_cast<ullong>(arg));
}
template <>
void fmt_class_string<float>::format(std::string& out, u64 arg)
{
fmt::append(out, "%gf", static_cast<float>(reinterpret_cast<f64&>(arg)));
}
template <>
void fmt_class_string<double>::format(std::string& out, u64 arg)
{
fmt::append(out, "%g", reinterpret_cast<f64&>(arg));
}
template <>
void fmt_class_string<bool>::format(std::string& out, u64 arg)
{
out += arg ? "true" : "false";
}
template <>
void fmt_class_string<v128>::format(std::string& out, u64 arg)
{
const v128& vec = get_object(arg);
fmt::append(out, "0x%016llx%016llx", vec._u64[1], vec._u64[0]);
}
namespace fmt
{
void raw_error(const char* msg)
{
throw std::runtime_error{msg};
}
void raw_verify_error(const char* msg, const fmt_type_info* sup, u64 arg)
{
std::string out{"Verification failed"};
// Print error code (may be irrelevant)
#ifdef _WIN32
if (DWORD error = GetLastError())
{
fmt::append(out, " (e=%#x)", error);
}
#else
if (int error = errno)
{
fmt::append(out, " (e=%d)", error);
}
#endif
if (sup)
{
out += " (";
sup->fmt_string(out, arg); // Print value
out += ")";
}
if (msg)
{
out += ": ";
out += msg;
}
throw std::runtime_error{out};
}
void raw_narrow_error(const char* msg, const fmt_type_info* sup, u64 arg)
{
std::string out{"Narrow error"};
if (sup)
{
out += " (";
sup->fmt_string(out, arg); // Print value
out += ")";
}
if (msg)
{
out += ": ";
out += msg;
}
throw std::range_error{out};
}
// Hidden template
template <typename T>
void raw_throw_exception(const char* fmt, const fmt_type_info* sup, const u64* args)
{
std::string out;
raw_append(out, fmt, sup, args);
throw T{out};
}
// Explicit instantiations (not exhaustive)
template void raw_throw_exception<std::runtime_error>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::logic_error>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::domain_error>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::invalid_argument>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::out_of_range>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::range_error>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::overflow_error>(const char*, const fmt_type_info*, const u64*);
template void raw_throw_exception<std::underflow_error>(const char*, const fmt_type_info*, const u64*);
struct cfmt_src;
}
// Temporary implementation
struct fmt::cfmt_src
{
const fmt_type_info* sup;
const u64* args;
bool test(std::size_t index) const
{
if (!sup[index].fmt_string)
{
return false;
}
return true;
}
template <typename T>
T get(std::size_t index) const
{
return *reinterpret_cast<const T*>(reinterpret_cast<const u8*>(args + index));
}
void skip(std::size_t extra)
{
sup += extra + 1;
args += extra + 1;
}
std::size_t fmt_string(std::string& out, std::size_t extra) const
{
const std::size_t start = out.size();
sup[extra].fmt_string(out, args[extra]);
return out.size() - start;
}
// Returns type size (0 if unknown, pointer, unsigned, assumed max)
std::size_t type(std::size_t extra) const
{
// Hack: use known function pointers to determine type
#define TYPE(type) \
if (sup[extra].fmt_string == &fmt_class_string<type>::format) return sizeof(type);
TYPE(int);
TYPE(llong);
TYPE(schar);
TYPE(short);
if (std::is_signed<char>::value) TYPE(char);
TYPE(long);
#undef TYPE
return 0;
}
static constexpr std::size_t size_char = 1;
static constexpr std::size_t size_short = 2;
static constexpr std::size_t size_int = 0;
static constexpr std::size_t size_long = sizeof(ulong);
static constexpr std::size_t size_llong = sizeof(ullong);
static constexpr std::size_t size_size = sizeof(std::size_t);
static constexpr std::size_t size_max = sizeof(std::uintmax_t);
static constexpr std::size_t size_diff = sizeof(std::ptrdiff_t);
};
void fmt::raw_append(std::string& out, const char* fmt, const fmt_type_info* sup, const u64* args) noexcept
{
cfmt_append(out, fmt, cfmt_src{sup, args});
}
std::string fmt::replace_first(const std::string& src, const std::string& from, const std::string& to)
@@ -82,7 +314,7 @@ std::string fmt::replace_first(const std::string& src, const std::string& from,
return (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
}
std::string fmt::replace_all(const std::string &src, const std::string& from, const std::string& to)
std::string fmt::replace_all(const std::string& src, const std::string& from, const std::string& to)
{
std::string target = src;
for (auto pos = target.find(from); pos != std::string::npos; pos = target.find(from, pos + 1))
@@ -102,7 +334,7 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
for (size_t cursor_end = 0; cursor_end < source.length(); ++cursor_end)
{
for (auto &separator : separators)
for (auto& separator : separators)
{
if (strncmp(source.c_str() + cursor_end, separator.c_str(), separator.length()) == 0)
{
@@ -111,7 +343,7 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
result.push_back(candidate);
cursor_begin = cursor_end + separator.length();
cursor_end = cursor_begin - 1;
cursor_end = cursor_begin - 1;
break;
}
}
@@ -130,7 +362,7 @@ std::string fmt::trim(const std::string& source, const std::string& values)
std::size_t begin = source.find_first_not_of(values);
if (begin == source.npos)
return{};
return {};
return source.substr(begin, source.find_last_not_of(values) + 1);
}
@@ -143,7 +375,7 @@ std::string fmt::to_upper(const std::string& string)
return result;
}
bool fmt::match(const std::string &source, const std::string &mask)
bool fmt::match(const std::string& source, const std::string& mask)
{
std::size_t source_position = 0, mask_position = 0;
+271 -32
View File
@@ -1,52 +1,291 @@
#pragma once
#include <cstdarg>
#include <exception>
#include <string>
#include "Platform.h"
#include "types.h"
#include <exception>
#include <stdexcept>
#include <string>
namespace fmt
{
std::string unsafe_format(const char* fmt...) noexcept;
std::string unsafe_vformat(const char*, va_list) noexcept;
template <typename... Args>
static std::string format(const char*, const Args&...);
}
// Formatting function
template<typename... Args>
inline std::string format(const char* fmt, const Args&... args)
template <typename T, typename>
struct fmt_unveil
{
static_assert(sizeof(T) > 0, "fmt_unveil<> error: incomplete type");
using type = T;
static inline u64 get(const T& arg)
{
return unsafe_format(fmt, ::unveil<Args>::get(args)...);
return reinterpret_cast<std::uintptr_t>(&arg);
}
// Helper class
class exception_base : public std::runtime_error
// Temporary value container (can possibly be created by other fmt_unveil<> specializations)
struct u64_wrapper
{
// Helper (there is no other room)
va_list m_args;
T arg;
protected:
// Internal formatting constructor
exception_base(const char* fmt...);
};
// Exception type derived from std::runtime_error with formatting constructor
class exception : public exception_base
{
public:
template<typename... Args>
exception(const char* fmt, const Args&... args)
: exception_base(fmt, ::unveil<Args>::get(args)...)
// Allow implicit conversion
operator u64() const
{
return reinterpret_cast<std::uintptr_t>(&arg);
}
};
// Narrow cast (similar to gsl::narrow) with exception message formatting
template<typename To, typename From, typename... Args>
inline auto narrow(const char* format_str, const From& value, const Args&... args) -> decltype(static_cast<To>(static_cast<From>(std::declval<To>())))
// This overload resolution takes the precedence
static inline u64_wrapper get(T&& arg)
{
const auto result = static_cast<To>(value);
if (static_cast<From>(result) != value) throw fmt::exception(format_str, value, args...);
return u64_wrapper{std::move(arg)};
}
};
template <typename T>
struct fmt_unveil<T, std::enable_if_t<std::is_integral<T>::value && sizeof(T) <= 8 && alignof(T) <= 8>>
{
using type = T;
static inline u64 get(T arg)
{
return static_cast<T>(arg);
}
};
template <typename T>
struct fmt_unveil<T, std::enable_if_t<std::is_floating_point<T>::value && sizeof(T) <= 8 && alignof(T) <= 8>>
{
using type = T;
// Convert FP to f64 and reinterpret as u64
static inline u64 get(const f64& arg)
{
return *reinterpret_cast<const u64*>(reinterpret_cast<const u8*>(&arg));
}
};
template <>
struct fmt_unveil<f16, void>
{
using type = f16;
static inline u64 get(const f16& arg)
{
return fmt_unveil<f64>::get(arg.operator float());
}
};
template <typename T>
struct fmt_unveil<T, std::enable_if_t<std::is_enum<T>::value>>
{
using type = T;
static inline u64 get(T arg)
{
return static_cast<std::underlying_type_t<T>>(arg);
}
};
template <typename T>
struct fmt_unveil<T*, void>
{
using type = const T*;
static inline u64 get(const T* arg)
{
return reinterpret_cast<std::uintptr_t>(arg);
}
};
template <typename T, std::size_t N>
struct fmt_unveil<T[N], void>
{
using type = const T*;
static inline u64 get(const T* arg)
{
return reinterpret_cast<std::uintptr_t>(arg);
}
};
template <>
struct fmt_unveil<b8, void>
{
using type = bool;
static inline u64 get(const b8& value)
{
return fmt_unveil<bool>::get(value);
}
};
// String type format provider, also type classifier (format() called if an argument is formatted as "%s")
template <typename T, typename = void>
struct fmt_class_string
{
// Formatting function (must be explicitly specialized)
static void format(std::string& out, u64 arg);
// Helper typedef (visible in format())
using type = T;
// Helper function (converts arg to object reference)
static SAFE_BUFFERS FORCE_INLINE const T& get_object(u64 arg)
{
return *reinterpret_cast<const T*>(static_cast<std::uintptr_t>(arg));
}
// Enum -> string function type
using convert_t = const char*(*)(T value);
// Enum -> string function registered
static convert_t convert_enum;
// Helper function (safely converts arg to enum value)
static SAFE_BUFFERS FORCE_INLINE void format_enum(std::string& out, u64 arg, convert_t convert)
{
// Save convert function
if (convert_enum == nullptr)
{
convert_enum = convert;
}
const auto value = static_cast<std::underlying_type_t<T>>(arg);
// Check narrowing
if (static_cast<u64>(value) == arg)
{
if (const char* str = convert(static_cast<T>(value)))
{
out += str;
return;
}
}
// Fallback to underlying type formatting
fmt_class_string<std::underlying_type_t<T>>::format(out, static_cast<u64>(value));
}
// Helper function (bitset formatting)
static SAFE_BUFFERS FORCE_INLINE void format_bitset(std::string& out, u64 arg, const char* prefix, const char* delim, const char* suffix, void (*fmt)(std::string&, u64))
{
// Start from raw value
fmt_class_string<u64>::format(out, arg);
out += prefix;
for (u64 i = 0; i < 63; i++)
{
const u64 mask = 1ull << i;
if (arg & mask)
{
fmt(out, i);
if (arg >> (i + 1))
{
out += delim;
}
}
}
if (arg & (1ull << 63))
{
fmt(out, 63);
}
out += suffix;
}
// Helper constant (may be used in format_enum as lambda return value)
static constexpr const char* unknown = nullptr;
};
template <typename T, typename V>
const char*(*fmt_class_string<T, V>::convert_enum)(T) = nullptr;
template <>
struct fmt_class_string<const void*, void>
{
static void format(std::string& out, u64 arg);
};
template <typename T>
struct fmt_class_string<T*, void> : fmt_class_string<const void*, void>
{
// Classify all pointers as const void*
};
template <>
struct fmt_class_string<const char*, void>
{
static void format(std::string& out, u64 arg);
};
template <>
struct fmt_class_string<char*, void> : fmt_class_string<const char*>
{
// Classify char* as const char*
};
struct fmt_type_info
{
decltype(&fmt_class_string<int>::format) fmt_string;
template <typename T>
static constexpr fmt_type_info make()
{
return fmt_type_info
{
&fmt_class_string<T>::format,
};
}
};
// Argument array type (each element generated via fmt_unveil<>)
template <typename... Args>
using fmt_args_t = const u64(&&)[sizeof...(Args) + 1];
namespace fmt
{
template <typename... Args>
SAFE_BUFFERS FORCE_INLINE const fmt_type_info* get_type_info()
{
// Constantly initialized null-terminated list of type-specific information
static constexpr fmt_type_info result[sizeof...(Args) + 1]{fmt_type_info::make<Args>()...};
return result;
}
// Internal formatting function
void raw_append(std::string& out, const char*, const fmt_type_info*, const u64*) noexcept;
// Formatting function
template <typename... Args>
SAFE_BUFFERS FORCE_INLINE void append(std::string& out, const char* fmt, const Args&... args)
{
raw_append(out, fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
// Formatting function
template <typename... Args>
SAFE_BUFFERS FORCE_INLINE std::string format(const char* fmt, const Args&... args)
{
std::string result;
append<Args...>(result, fmt, args...);
return result;
}
// Internal exception message formatting template, must be explicitly specialized or instantiated in cpp to minimize code bloat
template <typename T>
[[noreturn]] void raw_throw_exception(const char*, const fmt_type_info*, const u64*);
// Throw exception with formatting
template <typename T = std::runtime_error, typename... Args>
[[noreturn]] SAFE_BUFFERS FORCE_INLINE void throw_exception(const char* fmt, const Args&... args)
{
raw_throw_exception<T>(fmt, fmt::get_type_info<fmt_unveil_t<Args>...>(), fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
}
+17 -17
View File
@@ -7,8 +7,8 @@
#include <functional>
// Copy null-terminated string from std::string to char array with truncation
template<std::size_t N>
inline void strcpy_trunc(char(&dst)[N], const std::string& src)
template <std::size_t N>
inline void strcpy_trunc(char (&dst)[N], const std::string& src)
{
const std::size_t count = src.size() >= N ? N - 1 : src.size();
std::memcpy(dst, src.c_str(), count);
@@ -16,8 +16,8 @@ inline void strcpy_trunc(char(&dst)[N], const std::string& src)
}
// Copy null-terminated string from char array to another char array with truncation
template<std::size_t N, std::size_t N2>
inline void strcpy_trunc(char(&dst)[N], const char(&src)[N2])
template <std::size_t N, std::size_t N2>
inline void strcpy_trunc(char (&dst)[N], const char (&src)[N2])
{
const std::size_t count = N2 >= N ? N - 1 : N2;
std::memcpy(dst, src, count);
@@ -27,10 +27,10 @@ inline void strcpy_trunc(char(&dst)[N], const char(&src)[N2])
namespace fmt
{
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
std::string replace_all(const std::string &src, const std::string& from, const std::string& to);
std::string replace_all(const std::string& src, const std::string& from, const std::string& to);
template<size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::string>(&list)[list_size])
template <size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::string> (&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
{
@@ -53,8 +53,8 @@ namespace fmt
return src;
}
template<size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::function<std::string()>>(&list)[list_size])
template <size_t list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::function<std::string()>> (&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
{
@@ -80,17 +80,17 @@ namespace fmt
std::vector<std::string> split(const std::string& source, std::initializer_list<std::string> separators, bool is_skip_empty = true);
std::string trim(const std::string& source, const std::string& values = " \t");
template<typename T>
template <typename T>
std::string merge(const T& source, const std::string& separator)
{
if (!source.size())
{
return{};
return {};
}
std::string result;
auto it = source.begin();
auto it = source.begin();
auto end = source.end();
for (--end; it != end; ++it)
{
@@ -100,23 +100,23 @@ namespace fmt
return result + source.back();
}
template<typename T>
template <typename T>
std::string merge(std::initializer_list<T> sources, const std::string& separator)
{
if (!sources.size())
{
return{};
return {};
}
std::string result;
bool first = true;
for (auto &v : sources)
for (auto& v : sources)
{
if (first)
{
result = fmt::merge(v, separator);
first = false;
first = false;
}
else
{
@@ -129,5 +129,5 @@ namespace fmt
std::string to_upper(const std::string& string);
bool match(const std::string &source, const std::string &mask);
bool match(const std::string& source, const std::string& mask);
}
+632 -701
View File
File diff suppressed because it is too large Load Diff
+113 -165
View File
@@ -1,11 +1,14 @@
#pragma once
#include "types.h"
#include "Atomic.h"
#include <exception>
#include <string>
#include <memory>
#include "Platform.h"
#include "Atomic.h"
#include "sema.h"
#include "cond.h"
// Will report exception and call std::abort() if put in catch(...)
[[noreturn]] void catch_all_exceptions();
@@ -17,19 +20,19 @@ class task_stack
{
std::unique_ptr<task_base> next;
virtual ~task_base() = default;
virtual ~task_base();
virtual void exec()
virtual void invoke()
{
if (next)
{
next->exec();
next->invoke();
}
}
};
template<typename F>
struct task_type : task_base
template <typename F>
struct task_type final : task_base
{
std::remove_reference_t<F> func;
@@ -38,10 +41,10 @@ class task_stack
{
}
void exec() override
void invoke() final override
{
func();
task_base::exec();
task_base::invoke();
}
};
@@ -50,7 +53,7 @@ class task_stack
public:
task_stack() = default;
template<typename F>
template <typename F>
task_stack(F&& func)
: m_stack(new task_type<F>(std::forward<F>(func)))
{
@@ -70,11 +73,11 @@ public:
m_stack.reset();
}
void exec() const
void invoke() const
{
if (m_stack)
{
m_stack->exec();
m_stack->invoke();
}
}
};
@@ -82,20 +85,32 @@ public:
// Thread control class
class thread_ctrl final
{
public: // TODO
struct internal;
private:
// Current thread
static thread_local thread_ctrl* g_tls_this_thread;
// Thread handle storage
std::aligned_storage_t<16> m_thread;
// Self pointer
std::shared_ptr<thread_ctrl> m_self;
// Thread join contention counter
atomic_t<u32> m_joining{};
// Thread handle (platform-specific)
atomic_t<std::uintptr_t> m_thread{0};
// Thread internals
atomic_t<internal*> m_data{};
// Thread mutex
mutable semaphore<> m_mutex;
// Thread condition variable
cond_variable m_cond;
// Thread flags
atomic_t<u32> m_signal{0};
// Thread joining condition variable
cond_variable m_jcv;
// Remotely set or caught exception
std::exception_ptr m_exception;
// Thread initial task or atexit task
task_stack m_task;
// Fixed name
std::string m_name;
@@ -107,19 +122,19 @@ private:
void initialize();
// Called at the thread end
void finalize() noexcept;
void finalize(std::exception_ptr) noexcept;
// Get atexit function
void push_atexit(task_stack);
// Add task (atexit)
static void _push(task_stack);
// Start waiting
void wait_start(u64 timeout);
// Internal waiting function, may throw. Infinite value is -1.
static bool _wait_for(u64 usec);
// Proceed waiting
bool wait_wait(u64 timeout);
// Internal throwing function. Mutex must be locked and will be unlocked.
[[noreturn]] void _throw();
// Check exception
void test();
// Internal notification function
void _notify(cond_variable thread_ctrl::*);
public:
thread_ctrl(std::string&& name);
@@ -134,120 +149,57 @@ public:
return m_name;
}
// Initialize internal data
void initialize_once();
// Get exception
std::exception_ptr get_exception() const;
// Set exception
void set_exception(std::exception_ptr ptr);
// Get thread result (may throw, simultaneous joining allowed)
void join();
// Lock thread mutex
void lock();
// Lock conditionally (double-checked)
template<typename F>
bool lock_if(F&& pred)
{
if (pred())
{
lock();
try
{
if (LIKELY(pred()))
{
return true;
}
else
{
unlock();
return false;
}
}
catch (...)
{
unlock();
throw;
}
}
else
{
return false;
}
}
// Unlock thread mutex (internal data must be initialized)
void unlock();
// Lock, unlock, notify the thread (required if the condition changed locklessly)
void lock_notify();
// Notify the thread (internal data must be initialized)
// Notify the thread
void notify();
// Set exception (internal data must be initialized, thread mutex must be locked)
void set_exception(std::exception_ptr);
// Current thread sleeps for specified amount of microseconds.
// Wrapper for std::this_thread::sleep, doesn't require valid thread_ctrl.
[[deprecated]] static void sleep(u64 useconds);
// Wait until pred(). Abortable, may throw. Thread must be locked.
// Timeout in microseconds (zero means infinite).
template<typename F>
static inline auto wait(u64 useconds, F&& pred)
// Wait once with timeout. Abortable, may throw. May spuriously return false.
static inline bool wait_for(u64 usec)
{
g_tls_this_thread->wait_start(useconds);
while (true)
{
g_tls_this_thread->test();
if (auto&& result = pred())
{
return result;
}
else if (!g_tls_this_thread->wait_wait(useconds) && useconds)
{
return result;
}
}
return _wait_for(usec);
}
// Wait until pred(). Abortable, may throw. Thread must be locked.
template<typename F>
static inline auto wait(F&& pred)
{
while (true)
{
g_tls_this_thread->test();
if (auto&& result = pred())
{
return result;
}
g_tls_this_thread->wait_wait(0);
}
}
// Wait once. Thread must be locked.
// Wait. Abortable, may throw.
static inline void wait()
{
g_tls_this_thread->test();
g_tls_this_thread->wait_wait(0);
g_tls_this_thread->test();
_wait_for(-1);
}
// Wait unconditionally until aborted. Thread must be locked.
// Wait until pred(). Abortable, may throw.
template<typename F, typename RT = std::result_of_t<F()>>
static inline RT wait(F&& pred)
{
while (true)
{
if (RT result = pred())
{
return result;
}
_wait_for(-1);
}
}
// Wait eternally until aborted.
[[noreturn]] static inline void eternalize()
{
while (true)
{
g_tls_this_thread->test();
g_tls_this_thread->wait_wait(0);
_wait_for(-1);
}
}
// Test exception (may throw).
static void test();
// Get current thread (may be nullptr)
static thread_ctrl* get_current()
{
@@ -258,22 +210,32 @@ public:
template<typename F>
static inline void atexit(F&& func)
{
return g_tls_this_thread->push_atexit(std::forward<F>(func));
_push(std::forward<F>(func));
}
// Create detached named thread
template<typename N, typename F>
static inline void spawn(N&& name, F&& func)
{
auto out = std::make_shared<thread_ctrl>(std::forward<N>(name));
thread_ctrl::start(out, std::forward<F>(func));
}
// Named thread factory
template<typename N, typename F>
static inline std::shared_ptr<thread_ctrl> spawn(N&& name, F&& func)
static inline void spawn(std::shared_ptr<thread_ctrl>& out, N&& name, F&& func)
{
auto ctrl = std::make_shared<thread_ctrl>(std::forward<N>(name));
out = std::make_shared<thread_ctrl>(std::forward<N>(name));
thread_ctrl::start(ctrl, std::forward<F>(func));
return ctrl;
thread_ctrl::start(out, std::forward<F>(func));
}
static void set_native_priority(int priority);
static void set_ideal_processor_core(int core);
};
class named_thread : public std::enable_shared_from_this<named_thread>
class named_thread
{
// Pointer to managed resource (shared with actual thread)
std::shared_ptr<thread_ctrl> m_thread;
@@ -290,8 +252,8 @@ public:
virtual std::string get_name() const;
protected:
// Start thread (cannot be called from the constructor: should throw bad_weak_ptr in such case)
void start();
// Start thread (cannot be called from the constructor: should throw in such case)
void start_thread(const std::shared_ptr<void>& _this);
// Thread task (called in the thread)
virtual void on_task() = 0;
@@ -299,11 +261,14 @@ protected:
// Thread finalization (called after on_task)
virtual void on_exit() {}
// Called once upon thread spawn within the thread's own context
virtual void on_spawn() {}
public:
// ID initialization
virtual void on_init()
virtual void on_init(const std::shared_ptr<void>& _this)
{
start();
return start_thread(_this);
}
// ID finalization
@@ -313,42 +278,19 @@ public:
}
// Access thread_ctrl
thread_ctrl* operator->() const
thread_ctrl* get() const
{
return m_thread.get();
}
};
// Simple thread mutex locker
class thread_lock final
{
thread_ctrl* m_thread;
public:
thread_lock(const thread_lock&) = delete;
// Lock specified thread
thread_lock(thread_ctrl* thread)
: m_thread(thread)
void join() const
{
m_thread->lock();
return m_thread->join();
}
// Lock specified named_thread
thread_lock(named_thread& thread)
: thread_lock(thread.operator->())
void notify() const
{
}
// Lock current thread
thread_lock()
: thread_lock(thread_ctrl::get_current())
{
}
~thread_lock()
{
m_thread->unlock();
return m_thread->notify();
}
};
@@ -360,8 +302,8 @@ class scope_thread final
public:
template<typename N, typename F>
scope_thread(N&& name, F&& func)
: m_thread(thread_ctrl::spawn(std::forward<N>(name), std::forward<F>(func)))
{
thread_ctrl::spawn(m_thread, std::forward<N>(name), std::forward<F>(func));
}
// Deleted copy/move constructors + copy/move operators
@@ -372,4 +314,10 @@ public:
{
m_thread->join();
}
// Access thread_ctrl
thread_ctrl* get() const
{
return m_thread.get();
}
};
+6 -6
View File
@@ -6,8 +6,8 @@ class Timer
{
private:
bool m_stopped;
std::chrono::high_resolution_clock::time_point m_start;
std::chrono::high_resolution_clock::time_point m_end;
std::chrono::steady_clock::time_point m_start;
std::chrono::steady_clock::time_point m_end;
public:
Timer() : m_stopped(false)
@@ -17,13 +17,13 @@ public:
void Start()
{
m_stopped = false;
m_start = std::chrono::high_resolution_clock::now();
m_start = std::chrono::steady_clock::now();
}
void Stop()
{
m_stopped = true;
m_end = std::chrono::high_resolution_clock::now();
m_end = std::chrono::steady_clock::now();
}
double GetElapsedTimeInSec() const
@@ -38,14 +38,14 @@ public:
u64 GetElapsedTimeInMicroSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count();
}
u64 GetElapsedTimeInNanoSec() const
{
std::chrono::high_resolution_clock::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock::now();
std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now();
return std::chrono::duration_cast<std::chrono::nanoseconds>(now - m_start).count();
}
+56 -13
View File
@@ -11,35 +11,78 @@
#include <sys/types.h>
#endif
namespace memory_helper
namespace utils
{
void* reserve_memory(size_t size)
// Convert memory protection (internal)
static auto operator +(protection prot)
{
#ifdef _WIN32
void* ret = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
ENSURES(ret != NULL);
DWORD _prot = PAGE_NOACCESS;
switch (prot)
{
case protection::rw: _prot = PAGE_READWRITE; break;
case protection::ro: _prot = PAGE_READONLY; break;
case protection::no: break;
case protection::wx: _prot = PAGE_EXECUTE_READWRITE; break;
case protection::rx: _prot = PAGE_EXECUTE_READ; break;
}
#else
void* ret = mmap(nullptr, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
ENSURES(ret != 0);
int _prot = PROT_NONE;
switch (prot)
{
case protection::rw: _prot = PROT_READ | PROT_WRITE; break;
case protection::ro: _prot = PROT_READ; break;
case protection::no: break;
case protection::wx: _prot = PROT_READ | PROT_WRITE | PROT_EXEC; break;
case protection::rx: _prot = PROT_READ | PROT_EXEC; break;
}
#endif
return ret;
return _prot;
}
void commit_page_memory(void* pointer, size_t size)
void* memory_reserve(std::size_t size, void* use_addr)
{
#ifdef _WIN32
VERIFY(VirtualAlloc(pointer, size, MEM_COMMIT, PAGE_READWRITE) != NULL);
return ::VirtualAlloc(use_addr, size, MEM_RESERVE, PAGE_NOACCESS);
#else
VERIFY(mprotect((void*)((u64)pointer & -4096), size, PROT_READ | PROT_WRITE) != -1);
auto ptr = ::mmap(use_addr, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
if (use_addr && ptr != use_addr)
{
::munmap(ptr, size);
return nullptr;
}
return ptr;
#endif
}
void free_reserved_memory(void* pointer, size_t size)
void memory_commit(void* pointer, std::size_t size, protection prot)
{
#ifdef _WIN32
VERIFY(VirtualFree(pointer, 0, MEM_DECOMMIT) != 0);
verify(HERE), ::VirtualAlloc(pointer, size, MEM_COMMIT, +prot);
#else
VERIFY(mprotect(pointer, size, PROT_NONE) != -1);
verify(HERE), ::mprotect((void*)((u64)pointer & -4096), ::align(size, 4096), +prot) != -1;
#endif
}
void memory_decommit(void* pointer, std::size_t size)
{
#ifdef _WIN32
verify(HERE), ::VirtualFree(pointer, size, MEM_DECOMMIT);
#else
verify(HERE), ::mmap(pointer, size, PROT_NONE, MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
#endif
}
void memory_protect(void* pointer, std::size_t size, protection prot)
{
#ifdef _WIN32
DWORD old;
verify(HERE), ::VirtualProtect(pointer, size, +prot, &old);
#else
verify(HERE), ::mprotect((void*)((u64)pointer & -4096), ::align(size, 4096), +prot) != -1;
#endif
}
}
+17 -4
View File
@@ -1,22 +1,35 @@
#pragma once
namespace memory_helper
namespace utils
{
// Memory protection type
enum class protection
{
rw, // Read + write (default)
ro, // Read only
no, // No access
wx, // Read + write + execute
rx, // Read + execute
};
/**
* Reserve `size` bytes of virtual memory and returns it.
* The memory should be commited before usage.
*/
void* reserve_memory(std::size_t size);
void* memory_reserve(std::size_t size, void* use_addr = nullptr);
/**
* Commit `size` bytes of virtual memory starting at pointer.
* That is, bake reserved memory with physical memory.
* pointer should belong to a range of reserved memory.
*/
void commit_page_memory(void* pointer, std::size_t size);
void memory_commit(void* pointer, std::size_t size, protection prot = protection::rw);
/**
* Decommit all memory committed via commit_page_memory.
*/
void free_reserved_memory(void* pointer, std::size_t size);
void memory_decommit(void* pointer, std::size_t size);
// Set memory protection
void memory_protect(void* pointer, std::size_t size, protection prot);
}
+165
View File
@@ -0,0 +1,165 @@
#include "bin_patch.h"
#include "yaml-cpp/yaml.h"
#include "File.h"
#include "Config.h"
template <>
void fmt_class_string<patch_type>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](patch_type value)
{
switch (value)
{
case patch_type::load: return "load";
case patch_type::byte: return "byte";
case patch_type::le16: return "le16";
case patch_type::le32: return "le32";
case patch_type::le64: return "le64";
case patch_type::bef32: return "bef32";
case patch_type::bef64: return "bef64";
case patch_type::be16: return "be16";
case patch_type::be32: return "be32";
case patch_type::be64: return "be64";
case patch_type::lef32: return "lef32";
case patch_type::lef64: return "lef64";
}
return unknown;
});
}
void patch_engine::append(const std::string& patch)
{
if (fs::file f{patch})
{
auto root = YAML::Load(f.to_string());
for (auto pair : root)
{
auto& name = pair.first.Scalar();
auto& data = m_map[name];
for (auto patch : pair.second)
{
u64 type64 = 0;
cfg::try_to_enum_value(&type64, &fmt_class_string<patch_type>::format, patch[0].Scalar());
struct patch info{};
info.type = static_cast<patch_type>(type64);
info.offset = patch[1].as<u32>(0);
switch (info.type)
{
case patch_type::load:
{
// Special syntax: copy named sequence (must be loaded before)
const auto found = m_map.find(patch[1].Scalar());
if (found != m_map.end())
{
// Address modifier (optional)
const u32 mod = patch[2].as<u32>(0);
for (const auto& rd : found->second)
{
info = rd;
info.offset += mod;
data.emplace_back(info);
}
continue;
}
// TODO: error
break;
}
case patch_type::bef32:
case patch_type::lef32:
{
info.value_as<f32>() = patch[2].as<f32>();
break;
}
case patch_type::bef64:
case patch_type::lef64:
{
info.value_as<f64>() = patch[2].as<f64>();
break;
}
default:
{
info.value = patch[2].as<u64>();
break;
}
}
data.emplace_back(info);
}
}
}
}
std::size_t patch_engine::apply(const std::string& name, u8* dst) const
{
const auto found = m_map.find(name);
if (found == m_map.cend())
{
return 0;
}
// Apply modifications sequentially
for (const auto& p : found->second)
{
auto ptr = dst + p.offset;
switch (p.type)
{
case patch_type::load:
{
// Invalid in this context
break;
}
case patch_type::byte:
{
*ptr = static_cast<u8>(p.value);
break;
}
case patch_type::le16:
{
*reinterpret_cast<le_t<u16, 1>*>(ptr) = static_cast<u16>(p.value);
break;
}
case patch_type::le32:
case patch_type::lef32:
{
*reinterpret_cast<le_t<u32, 1>*>(ptr) = static_cast<u32>(p.value);
break;
}
case patch_type::le64:
case patch_type::lef64:
{
*reinterpret_cast<le_t<u64, 1>*>(ptr) = static_cast<u64>(p.value);
break;
}
case patch_type::be16:
{
*reinterpret_cast<be_t<u16, 1>*>(ptr) = static_cast<u16>(p.value);
break;
}
case patch_type::be32:
case patch_type::bef32:
{
*reinterpret_cast<be_t<u32, 1>*>(ptr) = static_cast<u32>(p.value);
break;
}
case patch_type::be64:
case patch_type::bef64:
{
*reinterpret_cast<be_t<u64, 1>*>(ptr) = static_cast<u64>(p.value);
break;
}
}
}
return found->second.size();
}
+48
View File
@@ -0,0 +1,48 @@
#pragma once
#include "BEType.h"
#include <vector>
#include <string>
#include <unordered_map>
enum class patch_type
{
load,
byte,
le16,
le32,
le64,
lef32,
lef64,
be16,
be32,
be64,
bef32,
bef64,
};
class patch_engine
{
struct patch
{
patch_type type;
u32 offset;
u64 value;
template <typename T>
T& value_as()
{
return *reinterpret_cast<T*>(reinterpret_cast<char*>(&value));
}
};
// Database
std::unordered_map<std::string, std::vector<patch>> m_map;
public:
// Load from file
void append(const std::string& path);
// Apply patch (returns the number of entries applied)
std::size_t apply(const std::string& name, u8* dst) const;
};
+732
View File
@@ -0,0 +1,732 @@
#pragma once
/*
This header helps to extend scoped enum types (enum class) in two possible ways:
1) Enabling bitwise operators for enums
2) Advanced bs_t<> template (this converts enum type to another "bitset" enum type)
To enable bitwise operators, enum scope must contain `__bitwise_ops` entry.
enum class flags
{
__bitwise_ops, // Not essential, but recommended to put it first
flag1 = 1 << 0,
flag2 = 1 << 1,
};
Examples:
`flags::flag1 | flags::flag2` - bitwise OR
`flags::flag1 & flags::flag2` - bitwise AND
`flags::flag1 ^ flags::flag2` - bitwise XOR
`~flags::flag1` - bitwise NEG
To enable bs_t<> template, enum scope must contain `__bitset_enum_max` entry.
enum class flagzz : u32
{
flag1, // Bit indices start from zero
flag2,
__bitset_enum_max // It must be the last value
};
Now some operators are enabled for two enum types: `flagzz` and `bs_t<flagzz>`.
These are very different from previously described bitwise operators.
Examples:
`+flagzz::flag1` - unary `+` operator convert flagzz value to bs_t<flagzz>
`flagzz::flag1 + flagzz::flag2` - bitset union
`flagzz::flag1 - flagzz::flag2` - bitset difference
Intersection (&) and symmetric difference (^) is also available.
*/
#include "types.h"
// Helper template
template<typename T>
struct bs_base
{
// Underlying type
using under = std::underlying_type_t<T>;
// Actual bitset type
enum class type : under
{
null = 0, // Empty bitset
__bitset_set_type = 0 // SFINAE marker
};
static constexpr std::size_t bitmax = sizeof(T) * 8;
static constexpr std::size_t bitsize = static_cast<under>(T::__bitset_enum_max);
static_assert(std::is_enum<T>::value, "bs_t<> error: invalid type (must be enum)");
static_assert(!bitsize || bitsize <= bitmax, "bs_t<> error: invalid __bitset_enum_max");
// Helper function
static constexpr under shift(T value)
{
return static_cast<under>(1) << static_cast<under>(value);
}
friend type& operator +=(type& lhs, type rhs)
{
reinterpret_cast<under&>(lhs) |= static_cast<under>(rhs);
return lhs;
}
friend type& operator -=(type& lhs, type rhs)
{
reinterpret_cast<under&>(lhs) &= ~static_cast<under>(rhs);
return lhs;
}
friend type& operator &=(type& lhs, type rhs)
{
reinterpret_cast<under&>(lhs) &= static_cast<under>(rhs);
return lhs;
}
friend type& operator ^=(type& lhs, type rhs)
{
reinterpret_cast<under&>(lhs) ^= static_cast<under>(rhs);
return lhs;
}
friend type& operator +=(type& lhs, T rhs)
{
reinterpret_cast<under&>(lhs) |= shift(rhs);
return lhs;
}
friend type& operator -=(type& lhs, T rhs)
{
reinterpret_cast<under&>(lhs) &= ~shift(rhs);
return lhs;
}
friend type& operator &=(type& lhs, T rhs)
{
reinterpret_cast<under&>(lhs) &= shift(rhs);
return lhs;
}
friend type& operator ^=(type& lhs, T rhs)
{
reinterpret_cast<under&>(lhs) ^= shift(rhs);
return lhs;
}
friend constexpr type operator +(type lhs, type rhs)
{
return static_cast<type>(static_cast<under>(lhs) | static_cast<under>(rhs));
}
friend constexpr type operator -(type lhs, type rhs)
{
return static_cast<type>(static_cast<under>(lhs) & ~static_cast<under>(rhs));
}
friend constexpr type operator &(type lhs, type rhs)
{
return static_cast<type>(static_cast<under>(lhs) & static_cast<under>(rhs));
}
friend constexpr type operator ^(type lhs, type rhs)
{
return static_cast<type>(static_cast<under>(lhs) ^ static_cast<under>(rhs));
}
friend constexpr type operator &(type lhs, T rhs)
{
return static_cast<type>(static_cast<under>(lhs) & shift(rhs));
}
friend constexpr type operator ^(type lhs, T rhs)
{
return static_cast<type>(static_cast<under>(lhs) ^ shift(rhs));
}
friend constexpr type operator &(T lhs, type rhs)
{
return static_cast<type>(shift(lhs) & static_cast<under>(rhs));
}
friend constexpr type operator ^(T lhs, type rhs)
{
return static_cast<type>(shift(lhs) ^ static_cast<under>(rhs));
}
friend constexpr bool operator ==(T lhs, type rhs)
{
return shift(lhs) == rhs;
}
friend constexpr bool operator ==(type lhs, T rhs)
{
return lhs == shift(rhs);
}
friend constexpr bool operator !=(T lhs, type rhs)
{
return shift(lhs) != rhs;
}
friend constexpr bool operator !=(type lhs, T rhs)
{
return lhs != shift(rhs);
}
friend constexpr bool test(type value)
{
return static_cast<under>(value) != 0;
}
friend constexpr bool test(type lhs, type rhs)
{
return (static_cast<under>(lhs) & static_cast<under>(rhs)) != 0;
}
friend constexpr bool test(type lhs, T rhs)
{
return (static_cast<under>(lhs) & shift(rhs)) != 0;
}
friend constexpr bool test(T lhs, type rhs)
{
return (shift(lhs) & static_cast<under>(rhs)) != 0;
}
friend bool test_and_set(type& lhs, type rhs)
{
return test_and_set(reinterpret_cast<under&>(lhs), static_cast<under>(rhs));
}
friend bool test_and_set(type& lhs, T rhs)
{
return test_and_set(reinterpret_cast<under&>(lhs), shift(rhs));
}
friend bool test_and_reset(type& lhs, type rhs)
{
return test_and_reset(reinterpret_cast<under&>(lhs), static_cast<under>(rhs));
}
friend bool test_and_reset(type& lhs, T rhs)
{
return test_and_reset(reinterpret_cast<under&>(lhs), shift(rhs));
}
friend bool test_and_complement(type& lhs, type rhs)
{
return test_and_complement(reinterpret_cast<under&>(lhs), static_cast<under>(rhs));
}
friend bool test_and_complement(type& lhs, T rhs)
{
return test_and_complement(reinterpret_cast<under&>(lhs), shift(rhs));
}
};
// Bitset type for enum class with available bits [0, T::__bitset_enum_max)
template<typename T>
using bs_t = typename bs_base<T>::type;
// Unary '+' operator: promote plain enum value to bitset value
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator +(T value)
{
return static_cast<bs_t<T>>(bs_base<T>::shift(value));
}
// Binary '+' operator: bitset union
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator +(T lhs, T rhs)
{
return static_cast<bs_t<T>>(bs_base<T>::shift(lhs) | bs_base<T>::shift(rhs));
}
// Binary '+' operator: bitset union
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator +(typename bs_base<T>::type lhs, T rhs)
{
return static_cast<bs_t<T>>(static_cast<typename bs_base<T>::under>(lhs) | bs_base<T>::shift(rhs));
}
// Binary '+' operator: bitset union
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator +(T lhs, typename bs_base<T>::type rhs)
{
return static_cast<bs_t<T>>(bs_base<T>::shift(lhs) | static_cast<typename bs_base<T>::under>(rhs));
}
// Binary '-' operator: bitset difference
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator -(T lhs, T rhs)
{
return static_cast<bs_t<T>>(bs_base<T>::shift(lhs) & ~bs_base<T>::shift(rhs));
}
// Binary '-' operator: bitset difference
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator -(typename bs_base<T>::type lhs, T rhs)
{
return static_cast<bs_t<T>>(static_cast<typename bs_base<T>::under>(lhs) & ~bs_base<T>::shift(rhs));
}
// Binary '-' operator: bitset difference
template<typename T, typename = decltype(T::__bitset_enum_max)>
constexpr bs_t<T> operator -(T lhs, typename bs_base<T>::type rhs)
{
return static_cast<bs_t<T>>(bs_base<T>::shift(lhs) & ~static_cast<typename bs_base<T>::under>(rhs));
}
template<typename BS, typename T>
struct atomic_add<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bs_t<T> op1(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::fetch_or(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto fetch_op = &op1;
static inline bs_t<T> op2(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::or_fetch(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename BS, typename T>
struct atomic_sub<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bs_t<T> op1(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), ~bs_base<T>::shift(right)));
}
static constexpr auto fetch_op = &op1;
static inline bs_t<T> op2(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), ~bs_base<T>::shift(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename BS, typename T>
struct atomic_and<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bs_t<T> op1(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto fetch_op = &op1;
static inline bs_t<T> op2(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename BS, typename T>
struct atomic_xor<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bs_t<T> op1(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::fetch_xor(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto fetch_op = &op1;
static inline bs_t<T> op2(bs_t<T>& left, T right)
{
return static_cast<bs_t<T>>(atomic_storage<under>::xor_fetch(reinterpret_cast<under&>(left), bs_base<T>::shift(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_add<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_or(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::or_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_sub<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), ~static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), ~static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_and<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_xor<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_xor(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::xor_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename BS, typename T>
struct atomic_test_and_set<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bool _op(bs_t<T>& left, T value)
{
return atomic_storage<under>::bts(reinterpret_cast<under&>(left), static_cast<uint>(static_cast<under>(value)));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename BS, typename T>
struct atomic_test_and_reset<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bool _op(bs_t<T>& left, T value)
{
return atomic_storage<under>::btr(reinterpret_cast<under&>(left), static_cast<uint>(static_cast<under>(value)));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename BS, typename T>
struct atomic_test_and_complement<BS, T, void_t<decltype(T::__bitset_enum_max), std::enable_if_t<std::is_same<BS, bs_t<T>>::value>>>
{
using under = typename bs_base<T>::under;
static inline bool _op(bs_t<T>& left, T value)
{
return atomic_storage<under>::btc(reinterpret_cast<under&>(left), static_cast<uint>(static_cast<under>(value)));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_set<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_set(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_reset(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_complement<T, T, void_t<decltype(T::__bitset_set_type)>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_complement(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
// Binary '|' operator: bitwise OR
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr T operator |(T lhs, T rhs)
{
return static_cast<T>(std::underlying_type_t<T>(lhs) | std::underlying_type_t<T>(rhs));
}
// Binary '&' operator: bitwise AND
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr T operator &(T lhs, T rhs)
{
return static_cast<T>(std::underlying_type_t<T>(lhs) & std::underlying_type_t<T>(rhs));
}
// Binary '^' operator: bitwise XOR
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr T operator ^(T lhs, T rhs)
{
return static_cast<T>(std::underlying_type_t<T>(lhs) ^ std::underlying_type_t<T>(rhs));
}
// Unary '~' operator: bitwise NEG
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr T operator ~(T value)
{
return static_cast<T>(~std::underlying_type_t<T>(value));
}
// Bitwise OR assignment
template<typename T, typename = decltype(T::__bitwise_ops)>
inline T& operator |=(T& lhs, T rhs)
{
reinterpret_cast<std::underlying_type_t<T>&>(lhs) |= std::underlying_type_t<T>(rhs);
return lhs;
}
// Bitwise AND assignment
template<typename T, typename = decltype(T::__bitwise_ops)>
inline T& operator &=(T& lhs, T rhs)
{
reinterpret_cast<std::underlying_type_t<T>&>(lhs) &= std::underlying_type_t<T>(rhs);
return lhs;
}
// Bitwise XOR assignment
template<typename T, typename = decltype(T::__bitwise_ops)>
inline T& operator ^=(T& lhs, T rhs)
{
reinterpret_cast<std::underlying_type_t<T>&>(lhs) ^= std::underlying_type_t<T>(rhs);
return lhs;
}
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr bool test(T value)
{
return std::underlying_type_t<T>(value) != 0;
}
template<typename T, typename = decltype(T::__bitwise_ops)>
constexpr bool test(T lhs, T rhs)
{
return (std::underlying_type_t<T>(lhs) & std::underlying_type_t<T>(rhs)) != 0;
}
template<typename T, typename = decltype(T::__bitwise_ops)>
inline bool test_and_set(T& lhs, T rhs)
{
return test_and_set(reinterpret_cast<std::underlying_type_t<T>&>(lhs), std::underlying_type_t<T>(rhs));
}
template<typename T, typename = decltype(T::__bitwise_ops)>
inline bool test_and_reset(T& lhs, T rhs)
{
return test_and_reset(reinterpret_cast<std::underlying_type_t<T>&>(lhs), std::underlying_type_t<T>(rhs));
}
template<typename T, typename = decltype(T::__bitwise_ops)>
inline bool test_and_complement(T& lhs, T rhs)
{
return test_and_complement(reinterpret_cast<std::underlying_type_t<T>&>(lhs), std::underlying_type_t<T>(rhs));
}
template<typename T>
struct atomic_or<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_or(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::or_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_and<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_and(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::and_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_xor<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline T op1(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::fetch_xor(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto fetch_op = &op1;
static inline T op2(T& left, T right)
{
return static_cast<T>(atomic_storage<under>::xor_fetch(reinterpret_cast<under&>(left), static_cast<under>(right)));
}
static constexpr auto op_fetch = &op2;
static constexpr auto atomic_op = &op2;
};
template<typename T>
struct atomic_test_and_set<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_set(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_reset<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_reset(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
template<typename T>
struct atomic_test_and_complement<T, T, void_t<decltype(T::__bitwise_ops), std::enable_if_t<std::is_enum<T>::value>>>
{
using under = std::underlying_type_t<T>;
static inline bool _op(T& left, T value)
{
return atomic_storage<under>::test_and_complement(reinterpret_cast<under&>(left), static_cast<under>(value));
}
static constexpr auto fetch_op = &_op;
static constexpr auto op_fetch = &_op;
static constexpr auto atomic_op = &_op;
};
+634
View File
@@ -0,0 +1,634 @@
#pragma once
#include "types.h"
#include <climits>
#include <string>
#include <vector>
#include <algorithm>
/*
C-style format parser. Appends formatted string to `out`, returns number of characters written.
`out`: mutable reference to std::string, std::vector<char> or other compatible container
`fmt`: null-terminated string of `Char` type (char or constructible from char)
`src`: rvalue reference to argument provider.
*/
template<typename Dst, typename Char, typename Src>
std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
{
const std::size_t start_pos = out.size();
struct cfmt_context
{
std::size_t size; // Size of current format sequence
u8 args; // Number of extra args used
u8 type; // Integral type bytesize
bool dot; // Precision enabled
bool left;
bool sign;
bool space;
bool alter;
bool zeros;
uint width;
uint prec;
};
cfmt_context ctx{0};
// Error handling: print untouched sequence, stop further formatting
const auto drop_sequence = [&]
{
out.insert(out.end(), fmt - ctx.size, fmt);
ctx.size = -1;
};
const auto read_decimal = [&](uint result) -> uint
{
while (fmt[0] >= '0' && fmt[0] <= '9' && result <= (UINT_MAX / 10))
{
result = result * 10 + (fmt[0] - '0');
fmt++, ctx.size++;
}
return result;
};
const auto write_octal = [&](u64 value, u64 min_num)
{
out.resize(out.size() + std::max<u64>(min_num, 66 / 3 - (cntlz64(value | 1, true) + 2) / 3), '0');
// Write in reversed order
for (auto i = out.rbegin(); value; i++, value /= 8)
{
*i = value % 8 + '0';
}
};
const auto write_hex = [&](u64 value, bool upper, u64 min_num)
{
out.resize(out.size() + std::max<u64>(min_num, 64 / 4 - cntlz64(value | 1, true) / 4), '0');
// Write in reversed order
for (auto i = out.rbegin(); value; i++, value /= 16)
{
*i = (upper ? "0123456789ABCDEF" : "0123456789abcdef")[value % 16];
}
};
const auto write_decimal = [&](u64 value, s64 min_size)
{
const std::size_t start = out.size();
do
{
out.push_back(value % 10 + '0');
value /= 10;
}
while (0 < --min_size || value);
// Revert written characters
for (std::size_t i = start, j = out.size() - 1; i < j; i++, j--)
{
std::swap(out[i], out[j]);
}
};
// Single pass over fmt string (null-terminated), TODO: check correct order
while (const Char ch = *fmt++) if (ctx.size == 0)
{
if (ch == '%')
{
ctx.size = 1;
}
else
{
out.push_back(ch);
}
}
else if (ctx.size == 1 && ch == '%')
{
ctx = {0};
out.push_back(ch);
}
else if (ctx.size == -1)
{
out.push_back(ch);
}
else switch (ctx.size++, ch)
{
case '-': ctx.left = true; break;
case '+': ctx.sign = true; break;
case ' ': ctx.space = true; break;
case '#': ctx.alter = true; break;
case '0': ctx.zeros = true; break;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
if (UNLIKELY(ctx.width))
{
drop_sequence();
}
else
{
ctx.width = read_decimal(ch - '0');
}
break;
}
case '*':
{
if (UNLIKELY(ctx.width || !src.test(ctx.args)))
{
drop_sequence();
}
else
{
const int warg = src.template get<int>(ctx.args++);
ctx.width = std::abs(warg);
ctx.left |= warg < 0;
}
break;
}
case '.':
{
if (UNLIKELY(ctx.dot || ctx.prec))
{
drop_sequence();
}
else if (*fmt >= '0' && *fmt <= '9') // TODO: does it allow '0'?
{
ctx.prec = read_decimal(0);
ctx.dot = true;
}
else if (*fmt == '*')
{
if (UNLIKELY(!src.test(ctx.args)))
{
drop_sequence();
}
else
{
fmt++, ctx.size++;
const int parg = src.template get<int>(ctx.args++);
ctx.prec = std::max(parg, 0);
ctx.dot = parg >= 0;
}
}
else
{
ctx.prec = 0;
ctx.dot = true;
}
break;
}
case 'h':
{
if (UNLIKELY(ctx.type))
{
drop_sequence();
}
else if (fmt[0] == 'h')
{
fmt++, ctx.size++;
ctx.type = src.size_char;
}
else
{
ctx.type = src.size_short;
}
break;
}
case 'l':
{
if (UNLIKELY(ctx.type))
{
drop_sequence();
}
else if (fmt[0] == 'l')
{
fmt++, ctx.size++;
ctx.type = src.size_llong;
}
else
{
ctx.type = src.size_long;
}
break;
}
case 'z':
{
if (UNLIKELY(ctx.type))
{
drop_sequence();
}
else
{
ctx.type = src.size_size;
}
break;
}
case 'j':
{
if (UNLIKELY(ctx.type))
{
drop_sequence();
}
else
{
ctx.type = src.size_max;
}
break;
}
case 't':
{
if (UNLIKELY(ctx.type))
{
drop_sequence();
}
else
{
ctx.type = src.size_diff;
}
break;
}
case 'c':
{
if (UNLIKELY(ctx.type || !src.test(ctx.args)))
{
drop_sequence();
break;
}
const std::size_t start = out.size();
out.push_back(src.template get<Char>(ctx.args));
if (1 < ctx.width)
{
// Add spaces if necessary
out.insert(out.begin() + start + ctx.left, ctx.width - 1, ' ');
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 's':
{
if (UNLIKELY(ctx.type || !src.test(ctx.args)))
{
drop_sequence();
break;
}
const std::size_t start = out.size();
const std::size_t size1 = src.fmt_string(out, ctx.args);
if (ctx.dot && size1 > ctx.prec)
{
// Shrink if necessary
out.resize(start + ctx.prec);
}
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add spaces if necessary
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ' ');
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'd':
case 'i':
{
if (UNLIKELY(!src.test(ctx.args)))
{
drop_sequence();
break;
}
if (!ctx.type)
{
ctx.type = (u8)src.type(ctx.args);
if (!ctx.type)
{
ctx.type = src.size_int;
}
}
// Sign-extended argument expected
const u64 val = src.template get<u64>(ctx.args);
const bool negative = ctx.type && static_cast<s64>(val) < 0;
const std::size_t start = out.size();
if (!ctx.dot || ctx.prec)
{
if (negative)
{
out.push_back('-');
}
else if (ctx.sign)
{
out.push_back('+');
}
else if (ctx.space)
{
out.push_back(' ');
}
write_decimal(negative ? 0 - val : val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add padding if necessary
if (ctx.zeros && !ctx.left && !ctx.dot)
{
out.insert(out.begin() + start + (negative || ctx.sign || ctx.space), ctx.width - size2, '0');
}
else
{
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ' ');
}
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'o':
{
if (UNLIKELY(!src.test(ctx.args)))
{
drop_sequence();
break;
}
if (!ctx.type)
{
ctx.type = (u8)src.type(ctx.args);
if (!ctx.type)
{
ctx.type = src.size_int;
}
}
const u64 mask =
ctx.type == 1 ? 0xffull :
ctx.type == 2 ? 0xffffull :
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
if (ctx.alter)
{
out.push_back('0');
if (val)
{
write_octal(val, ctx.prec ? ctx.prec - 1 : 0);
}
}
else if (!ctx.dot || ctx.prec)
{
write_octal(val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add padding if necessary
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ctx.zeros && !ctx.left && !ctx.dot ? '0' : ' ');
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'x':
case 'X':
{
if (UNLIKELY(!src.test(ctx.args)))
{
drop_sequence();
break;
}
if (!ctx.type)
{
ctx.type = (u8)src.type(ctx.args);
if (!ctx.type)
{
ctx.type = src.size_int;
}
}
const u64 mask =
ctx.type == 1 ? 0xffull :
ctx.type == 2 ? 0xffffull :
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
if (ctx.alter)
{
out.push_back('0');
if (val)
{
out.push_back(ch); // Prepend 0x or 0X
write_hex(val, ch == 'X', ctx.prec);
}
}
else if (!ctx.dot || ctx.prec)
{
write_hex(val, ch == 'X', ctx.prec);
}
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add padding if necessary
if (ctx.zeros && !ctx.left && !ctx.dot)
{
out.insert(out.begin() + start + (ctx.alter && val ? 2 : 0), ctx.width - size2, '0');
}
else
{
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ' ');
}
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'u':
{
if (UNLIKELY(!src.test(ctx.args)))
{
drop_sequence();
break;
}
if (!ctx.type)
{
ctx.type = (u8)src.type(ctx.args);
if (!ctx.type)
{
ctx.type = src.size_int;
}
}
const u64 mask =
ctx.type == 1 ? 0xffull :
ctx.type == 2 ? 0xffffull :
ctx.type == 4 ? 0xffffffffull : 0xffffffffffffffffull;
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
if (!ctx.dot || ctx.prec)
{
write_decimal(val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add padding if necessary
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ctx.zeros && !ctx.left && !ctx.dot ? '0' : ' ');
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'p':
{
if (UNLIKELY(!src.test(ctx.args) || ctx.type))
{
drop_sequence();
break;
}
const u64 val = src.template get<u64>(ctx.args);
const std::size_t start = out.size();
write_hex(val, false, sizeof(void*) * 2);
const std::size_t size2 = out.size() - start;
if (size2 < ctx.width)
{
// Add padding if necessary
out.insert(ctx.left ? out.end() : out.begin() + start, ctx.width - size2, ' ');
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'f':
case 'F':
case 'e':
case 'E':
case 'a':
case 'A':
case 'g':
case 'G':
{
if (UNLIKELY(!src.test(ctx.args) || ctx.type))
{
drop_sequence();
break;
}
// Fallback (TODO)
const std::string _fmt(fmt - ctx.size, fmt);
const f64 arg0 = src.template get<f64>(0);
const u64 arg1 = ctx.args >= 1 ? src.template get<u64>(1) : 0;
const u64 arg2 = ctx.args >= 2 ? src.template get<u64>(2) : 0;
if (const std::size_t _size = std::snprintf(0, 0, _fmt.c_str(), arg0, arg1, arg2))
{
out.resize(out.size() + _size);
std::snprintf(&out.front() + out.size() - _size, _size + 1, _fmt.c_str(), arg0, arg1, arg2);
}
src.skip(ctx.args);
ctx = {0};
break;
}
case 'L': // long double, not supported
case 'n': // writeback, not supported
default:
{
drop_sequence();
}
}
// Handle unfinished sequence
if (ctx.size && ctx.size != -1)
{
fmt--, drop_sequence();
}
return out.size() - start_pos;
}

Some files were not shown because too many files have changed in this diff Show More