Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,14 @@
/* The number of nits that paper white is at */
#define DEFAULT_VIDEO_HDR_PAPER_WHITE_NITS 200.0f

/* The contrast setting for hdr used to calculate the display gamma by dividing this value by gamma 2.2 */
#define DEFAULT_VIDEO_HDR_CONTRAST 5.0f

/* Should we expand the colour gamut when using hdr */
#define DEFAULT_VIDEO_HDR_EXPAND_GAMUT true
#define DEFAULT_VIDEO_HDR_EXPAND_GAMUT false

/* Enable a basic HDR scanline implementation which is the main reason for using HDR in RetroArch */
#define DEFAULT_VIDEO_HDR_SCANLINES true

/* Default to the largely standard RGB layout */
#define DEFAULT_VIDEO_HDR_SUBPIXEL_LAYOUT 0

/* When presets are saved they will be saved using the #reference
* directive by default */
Expand Down
3 changes: 2 additions & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,7 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("video_fullscreen", &settings->bools.video_fullscreen, true, DEFAULT_FULLSCREEN, false);
SETTING_BOOL("video_hdr_enable", &settings->bools.video_hdr_enable, true, DEFAULT_VIDEO_HDR_ENABLE, false);
SETTING_BOOL("video_hdr_expand_gamut", &settings->bools.video_hdr_expand_gamut, true, DEFAULT_VIDEO_HDR_EXPAND_GAMUT, false);
SETTING_BOOL("video_hdr_scanlines", &settings->bools.video_hdr_scanlines, true, DEFAULT_VIDEO_HDR_SCANLINES, false);
SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, DEFAULT_VSYNC, false);
SETTING_BOOL("video_adaptive_vsync", &settings->bools.video_adaptive_vsync, true, DEFAULT_ADAPTIVE_VSYNC, false);
SETTING_BOOL("video_hard_sync", &settings->bools.video_hard_sync, true, DEFAULT_HARD_SYNC, false);
Expand Down Expand Up @@ -2366,7 +2367,6 @@ static struct config_float_setting *populate_settings_float(
SETTING_FLOAT("video_msg_bgcolor_opacity", &settings->floats.video_msg_bgcolor_opacity, true, DEFAULT_MESSAGE_BGCOLOR_OPACITY, false);
SETTING_FLOAT("video_hdr_max_nits", &settings->floats.video_hdr_max_nits, true, DEFAULT_VIDEO_HDR_MAX_NITS, false);
SETTING_FLOAT("video_hdr_paper_white_nits", &settings->floats.video_hdr_paper_white_nits, true, DEFAULT_VIDEO_HDR_PAPER_WHITE_NITS, false);
SETTING_FLOAT("video_hdr_display_contrast", &settings->floats.video_hdr_display_contrast, true, DEFAULT_VIDEO_HDR_CONTRAST, false);

SETTING_FLOAT("input_axis_threshold", &settings->floats.input_axis_threshold, true, DEFAULT_AXIS_THRESHOLD, false);
SETTING_FLOAT("input_analog_deadzone", &settings->floats.input_analog_deadzone, true, DEFAULT_ANALOG_DEADZONE, false);
Expand Down Expand Up @@ -2558,6 +2558,7 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("video_record_scale_factor", &settings->uints.video_record_scale_factor, true, 1, false);
SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false);

SETTING_UINT("video_hdr_subpixel_layout", &settings->uints.video_hdr_subpixel_layout, true, DEFAULT_VIDEO_HDR_SUBPIXEL_LAYOUT, false);
#ifdef HAVE_NETWORKING
SETTING_UINT("streaming_mode", &settings->uints.streaming_mode, true, STREAMING_MODE_TWITCH, false);
#endif
Expand Down
4 changes: 3 additions & 1 deletion configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ typedef struct settings
unsigned video_bfi_dark_frames;
unsigned video_shader_subframes;
unsigned video_autoswitch_refresh_rate;
unsigned video_hdr_subpixel_layout;

