summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/drawd3d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* osd: Moved some windows-specific stuff into osd/windows/window.{h,cpp}. Vas Crabb2023-02-261-7/+8
|
* render/drawd3d.cpp: Fixed prescaling without HLSL - WRL COM pointer has some ↵ Vas Crabb2023-02-021-57/+56
| | | | | | surprises. Also added some additional error checking.
* Implemented probe for D3D module to detect lack of D3D9 sooner. Vas Crabb2023-02-011-0/+12
|
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-011-366/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore the return status of OSD module initialisation. Attempt to fall back to an alternate module if the selected module fails to initialise. Log more useful diagnostic information at verbose level. Fixed BGFX crash on exit after toggling fullscreen. Also persist more settings than just the selected chains across toggling fullscreen. Turned video modules into OSD modules in the same sense as all the other OSD modules. They now use the same selection/fallback mechanism as all the other modules without special extra code in the OSD implementations. Untangled some object ownership mess. Windows own renderers, OSD objects own windows. Fixed a refrence loop that caused the first window object to always leak. Don't create renderer object until after underlying window has been created. Fixed issues with order of creation/destruction when toggling fullscreen or changing prescale in fullscreen with -switchres in SDL builds. Use more smart pointers in BGFX and Direct3D render modules. Most of the code now reutrns a smart pointer when handing over ownership or a naked pointer when retaining ownership. Fixed a few leaks and simplified cleanup code. Encapsulated various OSD modules better.
* Major D3D and BGFX code refactoring and bug fixes: (#10858) [Ryan Holtz] MooglyGuy2023-01-291-23/+58
| | | | | | | | | | | * render/bgfx: Improved clearing and blending. Added prescale support. Fixes MT07586, MT07587, MT08084. * render/bgfx: Fixed blend and tint handling. (Fixes Github #1953). * render/bgfx/blendreader.cpp: Support non-separated blend mode specification for BGFX effects. * render/bgfx: Reworked how horizontally-padded screen textures are handled. Likely fixes MT08512 and MT08505. * render/bgfx: Ensure that a texture's width margin is updated in all cases. * render/d3d/d3dhlsl.cpp: Fixed tinting in HLSL post-processing mode. * render/d3d/d3dhlsl.cpp: Avoid most redundant state-setting calls. Reduces D3D API calls by about 90% on fruit machine drivers. * render/d3d/d3dhlsl.cpp: Assign SourceDims and QuadDims uniforms to only those effects that use them. * machine/laserdsc.cpp: Always add video quad to screen container, adjust tint based on m_videoenable instead.
* Various input and OSD refactoring: Vas Crabb2023-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* rendutil.cpp: API cleanup + minor related OSD render cleanups AJR2022-01-221-14/+4
|
* Render-related cleanup AJR2021-12-301-2/+3
| | | | | | | - Undo inclusion of screen.h within render.h and update many source files that were stealth-including the former - Move texture_format enum to rendertypes.h - rendlay.h: Make a few methods static - ui/info.cpp: Use C++11-style iteration for render targets
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The global_alloc/global_free functions have outlived their usefulness. They don't allow consistently overriding the default memory allocation behaviour because they aren't used consistently, and we don't have standard library allocator wrappers for them that we'd need to use them consistently with all the standard library containers we're using. If you need to change the default allocator behaviour, you can override the new/delete operators, and there are ways to get more fine-grained control that way. We're already doing that to pre-fill memory in debug builds. Code was already starting to depend on global_alloc/global_free wrapping new/delete. For example some parts of the code (including the UI and Windows debugger) was putting the result of global_alloc in a std::unique_ptr wrappers without custom deleters, and the SPU sound device was assuming it could use global_free to release memory allocated with operator new. There was also code misunderstanding the behaviour of global_alloc, for example the GROM port cartridge code was checking for nullptr when a failure will actually throw std::bad_alloc. As well as substituting new/delete, I've made several things use smart pointers to reduce the chance of leaks, and fixed a couple of leaks, too.
* drawd3d: properly clean up d3dintf (nw) hap2020-06-211-0/+3
|
* MAME Testers Bugs Fixed Ryan Holtz2020-05-281-163/+85
| | | | | | | ----------------------- 07536: [Graphics] Prescale option does not work properly on D3D renderer (Ryan Holtz) -renderer/d3d: Removed old StretchRect code. All drivers these days punt it to a shader backend anyway, and it's causing issues with -prescale. [Ryan Holtz]
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-19/+19
|
* Changed Direct3D renderer to call GetAncestor() in device_create() to npwoods2019-12-221-1/+5
| | | | | | get the root window This is to make -attach_window work with non-root windows
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-2/+2
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* -core: Removed TEXFORMAT_PALETTEA16. [Ryan Holtz] MooglyGuy2019-07-101-20/+1
|
* d3d: this fixes alt-tab crash (nw) hap2019-06-171-1/+5
|
* sun4: More optimizations, nw mooglyguy2018-09-231-7/+7
|
* -bgfx: Improved rendering with artwork by 5-10x or more. [Ryan Holtz] mooglyguy2018-08-261-5/+6
|
* Removed first_screen from wswan and d3d (nw) Ryan Holtz2018-03-091-2/+2
|
* really fixed MT06623 (don't use uninitialised gamma ramp) (nw) smf-2018-01-051-5/+4
|
* drawd3d.cpp: fixed MT06623 (nw) Ivan Vangelista2018-01-051-1/+1
|
* srcclean (nw) Vas Crabb2017-07-231-1/+1
|
* Cleanup, we already have NOMINMAX now in scripts (nw) Miodrag Milanovic2017-02-111-2/+0
|
* Revert "New phosphor persistence shaders for HLSL" R. Belmont2017-01-051-17/+10
|
* Change cached texture format to floating point. Westley M. Martinez2017-01-041-10/+17
| | | | | | | | | | | | hlsl/phosphor.fx: Remove hacks ini/presets/raster.ini, ini/presets/vector-mono.ini, ini/presets/vector.ini: Tweak presets src/osd/modules/render/d3d/d3dcomm.h, src/osd/modules/render/d3d/d3dhlsl.cpp, src/osd/modules/render/drawd3d.cpp: Change cache texture format to floating point for precise for phosphor and ghosting shaders.
* clean up tabulation, fix some things (nw) Vas Crabb2016-11-251-1/+1
|
* A round of spelling/typographical fixes to source comments (nw) Scott Stone2016-11-241-1/+1
|
* Change window handle storage to template instead of void* (nw) (#1725) Brad Hughes2016-11-171-6/+6
| | | | * Change window handle storage to template instead of void* (nw)
* hlsl: fixed games with off-screen backdrop artworks ImJezze2016-11-021-3/+6
| | | | - e.g. atarifb, bowler
* Compile fix, (nw) therealmogminer@gmail.com2016-10-311-1/+0
|
* Kill off another d3d optimization, (nw) therealmogminer@gmail.com2016-10-311-0/+2
|
* Hopefully fix the D3D9 issues people are having (nw) therealmogminer@gmail.com2016-10-311-31/+111
|
* Fixed MT#06417 Jezze2016-10-301-0/+6
| | | | - cache texture/surface were not released when render target was destructed
* Fix visual corruption introduced a few changelists ago by me, nw therealmogminer@gmail.com2016-10-241-11/+25
|
* Make d3d9 a little more discerning in what level of bad hardware it will ↵ therealmogminer@gmail.com2016-10-231-321/+115
| | | | allow, nw
* Fixed null reference exception (D3D/HLSL) Jezze2016-10-221-3/+12
| | | | - when toggling from fullscreen to window mode
* Refactored d3d_render_target (nw) Jezze2016-10-221-96/+34
| | | | | | | * removed cashe_target class * moved cashe texture and surface to d3d_render_target class * render targets are now created per screen not per screen texture * removed useless creation of render targets for ui textures
* -ie15: Improved performance by using a timer to determine hblank. [Ryan Holtz] therealmogminer@gmail.com2016-10-221-24/+1
|
* final cleanup of TRUE/FALSE, left only in windows section where it represent ↵ Miodrag Milanovic2016-10-221-7/+7
| | | | BOOL (nw)
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-95/+95
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-1/+1
| | | | utf16_char, unicode_char (nw)
* Fix use of uninitialized stack memory in drawd3d.cpp (nw) Brad Hughes2016-10-031-0/+1
|
* Fixed several small issues in HLSL/BGFX Jezze2016-09-281-16/+21
| | | | | | * fixed target texture dimension when -intoverscan is used (this fixes the appereance of scanline and shadow mask) * added target_scale and screen_count uniforms * rounded corners now remain aligned with screen bounds when -intoverscan is used (single screen only)
* Convert OSD monitor info to modules plus add DXGI implementation Brad Hughes2016-09-141-3/+4
|
* for bool type use true and false (nw) Miodrag Milanovic2016-07-311-1/+1
|
* algorithm-> utility where appropriate, fix imgtool (nw) Miodrag Milanovic2016-07-311-1/+1
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-2/+4
| | | | to inline functions (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-2/+2
|
* Fixed MT #6291 ImJezze2016-07-161-0/+5
| | | | | | | | * fixed copy of texture data to bitmap in BGFX * changed AVI dimension to a lowest integral multiple of 4 (2 was still to low for most video players, e.g. VLC) * added audio to AVI record in HLSL * HLSL AVI record now uses window dimension instead of snap dimension