summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/d3d/d3dhlsl.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* d3dhlsl: fix possible array overflow with system name string hap12 days1-1/+1
|
* BGFX and D3D9 renderer fixes for issues #11104, #11106, and #11107 (#11249) MooglyGuy2023-05-201-5/+9
| | | | | * -hlsl.json: Removed duplicate scanline_variation setting. (#11107) [Ryan Holtz] * -d3dhlsl.cpp: Fixed lack of post-pass application when bloom is disabled. (#11104) [Ryan Holtz] * -drawd3d.cpp: Always set a default texture at scene start. (#11106) [Ryan Holtz]
* -render/d3d/d3dhlsl.cpp: Fixed alpha value when clearing target. [Ryan Holtz] Vas Crabb2023-03-211-1/+1
| | | | -jaleco/tetrisp2_v.cpp: Fixed stepstag text display. [Vas Crabb]
* Swapped R and B channels in lut-default.png, and adjusted D3D9 ↵ MooglyGuy2023-03-201-5/+7
| | | | | | LUT-application behaviour. (#11004) [Ryan Holtz] * lut-default.png: Swapped red and blue channels (fixes GitHub #11001). * render/d3d/d3dlsl.cpp: Changed screen LUT application to be applied during the color convolution pass on raster systems.
* More D3D HLSL regression fixes: (#11002) [Ryan Holtz] MooglyGuy2023-03-201-4/+6
| | | | | * hlsl/post.fx: Fixed double-drawing of screen data with D3D9 HLSL and screen scale/offset. * render/d3d/d3dhlsl.cpp: Fixed screen-container search function (fixes GitHub #10872). * render/d3d/d3dhlsl.cpp: Fixed downsample pass, fixes blocky vector bloom.
* Small batch of input refactoring: Vas Crabb2023-02-051-3/+6
| | | | | | | | | | | | | | | | | | | | | emu/input.cpp: Fixed regression in display of some joystick inputs. osd/interface: Split up interface classes into a few more files to reduce where the input device interface class needs to be included. Made OSD independent of concrete input_device class. osd/modules/input, emu/inputdev.cpp, emu/ioport.cpp: Allow input devices to provide tokens for controls without standard item types and additional default input assignments. Fixes issues assigning Yen and Backslash on Japanese keyboards. ui/textbox.cpp: Added a fixed-content text box menu class for future use. Got main.h out of emu.h as it’s only used in a very small number of places, mostly for getting the application name. Added eminline.h to attotime.h as it's used without emu.h. Cleaned up forward declarations in emufwd.h a little.
* render/drawd3d.cpp: Fixed prescaling without HLSL - WRL COM pointer has some ↵ Vas Crabb2023-02-021-5/+5
| | | | | | surprises. Also added some additional error checking.
* Use EQUIVALENT_ARRAY to avoid issues with std::size on member arrays, enable ↵ Vas Crabb2023-02-011-1/+1
| | | | warnings for VLAs in C++.
* osd/tools: msvc fixes Patrick Mackinlay2023-02-011-1/+1
| | | | | * xinput.h depends on windows.h * avoid use of non-standard variable-length arrays
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-011-315/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-183/+318
| | | | | | | | | | | * 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.
* Improve NTSC parameter descriptions and ranges in OSD (#10782) benrg2023-01-211-7/+7
| | | | | | Correct units of some parameters (they are MHz, not Hz) and correct one default (color carrier should be 3.57 MHz, not 35.7). Use a step size of 1/8800 MHz for the color carrier so that the NTSC value of 315/88 MHz can be exactly represented (to float precision).
* Removed superfluous semicolons from various source files. (#9796) 0kmg2022-05-221-1/+1
|
* -util/corealloc.h: Reduced make_unique_clear to a single variant for POD arrays. Vas Crabb2022-04-031-1/+1
| | | | | | | | | | | | | | | | | | * Enabled GCC lifetime dead store elimination optimisation. * emu/device.h: Don't pre-clear memory for drivers. Ivan Vangelista fixed at least the majority of things that crashed outright, and Robbbert initialised variables that coverity complained about. It's unlikely anything will break due to this. * sound/discrete.h: Explicitly initialise members of discrete "devices" to zero. I don't see a way around doing this in headers due to the macro soup used to build the constructors. * sound/mos6581.cpp: Moved creation of the SID core to device_start and explictly initialised members of the SID core structures. These structures are in internal headers, so they won't cause downstream recompiles. -Lua engine: Made I/O port manager type_seq a bit more tolerant of omitted arguments.
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
|
* -osd/windows: Fixed stupid potential deadlock on exit. Vas Crabb2021-11-131-8/+4
| | | | | -frontend: Some changes to menu item class that will make it possbile to reduce the number of menu rebuilds.
* render/d3d: Replaced some locale-sensitive configuration parsing code. Vas Crabb2021-10-261-18/+21
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-3/+3
| | | | | * Turned `core_file` into an implementation of `random_read_write`. * Turned PNG errors into a standard error category. * Added a helper for generating what look like derived classes on-the-fly.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-5/+5
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* Use std::clamp in more source files AJR2021-08-151-3/+3
|
* ui: Clean up slider callbacks AJR2021-01-271-25/+3
|
* render.h, rendlay.h: Dependency refactoring AJR2021-01-041-0/+1
| | | | | - render.h: Split out layout class declarations into rendlay.h, with some adjustments for the resulting incomplete types (std::reference_wrapper unfortunately does not allow these by C++17 rules) - rendlay.h: Move old header contents to layout/generic.h
* util/png: Update add_text to take std::string_view for arguments AJR2020-12-211-2/+2
|
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Enable GCC implicit fallthrough warning. Vas Crabb2020-11-151-0/+1
| | | | | | I've guessed whether break or [[fallthrough]] is appropriate. In cases where it looked particularly suspicious, I added a FIXME comment. All of these changes should be reviewed by someone familiar with the code.
* Various improvements to image file handling: Vas Crabb2020-10-081-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | Moved MS DIB parser out of ICO file reader and made it available for artwork and layout images. Added more efficient I/O and better error checking for JPEG file loading (MAME will no longer exit immediately on a bad JPEG file). Made caller responsible for opening files for loading images, to avoid decompressing images used in ZIP/7z artwork multiple times. Added support for JPEG and Windows DIB to picture_image_device. Added support for SVG image files in external artwork. Added support for using I/O port value for animation state and masking animation state values. Made bounds elements more flexible in layouts. Reworked headers to reduce dependencies. Updated layout file format documentation.
* emu/render.cpp: Consider that screens can be hidden when choosing a default ↵ Vas Crabb2020-10-031-1/+1
| | | | view.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* -Got rid of most of the remaining problematic uses of make_unique_clear. Vas Crabb2020-09-301-1/+1
| | | | -sound/discrete.cpp: Use C++ std::vector and range-based for.
* Cleaned up bitmap API. Vas Crabb2020-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* -util/xmlfile: Escape attribute and element content. Vas Crabb2020-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | The previous behaviour was unintuitive - parsing an XML file and writing it out immediately would produce invalid XML if the file contained any characters that needed escaping. It makes far more sense to escape on writing rather than expecting the user to escape input. -Add preliminary support for visibility toggles to artwork system. This allows the user to show/hide related elements in a view, with nesting. The view can specify whether elements are shown or hidden by default. Settings are saved per host window/screen per view. There is no way to set the initial visibility state on the command line. Legacy "Space Invaders cabinet model" layers are mapped onto visibility toggles. This is not stable yet. In particular, the XML element/attribute names have not been finalised. The new features have not been added to complay.py to prevent them from being used before they're finalised.
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-6/+6
|
* Clean up render_screen_list code, replacing simple_list with std::list (nw) AJR2019-11-241-1/+1
|
* srcclean and cleanup (nw) Vas Crabb2018-10-281-10/+11
|
* HLSL Color Transforms and 3D LUT (#4043) Westley M. Martinez2018-10-071-20/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove broken scanline uniform from post_pass * Add 3D LUT to HLSL * Allow individual LUTs for screen and UI * WIP: Port 3D LUT to BGFX * Finish porting LUT to BGFX * Add individual phosphor color conversion for HLSL new file: hlsl/chroma.fx Shader for converting xyY3 to sRGB modified: hlsl/phosphor.fx Minor changes to emphasize idea that phosphors are color agnostic modified: hlsl/post.fx Conversion from signal RGB to xyY3 modified: src/osd/modules/render/d3d/d3dhlsl.cpp modified: src/osd/modules/render/d3d/d3dhlsl.h modified: src/osd/windows/winmain.cpp modified: src/osd/windows/winmain.h * Add phosphor examples and update presets * Port phosphor color shaders to BGFX * Fix missing newlines at EOF
* srcclean (nw) Vas Crabb2018-09-231-3/+3
|
* - fix not set default uniforms for vector pass (#4008) ImJezze2018-09-171-1/+1
|
* HLSL: Move scanline to occur before defocus W. M. Martinez2018-09-141-22/+98
| | | | | | | | | | | | | On branch scanline Changes to be committed: modified: hlsl/post.fx Remove scanline effect new file: hlsl/scanline.fx Separate scanline effect into its own shader modified: src/osd/modules/render/d3d/d3dhlsl.cpp Add scanline effect modified: src/osd/modules/render/d3d/d3dhlsl.h Add scanline effect
* Removed first_screen from wswan and d3d (nw) Ryan Holtz2018-03-091-2/+2
|
* D3D fix (nw) AJR2017-09-151-1/+1
|
* Use std::unique_ptr to manage instances of slider_state (nw) AJR2017-09-151-5/+6
|
* (nw) Fixed the build. Robbbert2017-08-131-6/+3
|
* Move static data out of devices into the device types. This is a ↵ Vas Crabb2017-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | significant change, so please pay attention. The core changes are: * Short name, full name and source file are no longer members of device_t, they are part of the device type * MACHINE_COFIG_START no longer needs a driver class * MACHINE_CONFIG_DERIVED_CLASS is no longer necessary * Specify the state class you want in the GAME/COMP/CONS line * The compiler will work out the base class where the driver init member is declared * There is one static device type object per driver rather than one per machine configuration Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type. * DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders. * DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type. Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types. * These macros declare storage for the static data, and instantiate the device type and device finder templates. The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate. Things I've actually messed with substantially: * More descriptive names for a lot of devices * Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes * Changed DECO BSMT2000 ready callback into a device delegate * Untangled Microprose 3D noise from driver state * Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices * Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly * Started to break out common parts of Samsung ARM SoC devices * Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++ * Tried to make Z180 table allocation/setup a bit safer * Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant * Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size * Imporved encapsulation of Z80DART channels * Refactored the SPC7110 bit table generator loop to make it more readable * Added wrappers for SNES PPU operations so members can be made protected * Factored out some boilerplate for YM chips with PSG * toaplan2 gfx * stic/intv resolution * Video System video * Out Run/Y-board sprite alignment * GIC video hookup * Amstrad CPC ROM box members * IQ151 ROM cart region * MSX cart IRQ callback resolution time * SMS passthrough control devices starting subslots I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo). And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros. It feels like an uphill battle trying to get this stuff under control while more of it's added.
* 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-105/+20
|
* Change cached texture format to floating point. Westley M. Martinez2017-01-041-14/+14
| | | | | | | | | | | | 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.
* Correct LCD ghosting INI and slider defaults. Westley M. Martinez2017-01-031-2/+2
|
* Add LCD ghosting shader for Direct3D Westley M. Martinez2017-01-021-21/+72
| | | | | | | | | | | | | | | | | hlsl/ghosting.fx: Add LCD ghosting shader hlsl/phosphor.fx: Remove LCD logic ini/presets/gameboy.ini, ini/presets/gba.ini, ini/presets/lcd-matrix.ini, ini/presets/lcd.ini, ini/presets/raster.ini, ini/presets/vector.ini: Update presets src/osd/modules/render/d3d/d3dhlsl.cpp, src/osd/modules/render/d3d/d3dhlsl.h: Add LCD shader and sliders. Allow sliders to be adjusted for R, G, and B components. src/osd/windows/winmain.cpp, src/osd/windows/winmain.h: Add LCD ghosting options.# Please enter the commit message for your changes. Lines starting
* Scale and phosphor persistence sliders. Westley M. Martinez2016-12-301-17/+9
| | | | | | | | | | hlsl/phosphor.fx: Scale parameter into tau or gamma. src/osd/modules/render/d3d/d3dhlsl.cpp: src/osd/modules/render/d3d/d3dhlsl.h: src/osd/windows/winmain.cpp: src/osd/windows/winmain.h: Combine tau and beta sliders into one slider labeled 'Time Constant'.
* Implement LCD persistence shader. Westley M. Martinez2016-12-291-2/+17
| | | | | | | | | | | | | | | | hlsl/phosphor.fx: Do LCD persistence effect using boolean LCD. LCD persistence is monochrome and thus does not have separate components like phosphor persistence. src/osd/modules/render/d3d/d3dhlsl.cpp: Add slider for LCD games. src/osd/modules/render/d3d/d3dhlsl.h: (BP) Add options for LCD games. src/osd/windows/winmain.cpp: (BP) Add options for LCD games. src/osd/windows/winmain.h: (BP) Add options for LCD games.