unsigned quit_on_close_content;

#ifdef HAVE_LAKKA
Expand Down Expand Up @@ -423,7 +425,6 @@ typedef struct settings
float video_msg_bgcolor_opacity;
float video_hdr_max_nits;
float video_hdr_paper_white_nits;
float video_hdr_display_contrast;

float menu_scale_factor;
float menu_widget_scale_factor;
Expand Down Expand Up @@ -685,6 +686,7 @@ typedef struct settings
bool video_notch_write_over_enable;
bool video_hdr_enable;
bool video_hdr_expand_gamut;
bool video_hdr_scanlines;
bool video_use_metal_arg_buffers;

/* Accessibility */
Expand Down
23 changes: 17 additions & 6 deletions gfx/common/dxgi_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ RETRO_BEGIN_DECLS
typedef struct ALIGN(16)
{
math_matrix_4x4 mvp;
float contrast; /* 2.0f */
float paper_white_nits; /* 200.0f */
float max_nits; /* 1000.0f */
float expand_gamut; /* 1.0f */
float inverse_tonemap; /* 1.0f */
float hdr10; /* 1.0f */
struct
{
float width;
float height;
} source_size;
struct
{
float width;
float height;
} output_size;
float paper_white_nits; /* 200.0f */
float max_nits; /* 1000.0f */
unsigned subpixel_layout; /* 0 */
float scanlines; /* 1.0f */
float expand_gamut; /* 0.0f */
float inverse_tonemap; /* 1.0f */
float hdr10; /* 1.0f */
} dxgi_hdr_uniform_t;

enum dxgi_swapchain_bit_depth
Expand Down
2 changes: 0 additions & 2 deletions gfx/common/vulkan_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

#define VULKAN_DIRTY_DYNAMIC_BIT 0x0001

#define VULKAN_HDR_SWAPCHAIN

#include "vksym.h"

#include <boolean.h>
Expand Down
5 changes: 3 additions & 2 deletions gfx/drivers/caca_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,9 @@ static const video_poke_interface_t caca_poke_interface = {
NULL, /* get_hw_render_interface */
NULL, /* set_hdr_max_nits */
NULL, /* set_hdr_paper_white_nits */
NULL, /* set_hdr_contrast */
NULL /* set_hdr_expand_gamut */
NULL, /* set_hdr_expand_gamut */
NULL, /* set_hdr_scanlines */
NULL /* set_hdr_subpixel_layout */
};

static void caca_get_poke_interface(void *data,
Expand Down
5 changes: 3 additions & 2 deletions gfx/drivers/ctr_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2988,8 +2988,9 @@ static const video_poke_interface_t ctr_poke_interface = {
NULL, /* get_hw_render_interface */
NULL, /* set_hdr_max_nits */
NULL, /* set_hdr_paper_white_nits */
NULL, /* set_hdr_contrast */
NULL /* set_hdr_expand_gamut */
NULL, /* set_hdr_expand_gamut */
NULL, /* set_hdr_scanlines */
NULL /* set_hdr_subpixel_layout */
};

static void ctr_get_poke_interface(void* data,
Expand Down
5 changes: 3 additions & 2 deletions gfx/drivers/d3d10.c
Original file line number Diff line number Diff line change
Expand Up @@ -3276,8 +3276,9 @@ static const video_poke_interface_t d3d10_poke_interface = {
#endif
NULL, /* set_hdr_max_nits */
NULL, /* set_hdr_paper_white_nits */
NULL, /* set_hdr_contrast */
NULL /* set_hdr_expand_gamut */
NULL, /* set_hdr_expand_gamut */
NULL, /* set_hdr_scanlines */
NULL /* set_hdr_subpixel_layout */
};

static void d3d10_gfx_get_poke_interface(void* data, const video_poke_interface_t** iface)
Expand Down
Loading
Loading