summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/d3d/d3dhlsl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Implement new phosphor shader. Westley M. Martinez2016-12-291-10/+37
| | | | | | | | | | | | | | | | | hlsl/phosphor.fx: Make changes to the pixel shader. New uniforms: Mode, Tau, Beta, Gamma. Remove Phosphor. Mode selects the mode for phosphor simulation: off (no decay), exponential, inverse power. Tau is the time constant for exp. decay. Beta and Gamma are constants for inv-pow. src/osd/modules/render/d3d/d3dhlsl.cpp: Provide uniforms and add sliders for new options. src/osd/modules/render/d3d/d3dhlsl.h: (BP) Provide new options. src/osd/windows/winmain.cpp: (BP) Provide new options. src/osd/windows/winmain.h: (BP) Provide new options.
* Simplify implementation of delta_time. Westley M. Martinez2016-12-131-25/+15
| | | | | | | src/osd/modules/render/d3d/d3dhlsl.cpp: Move time members calculation to shaders::begin_draw. src/osd/modules/render/d3d/d3dhlsl.h: Remove update_t.
* Add signal so that any future shaders relying on delta_time do not Westley M. Martinez2016-12-121-10/+13
| | | | | | | | | interfere with each other. src/osd/modules/render/d3d/d3dhlsl.cpp: update_t flag is reset for each emulated screen 0. src/ods/modules/render/d3d/d3dhlsl.h: Add update_t.
* Fix phosphor shader to work properly for multi-screen games and Westley M. Martinez2016-12-121-16/+22
| | | | | | | | | | | | | | multi-window use. hlsl/phosphor.fx: Update semantics. src/osd/modules/render/d3d/d3dhlsl.cpp: Implement shaders::delta_time member function. src/osd/modules/render/d3d/d3dhlsl.h: Add acc_t and delta_t members for use by shaders::delta_time. Member function returns the amount of time since itself has been called, for use by time-dependent shaders.
* Remove iostream (used for debugging) Westley M. Martinez2016-12-111-1/+0
|
* Fix phosphor persistence shader behavior based on time. Westley M. Martinez2016-12-111-0/+10
| | | | | | | | | hlsl/phosphor.fx: Add calculation time passed to be used by shader. src/osd/modules/render/d3d/d3dhlsl.cpp: Make pixel shader calculate the current pixel by factoring in the amount of time which has passed since the last rendering.
* Small cleanup (nw) Miodrag Milanovic2016-11-111-2/+2
|
* hlsl: fixed games with off-screen backdrop artworks ImJezze2016-11-021-0/+4
| | | | - e.g. atarifb, bowler
* Reduced defocus effect to one pass (HLSL/BGFX) Jezze2016-10-221-5/+3
| | | | | - removed second defocus pass - limited defocus stength to a maximum of 2.0
* Disabled clearing of render targets in several passes (HLSL) Jezze2016-10-221-30/+17
| | | | - which was quite a performance overhead and not necessary because the shaders fill every texel of a target without blending
* Refactored d3d_render_target (nw) Jezze2016-10-221-157/+61
| | | | | | | * 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
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-21/+21
| | | | | 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
* Bulk renaming of Windows string conversion functions Nathan Woods2016-10-031-1/+1
| | | | | utf8_from_[a|w|t]string ==> osd::text::from_[a|w|t]string [a|w|t]string_from_utf8 ==> osd::text::to_[a|w|t]string
* use floorf rather than floor for float->float Vas Crabb2016-09-281-2/+2
|
* Fixed several small issues in HLSL/BGFX Jezze2016-09-281-27/+45
| | | | | | * 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)
* for bool type use true and false (nw) Miodrag Milanovic2016-07-311-14/+14
|
* 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-4/+6
| | | | to inline functions (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-3/+3
|
* Changed strconv.[cpp|h] functions to return their results as std::string and ↵ Nathan Woods2016-07-241-4/+2
| | | | std::wstring
* Fixed MT #6291 ImJezze2016-07-161-8/+26
| | | | | | | | * 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
* Fixed dimension of high-res snapshots (Alt + 12) and AVI records (Alt + ↵ ImJezze2016-07-161-6/+33
| | | | Shift + F12) when screen dimension is swapped
* Patch up d3dhlsl as well (nw) Vas Crabb2016-07-071-3/+3
|
* Remove bgfx_avi_name and hlsl_write options Giuseppe Gorgoglione2016-07-041-11/+5
| | | | | | Now the filenames for movies recorded by HLSL and BGFX renderers are automatically generated just like the ones for movies and snapshots recorded by the video core. They are generated according to the "snapname" template (eg. by default <snap_folder>/<device_name>/<numeric_index.avi>, so you can revert to the old behavior (why?) just setting "snapname bgfx.avi" or "snapname hlsl.avi". The main advantage is that now you can record as many movies as you want during a single gaming session without much hassle (previously you had to move or rename the old movie file by hand before recording a new one).
* Direct3D HLSL: use aviwrite to record avi movies Giuseppe Gorgoglione2016-07-041-314/+154
| | | | | | | | Use common infrastructure in aviwrite.c instead of equivalent local code. In addition: - the target textures used by the HLSL movie recorder are now allocated only when recording is ongoing - removed shaders->begin_frame() and shaders->end_frame() hooks from the main Direct3D rendering loop - set default HLSL movie name to hlsl.avi to match bgfx.avi setting