From 62427de0928c76fcd9bec2f76b0fd8551bb5fd87 Mon Sep 17 00:00:00 2001 From: elasota Date: Fri, 3 Jul 2020 13:53:10 -0400 Subject: [PATCH] Add ICC profile option --- ApplicationResourcePatches/DITL/1017.json | 30 ++-- CompileShadersD3D11/CompileShadersD3D11.cpp | 29 ++++ GpApp/Environ.cpp | 4 +- GpApp/Externs.h | 4 +- GpApp/Main.cpp | 7 +- GpApp/Settings.cpp | 36 ++++- GpCommon/IGpDisplayDriver.h | 2 + .../DrawQuad15BitP_ICC_D3D11.cpp | 52 +++++++ .../DrawQuadPaletteP_D3D11.cpp | 48 +++--- .../DrawQuadPaletteP_ICC_D3D11.cpp | 143 ++++++++++++++++++ .../CompiledShaders/DrawQuadRGBP_D3D11.cpp | 52 ++++--- .../DrawQuadRGBP_ICC_D3D11.cpp | 135 +++++++++++++++++ .../GpDisplayDriverD3D11.cpp | 27 +++- GpDisplayDriver_D3D11/GpDisplayDriverD3D11.h | 7 + .../GpDisplayDriver_D3D11.vcxproj | 3 + .../GpDisplayDriver_D3D11.vcxproj.filters | 9 ++ ShaderSrc/DrawQuadPaletteP.hlsl | 2 +- ShaderSrc/DrawQuadRGBP.hlsl | 2 +- ShaderSrc/Functions.h | 9 ++ 19 files changed, 526 insertions(+), 75 deletions(-) create mode 100644 GpDisplayDriver_D3D11/CompiledShaders/DrawQuad15BitP_ICC_D3D11.cpp create mode 100644 GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_ICC_D3D11.cpp create mode 100644 GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_ICC_D3D11.cpp diff --git a/ApplicationResourcePatches/DITL/1017.json b/ApplicationResourcePatches/DITL/1017.json index 55242d5..7e013ba 100644 --- a/ApplicationResourcePatches/DITL/1017.json +++ b/ApplicationResourcePatches/DITL/1017.json @@ -65,18 +65,10 @@ "id" : 0, "enabled" : false }, - { - "name" : "Beautiful opening color fade", - "itemType" : "CheckBox", - "pos" : [ 8, 142 ], - "size" : [ 256, 18 ], - "id" : 0, - "enabled" : true - }, { "name" : "32-bit color (Requires restart)", "itemType" : "CheckBox", - "pos" : [ 8, 162 ], + "pos" : [ 8, 85 ], "size" : [ 256, 18 ], "id" : 0, "enabled" : true @@ -84,7 +76,23 @@ { "name" : "Adjust resolution to fit window", "itemType" : "CheckBox", - "pos" : [ 8, 182 ], + "pos" : [ 8, 105 ], + "size" : [ 256, 18 ], + "id" : 0, + "enabled" : true + }, + { + "name" : "Simulate Apple RGB monitor", + "itemType" : "CheckBox", + "pos" : [ 8, 125 ], + "size" : [ 256, 18 ], + "id" : 0, + "enabled" : true + }, + { + "name" : "Beautiful opening color fade", + "itemType" : "CheckBox", + "pos" : [ 8, 152 ], "size" : [ 256, 18 ], "id" : 0, "enabled" : true @@ -92,7 +100,7 @@ { "name" : "", "itemType" : "UserItem", - "pos" : [ 8, 137 ], + "pos" : [ 8, 147 ], "size" : [ 317, 1 ], "id" : 0, "enabled" : false diff --git a/CompileShadersD3D11/CompileShadersD3D11.cpp b/CompileShadersD3D11/CompileShadersD3D11.cpp index 6ba430b..dd35698 100644 --- a/CompileShadersD3D11/CompileShadersD3D11.cpp +++ b/CompileShadersD3D11/CompileShadersD3D11.cpp @@ -19,6 +19,11 @@ const D3D_SHADER_MACRO drawQuadDefs[] = { nullptr } }; +const D3D_SHADER_MACRO drawQuadICCProfileDefs[] = +{ + { "USE_ICC_PROFILE", nullptr } +}; + const CompileJob kCompileJobs[] = { { @@ -37,6 +42,14 @@ const CompileJob kCompileJobs[] = "PSMain", "ps_4_0" }, + { + L"ShaderSrc\\DrawQuadRGBP.hlsl", + L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadRGBP_ICC_D3D11.cpp", + "g_drawQuadRGBICCP_D3D11", + drawQuadICCProfileDefs, + "PSMain", + "ps_4_0" + }, { L"ShaderSrc\\DrawQuadPaletteP.hlsl", L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadPaletteP_D3D11.cpp", @@ -45,6 +58,14 @@ const CompileJob kCompileJobs[] = "PSMain", "ps_4_0" }, + { + L"ShaderSrc\\DrawQuadPaletteP.hlsl", + L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuadPaletteP_ICC_D3D11.cpp", + "g_drawQuadPaletteICCP_D3D11", + drawQuadICCProfileDefs, + "PSMain", + "ps_4_0" + }, { L"ShaderSrc\\DrawQuad15BitP.hlsl", L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuad15BitP_D3D11.cpp", @@ -53,6 +74,14 @@ const CompileJob kCompileJobs[] = "PSMain", "ps_4_0" }, + { + L"ShaderSrc\\DrawQuad15BitP.hlsl", + L"GpDisplayDriver_D3D11\\CompiledShaders\\DrawQuad15BitP_ICC_D3D11.cpp", + "g_drawQuad15BitICCP_D3D11", + drawQuadICCProfileDefs, + "PSMain", + "ps_4_0" + }, { L"ShaderSrc\\ScaleQuadP.hlsl", L"GpDisplayDriver_D3D11\\CompiledShaders\\ScaleQuadP_D3D11.cpp", diff --git a/GpApp/Environ.cpp b/GpApp/Environ.cpp index 21750d7..60bcc90 100644 --- a/GpApp/Environ.cpp +++ b/GpApp/Environ.cpp @@ -31,7 +31,7 @@ #define kDisplay12Inch 2 #define kDisplay13Inch 3 -extern Boolean isAutoScale; +extern Boolean isAutoScale, isUseICCProfile; typedef struct @@ -412,6 +412,8 @@ void HandleDepthSwitching (void) } thisMac.isDepth = isDepthPref; + + PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile != 0); } //-------------------------------------------------------------- CheckMemorySize diff --git a/GpApp/Externs.h b/GpApp/Externs.h index 3717c7a..fe5a51c 100644 --- a/GpApp/Externs.h +++ b/GpApp/Externs.h @@ -118,6 +118,7 @@ typedef struct Boolean wasDoAutoDemo, wasAutoScale; Boolean wasDoBackground, wasHouseChecks; Boolean wasPrettyMap, wasBitchDialogs; + Boolean wasUseICCProfile; } prefsInfo; //-------------------------------------------------------------- Prototypes @@ -230,7 +231,8 @@ void CloseThisWindow (WindowPtr *); // THREEWORDINLINE(0x4218, 0x10B8, 0x0260); #endif - extern Boolean hasScrap, scrapIsARoom; + +extern Boolean hasScrap, scrapIsARoom; #include "GliderDefines.h" #include "GliderStructs.h" diff --git a/GpApp/Main.cpp b/GpApp/Main.cpp index d573f8a..1710b8c 100644 --- a/GpApp/Main.cpp +++ b/GpApp/Main.cpp @@ -15,7 +15,7 @@ #include "WindowManager.h" -#define kPrefsVersion 0x0037 +#define kPrefsVersion 0x0038 void ReadInPrefs (void); @@ -25,7 +25,7 @@ int main(int argc, const char **argv); short isVolume, wasVolume; short isDepthPref, dataResFile, numSMWarnings; -Boolean quitting, doZooms, quickerTransitions, isAutoScale; +Boolean quitting, doZooms, quickerTransitions, isAutoScale, isUseICCProfile; extern Str31 highBanner; @@ -127,6 +127,7 @@ void ReadInPrefs (void) doAutoDemo = thePrefs.wasDoAutoDemo; isEscPauseKey = thePrefs.wasEscPauseKey; isAutoScale = thePrefs.wasAutoScale; + isUseICCProfile = thePrefs.wasUseICCProfile; doBackground = thePrefs.wasDoBackground; doPrettyMap = thePrefs.wasPrettyMap; doBitchDialogs = thePrefs.wasBitchDialogs; @@ -209,6 +210,7 @@ void ReadInPrefs (void) doAutoDemo = true; isEscPauseKey = false; isAutoScale = true; + isUseICCProfile = true; doBackground = false; doPrettyMap = false; doBitchDialogs = true; @@ -303,6 +305,7 @@ void WriteOutPrefs (void) thePrefs.wasDoAutoDemo = doAutoDemo; thePrefs.wasEscPauseKey = isEscPauseKey; thePrefs.wasAutoScale = isAutoScale; + thePrefs.wasUseICCProfile = isUseICCProfile; thePrefs.wasDoBackground = doBackground; thePrefs.wasPrettyMap = doPrettyMap; thePrefs.wasBitchDialogs = doBitchDialogs; diff --git a/GpApp/Settings.cpp b/GpApp/Settings.cpp index f6494d6..34eb73b 100644 --- a/GpApp/Settings.cpp +++ b/GpApp/Settings.cpp @@ -27,6 +27,8 @@ #define kSoundPrefsDialID 1018 #define kControlPrefsDialID 1023 #define kBrainsPrefsDialID 1024 + +// Display dialog #define kDisplayButton 3 #define kSoundButton 4 #define kControlsButton 5 @@ -35,18 +37,23 @@ #define kDisplay3Item 4 #define kDisplay9Item 5 #define kBorder1Item 8 -#define kDoColorFadeItem 9 -#define k32BitColorItem 10 -#define kScaleResolutionItem 11 -#define kBorder2Item 12 -#define kBorder3Item 13 -#define kDispDefault 14 +#define k32BitColorItem 9 +#define kScaleResolutionItem 10 +#define kUseICCProfileItem 11 +#define kDoColorFadeItem 12 +#define kBorder2Item 13 +#define kBorder3Item 14 +#define kDispDefault 15 + +// Sound dialog #define kSofterItem 4 #define kLouderItem 5 #define kVolNumberItem 7 #define kIdleMusicItem 8 #define kPlayMusicItem 9 #define kSoundDefault 13 + +// Controls dialog #define kRightControl 5 #define kLeftControl 6 #define kBattControl 7 @@ -54,6 +61,8 @@ #define kControlDefaults 13 #define kESCPausesRadio 14 #define kTABPausesRadio 15 + +// Brains dialog #define kMaxFilesItem 5 #define kQuickTransitCheck 7 #define kDoZoomsCheck 8 @@ -97,11 +106,11 @@ Str15 tempLeftStr, tempRightStr, tempBattStr, tempBandStr; long tempLeftMap, tempRightMap, tempBattMap, tempBandMap; short whichCtrl, wasDepthPref; Boolean wasFade, wasIdle, wasPlay, wasTransit, wasZooms, wasBackground; -Boolean wasEscPauseKey, wasDemos, wasAutoScale, nextRestartChange, wasErrorCheck, needResolutionReset; +Boolean wasEscPauseKey, wasDemos, wasAutoScale, wasUseICCProfile, nextRestartChange, wasErrorCheck, needResolutionReset; Boolean wasPrettyMap, wasBitchDialogs; extern short numNeighbors, isDepthPref, maxFiles, willMaxFiles; -extern Boolean isDoColorFade, isPlayMusicIdle, isAutoScale; +extern Boolean isDoColorFade, isPlayMusicIdle, isAutoScale, isUseICCProfile; extern Boolean isHouseChecks, doBitchDialogs; extern Boolean isEscPauseKey, failedMusic, isSoundOn, doBackground; extern Boolean isMusicOn, quickerTransitions, doAutoDemo; @@ -861,6 +870,7 @@ void DisplayDefaults (void) wasDepthPref = kSwitchIfNeeded; wasFade = true; wasAutoScale = true; + wasUseICCProfile = true; } //-------------------------------------------------------------- FrameDisplayIcon @@ -906,6 +916,7 @@ void DisplayUpdate (Dialog *theDialog) SetDialogItemValue(theDialog, kDoColorFadeItem, (short)wasFade); SetDialogItemValue(theDialog, k32BitColorItem, wasDepthPref == 32); SetDialogItemValue(theDialog, kScaleResolutionItem, (short)isAutoScale); + SetDialogItemValue(theDialog, kUseICCProfileItem, (short)isUseICCProfile); FrameDisplayIcon(theDialog, StdColors::Red()); FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8); @@ -1005,6 +1016,7 @@ void DoDisplayPrefs (void) wasFade = isDoColorFade; wasDepthPref = isDepthPref; wasAutoScale = isAutoScale; + wasUseICCProfile = isUseICCProfile; leaving = false; DisplayUpdate(prefDlg); @@ -1022,6 +1034,7 @@ void DoDisplayPrefs (void) needResolutionReset = true; isDepthPref = wasDepthPref; isAutoScale = wasAutoScale; + isUseICCProfile = wasUseICCProfile; leaving = true; break; @@ -1072,6 +1085,11 @@ void DoDisplayPrefs (void) SetDialogItemValue(prefDlg, kScaleResolutionItem, (short)wasAutoScale); break; + case kUseICCProfileItem: + wasUseICCProfile = !wasUseICCProfile; + SetDialogItemValue(prefDlg, kUseICCProfileItem, (short)wasUseICCProfile); + break; + case kDispDefault: FrameDisplayIcon(prefDlg, StdColors::White()); DisplayDefaults(); @@ -1321,6 +1339,8 @@ void DoSettingsMain (void) PortabilityLayer::HostDisplayDriver::GetInstance()->RequestResetVirtualResolution(); needResolutionReset = false; } + + PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile); } //-------------------------------------------------------------- BitchAboutChanges diff --git a/GpCommon/IGpDisplayDriver.h b/GpCommon/IGpDisplayDriver.h index e5439d2..98c7b36 100644 --- a/GpCommon/IGpDisplayDriver.h +++ b/GpCommon/IGpDisplayDriver.h @@ -42,6 +42,8 @@ public: virtual void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) = 0; virtual void SetBackgroundDarkenEffect(bool isDark) = 0; + virtual void SetUseICCProfile(bool useICCProfile) = 0; + virtual void RequestToggleFullScreen(uint32_t timestamp) = 0; virtual void RequestResetVirtualResolution() = 0; diff --git a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuad15BitP_ICC_D3D11.cpp b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuad15BitP_ICC_D3D11.cpp new file mode 100644 index 0000000..1f0fec1 --- /dev/null +++ b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuad15BitP_ICC_D3D11.cpp @@ -0,0 +1,52 @@ +static unsigned char gs_shaderData[] = { + 68, 88, 66, 67, 181, 133, 124, 121, 179, 141, 64, 216, 166, 21, 153, + 10, 33, 21, 80, 169, 1, 0, 0, 0, 152, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, 224, 0, 0, 0, 56, 1, 0, 0, 108, + 1, 0, 0, 28, 2, 0, 0, 82, 68, 69, 70, 164, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, + 0, 0, 4, 255, 255, 0, 137, 0, 0, 122, 0, 0, 0, 92, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 107, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, + 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, + 0, 0, 115, 117, 114, 102, 97, 99, 101, 83, 97, 109, 112, 108, 101, + 114, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114, + 101, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, + 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, 32, 49, 48, 46, 49, 0, 171, 171, 73, + 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, + 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, + 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, + 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, + 84, 0, 171, 171, 83, 72, 68, 82, 168, 0, 0, 0, 64, 0, 0, + 0, 42, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, + 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, + 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, + 2, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0, + 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, + 18, 32, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, + 0, 54, 0, 0, 5, 98, 32, 16, 0, 0, 0, 0, 0, 6, 17, + 16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, + 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 62, 0, 0, 1, + 83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, +}; + +namespace GpBinarizedShaders +{ + const unsigned char *g_drawQuad15BitICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) }; +}; diff --git a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_D3D11.cpp b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_D3D11.cpp index 330eecd..3bab0c0 100644 --- a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_D3D11.cpp +++ b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_D3D11.cpp @@ -1,8 +1,8 @@ static unsigned char gs_shaderData[] = { - 68, 88, 66, 67, 22, 132, 178, 62, 124, 31, 180, 122, 2, 1, 47, - 236, 0, 128, 56, 7, 1, 0, 0, 0, 240, 7, 0, 0, 5, 0, + 68, 88, 66, 67, 167, 218, 15, 90, 211, 69, 240, 219, 76, 79, 17, + 242, 61, 175, 125, 206, 1, 0, 0, 0, 44, 8, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 172, 2, 0, 0, 4, 3, 0, 0, 56, - 3, 0, 0, 116, 7, 0, 0, 82, 68, 69, 70, 112, 2, 0, 0, + 3, 0, 0, 176, 7, 0, 0, 82, 68, 69, 70, 112, 2, 0, 0, 1, 0, 0, 0, 180, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 137, 0, 0, 72, 2, 0, 0, 124, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 255, @@ -54,7 +54,7 @@ static unsigned char gs_shaderData[] = { 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, - 72, 68, 82, 52, 4, 0, 0, 64, 0, 0, 0, 13, 1, 0, 0, + 72, 68, 82, 112, 4, 0, 0, 64, 0, 0, 0, 28, 1, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 68, 68, 0, 0, 88, 16, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85, @@ -107,32 +107,36 @@ static unsigned char gs_shaderData[] = { 0, 26, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 226, 0, 16, 0, 1, 0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0, - 1, 0, 0, 0, 86, 5, 16, 0, 1, 0, 0, 0, 55, 32, 0, + 1, 0, 0, 0, 86, 5, 16, 0, 1, 0, 0, 0, 55, 0, 0, 9, 114, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0, 0, 150, 7, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, - 0, 0, 0, 47, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, + 0, 0, 0, 29, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 230, 174, 37, 61, 230, 174, 37, 61, 230, 174, 37, + 61, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, 2, 0, 0, 0, 70, 2, 16, 0, 0, + 0, 0, 0, 2, 64, 0, 0, 145, 131, 158, 61, 145, 131, 158, 61, + 145, 131, 158, 61, 0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, - 0, 0, 102, 102, 230, 63, 102, 102, 230, 63, 102, 102, 230, 63, 0, - 0, 0, 0, 25, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, - 0, 1, 0, 0, 0, 86, 5, 16, 0, 0, 0, 0, 0, 2, 64, - 0, 0, 150, 246, 160, 189, 43, 199, 117, 63, 40, 177, 243, 60, 0, - 0, 0, 0, 50, 0, 0, 12, 114, 0, 16, 0, 1, 0, 0, 0, - 6, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 87, 203, 136, - 63, 86, 131, 197, 60, 225, 104, 227, 58, 0, 0, 0, 0, 70, 2, - 16, 0, 1, 0, 0, 0, 50, 0, 0, 12, 114, 32, 16, 0, 0, - 0, 0, 0, 166, 10, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, - 5, 9, 34, 60, 158, 151, 129, 60, 194, 240, 119, 63, 0, 0, 0, - 0, 70, 2, 16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, + 0, 0, 174, 71, 97, 61, 174, 71, 97, 61, 174, 71, 97, 61, 0, + 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 110, 167, 114, + 63, 110, 167, 114, 63, 110, 167, 114, 63, 0, 0, 0, 0, 47, 0, + 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, + 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 154, 153, 25, + 64, 154, 153, 25, 64, 154, 153, 25, 64, 0, 0, 0, 0, 25, 0, + 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, + 0, 0, 0, 55, 0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, + 0, 70, 2, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, - 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 32, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, + 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 34, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, - 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; diff --git a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_ICC_D3D11.cpp b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_ICC_D3D11.cpp new file mode 100644 index 0000000..ac4ab75 --- /dev/null +++ b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadPaletteP_ICC_D3D11.cpp @@ -0,0 +1,143 @@ +static unsigned char gs_shaderData[] = { + 68, 88, 66, 67, 63, 150, 199, 197, 210, 83, 220, 166, 163, 78, 42, + 252, 31, 18, 160, 91, 1, 0, 0, 0, 240, 7, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, 172, 2, 0, 0, 4, 3, 0, 0, 56, + 3, 0, 0, 116, 7, 0, 0, 82, 68, 69, 70, 112, 2, 0, 0, + 1, 0, 0, 0, 180, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, + 0, 0, 4, 255, 255, 0, 137, 0, 0, 72, 2, 0, 0, 124, 0, + 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 139, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, + 0, 255, 255, 255, 255, 1, 0, 0, 0, 1, 0, 0, 0, 13, 0, + 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, + 117, 114, 101, 0, 112, 97, 108, 101, 116, 116, 101, 84, 101, 120, 116, + 117, 114, 101, 0, 83, 68, 114, 97, 119, 81, 117, 97, 100, 80, 105, + 120, 101, 108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 171, + 154, 0, 0, 0, 6, 0, 0, 0, 204, 0, 0, 0, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 116, 1, 0, 0, 0, + 0, 0, 0, 132, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, + 2, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 172, 1, 0, + 0, 24, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 204, 1, + 0, 0, 0, 0, 0, 0, 220, 1, 0, 0, 28, 0, 0, 0, 4, + 0, 0, 0, 2, 0, 0, 0, 204, 1, 0, 0, 0, 0, 0, 0, + 250, 1, 0, 0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 20, 2, 0, 0, 0, 0, 0, 0, 36, 2, 0, 0, 36, 0, + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 56, 2, 0, 0, 0, + 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, 116, 115, 95, 77, 111, + 100, 117, 108, 97, 116, 105, 111, 110, 0, 171, 171, 171, 1, 0, 3, + 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, + 110, 115, 116, 97, 110, 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, + 65, 120, 105, 115, 0, 171, 171, 1, 0, 2, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, + 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 83, 116, 97, 114, 116, + 84, 104, 114, 101, 115, 104, 111, 108, 100, 0, 0, 0, 2, 0, 1, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, + 116, 97, 110, 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 69, 110, + 100, 84, 104, 114, 101, 115, 104, 111, 108, 100, 0, 99, 111, 110, 115, + 116, 97, 110, 116, 115, 95, 68, 101, 115, 97, 116, 117, 114, 97, 116, + 105, 111, 110, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, + 116, 115, 95, 85, 110, 117, 115, 101, 100, 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, + 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, + 108, 101, 114, 32, 49, 48, 46, 49, 0, 73, 83, 71, 78, 80, 0, + 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, + 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, + 72, 68, 82, 52, 4, 0, 0, 64, 0, 0, 0, 13, 1, 0, 0, + 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 68, 68, + 0, 0, 88, 16, 0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 85, + 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, + 2, 3, 0, 0, 0, 65, 0, 0, 5, 50, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 27, 0, 0, 5, 50, + 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, + 54, 0, 0, 8, 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70, + 14, 16, 0, 0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, + 54, 0, 0, 8, 226, 0, 16, 0, 1, 0, 0, 0, 2, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 0, 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70, + 14, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 1, 0, 0, 0, + 56, 0, 0, 9, 242, 0, 16, 0, 2, 0, 0, 0, 70, 142, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 0, 16, 0, 1, + 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 56, 0, 0, 7, + 242, 0, 16, 0, 1, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, + 0, 70, 14, 16, 0, 2, 0, 0, 0, 38, 0, 0, 9, 0, 208, + 0, 0, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, + 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 30, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, + 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 34, 0, + 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, + 0, 0, 0, 42, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 33, 0, 0, 8, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, + 0, 0, 0, 0, 0, 58, 128, 32, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 55, 0, 0, 12, 242, 0, 16, 0, 1, 0, 0, 0, 86, + 5, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 14, 16, + 0, 1, 0, 0, 0, 60, 0, 0, 7, 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, + 0, 0, 0, 55, 0, 0, 12, 242, 0, 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, + 0, 2, 64, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, 29, 0, 0, 7, 18, 0, 16, 0, 1, + 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 13, 0, 4, 3, 10, 0, 16, 0, 1, 0, 0, + 0, 57, 0, 0, 8, 18, 0, 16, 0, 1, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 10, 34, 0, 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 154, 153, 153, + 62, 154, 153, 25, 63, 205, 204, 204, 61, 0, 0, 0, 0, 0, 0, + 0, 9, 66, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 128, 65, + 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, 0, 8, 34, 0, 16, 0, 1, 0, 0, + 0, 26, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 226, 0, 16, 0, 1, + 0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 86, 5, 16, 0, 1, 0, 0, 0, 55, 32, 0, + 9, 114, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, + 0, 0, 150, 7, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, + 0, 0, 0, 47, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, + 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, + 0, 0, 102, 102, 230, 63, 102, 102, 230, 63, 102, 102, 230, 63, 0, + 0, 0, 0, 25, 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, + 0, 1, 0, 0, 0, 86, 5, 16, 0, 0, 0, 0, 0, 2, 64, + 0, 0, 150, 246, 160, 189, 43, 199, 117, 63, 40, 177, 243, 60, 0, + 0, 0, 0, 50, 0, 0, 12, 114, 0, 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 87, 203, 136, + 63, 86, 131, 197, 60, 225, 104, 227, 58, 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, 50, 32, 0, 12, 114, 32, 16, 0, 0, + 0, 0, 0, 166, 10, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, + 5, 9, 34, 60, 158, 151, 129, 60, 194, 240, 119, 63, 0, 0, 0, + 0, 70, 2, 16, 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, + 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, + 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 32, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, + 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, + 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +}; + +namespace GpBinarizedShaders +{ + const unsigned char *g_drawQuadPaletteICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) }; +}; diff --git a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_D3D11.cpp b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_D3D11.cpp index bb8da43..261990f 100644 --- a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_D3D11.cpp +++ b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_D3D11.cpp @@ -1,8 +1,8 @@ static unsigned char gs_shaderData[] = { - 68, 88, 66, 67, 79, 173, 176, 182, 205, 217, 61, 84, 80, 209, 33, - 250, 135, 89, 76, 198, 1, 0, 0, 0, 116, 7, 0, 0, 5, 0, + 68, 88, 66, 67, 55, 11, 130, 121, 223, 86, 90, 24, 177, 20, 124, + 204, 5, 205, 68, 19, 1, 0, 0, 0, 176, 7, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 8, - 3, 0, 0, 248, 6, 0, 0, 82, 68, 69, 70, 64, 2, 0, 0, + 3, 0, 0, 52, 7, 0, 0, 82, 68, 69, 70, 64, 2, 0, 0, 1, 0, 0, 0, 132, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 137, 0, 0, 24, 2, 0, 0, 92, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, @@ -51,7 +51,7 @@ static unsigned char gs_shaderData[] = { 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, 72, 68, 82, - 232, 3, 0, 0, 64, 0, 0, 0, 250, 0, 0, 0, 89, 0, 0, + 36, 4, 0, 0, 64, 0, 0, 0, 9, 1, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, @@ -99,31 +99,35 @@ static unsigned char gs_shaderData[] = { 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 50, 0, 0, 9, 226, 0, 16, 0, 1, 0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0, 1, 0, 0, 0, - 86, 5, 16, 0, 1, 0, 0, 0, 55, 32, 0, 9, 114, 0, 16, + 86, 5, 16, 0, 1, 0, 0, 0, 55, 0, 0, 9, 114, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0, 0, 150, 7, - 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 47, - 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, - 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 102, 102, - 230, 63, 102, 102, 230, 63, 102, 102, 230, 63, 0, 0, 0, 0, 25, - 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, - 0, 86, 5, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 150, 246, - 160, 189, 43, 199, 117, 63, 40, 177, 243, 60, 0, 0, 0, 0, 50, - 0, 0, 12, 114, 0, 16, 0, 1, 0, 0, 0, 6, 0, 16, 0, - 0, 0, 0, 0, 2, 64, 0, 0, 87, 203, 136, 63, 86, 131, 197, - 60, 225, 104, 227, 58, 0, 0, 0, 0, 70, 2, 16, 0, 1, 0, - 0, 0, 50, 0, 0, 12, 114, 32, 16, 0, 0, 0, 0, 0, 166, - 10, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 5, 9, 34, 60, - 158, 151, 129, 60, 194, 240, 119, 63, 0, 0, 0, 0, 70, 2, 16, - 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, + 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 29, + 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, 0, 2, 64, 0, 0, + 230, 174, 37, 61, 230, 174, 37, 61, 230, 174, 37, 61, 0, 0, 0, + 0, 70, 2, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, + 16, 0, 2, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, + 64, 0, 0, 145, 131, 158, 61, 145, 131, 158, 61, 145, 131, 158, 61, + 0, 0, 0, 0, 0, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, + 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 174, 71, + 97, 61, 174, 71, 97, 61, 174, 71, 97, 61, 0, 0, 0, 0, 56, + 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, 0, 0, 110, 167, 114, 63, 110, 167, 114, + 63, 110, 167, 114, 63, 0, 0, 0, 0, 47, 0, 0, 5, 114, 0, + 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 56, + 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, 0, 0, 154, 153, 25, 64, 154, 153, 25, + 64, 154, 153, 25, 64, 0, 0, 0, 0, 25, 0, 0, 5, 114, 0, + 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 55, + 0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 70, 2, 16, 0, 2, 0, 0, 0, 70, 2, 16, + 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, - 84, 65, 84, 116, 0, 0, 0, 30, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 4, 0, 0, + 84, 65, 84, 116, 0, 0, 0, 32, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_ICC_D3D11.cpp b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_ICC_D3D11.cpp new file mode 100644 index 0000000..eba0649 --- /dev/null +++ b/GpDisplayDriver_D3D11/CompiledShaders/DrawQuadRGBP_ICC_D3D11.cpp @@ -0,0 +1,135 @@ +static unsigned char gs_shaderData[] = { + 68, 88, 66, 67, 59, 168, 168, 88, 76, 243, 83, 77, 18, 124, 254, + 1, 241, 101, 79, 130, 1, 0, 0, 0, 116, 7, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 8, + 3, 0, 0, 248, 6, 0, 0, 82, 68, 69, 70, 64, 2, 0, 0, + 1, 0, 0, 0, 132, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, + 0, 0, 4, 255, 255, 0, 137, 0, 0, 24, 2, 0, 0, 92, 0, + 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 9, 0, 0, 0, + 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, + 0, 0, 115, 117, 114, 102, 97, 99, 101, 84, 101, 120, 116, 117, 114, + 101, 0, 83, 68, 114, 97, 119, 81, 117, 97, 100, 80, 105, 120, 101, + 108, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 171, 107, 0, 0, + 0, 6, 0, 0, 0, 156, 0, 0, 0, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 0, 2, 0, 0, 0, 68, 1, 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, + 0, 108, 1, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 24, 0, + 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 156, 1, 0, 0, 0, + 0, 0, 0, 172, 1, 0, 0, 28, 0, 0, 0, 4, 0, 0, 0, + 2, 0, 0, 0, 156, 1, 0, 0, 0, 0, 0, 0, 202, 1, 0, + 0, 32, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 36, 0, 0, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, + 99, 111, 110, 115, 116, 97, 110, 116, 115, 95, 77, 111, 100, 117, 108, + 97, 116, 105, 111, 110, 0, 171, 171, 171, 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, + 97, 110, 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 65, 120, 105, + 115, 0, 171, 171, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, 116, 115, 95, + 70, 108, 105, 99, 107, 101, 114, 83, 116, 97, 114, 116, 84, 104, 114, + 101, 115, 104, 111, 108, 100, 0, 0, 0, 2, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, + 116, 115, 95, 70, 108, 105, 99, 107, 101, 114, 69, 110, 100, 84, 104, + 114, 101, 115, 104, 111, 108, 100, 0, 99, 111, 110, 115, 116, 97, 110, + 116, 115, 95, 68, 101, 115, 97, 116, 117, 114, 97, 116, 105, 111, 110, + 0, 171, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 99, 111, 110, 115, 116, 97, 110, 116, 115, 95, + 85, 110, 117, 115, 101, 100, 0, 171, 171, 171, 1, 0, 3, 0, 1, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, + 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, + 32, 49, 48, 46, 49, 0, 73, 83, 71, 78, 80, 0, 0, 0, 2, + 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, + 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 79, + 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, + 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, + 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, 72, 68, 82, + 232, 3, 0, 0, 64, 0, 0, 0, 250, 0, 0, 0, 89, 0, 0, + 4, 70, 142, 32, 0, 0, 0, 0, 0, 3, 0, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, + 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 3, 0, 0, + 0, 65, 0, 0, 5, 50, 0, 16, 0, 0, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, 27, 0, 0, 5, 50, 0, 16, 0, 0, + 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 8, + 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, + 0, 7, 242, 0, 16, 0, 1, 0, 0, 0, 70, 14, 16, 0, 0, + 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 56, 0, 0, 9, + 242, 0, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 5, 130, 0, 16, 0, 1, 0, 0, 0, 1, + 64, 0, 0, 0, 0, 128, 63, 56, 0, 0, 7, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, 0, 70, 14, 16, + 0, 2, 0, 0, 0, 38, 0, 0, 9, 0, 208, 0, 0, 50, 0, + 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, + 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 30, 0, 0, 7, + 18, 0, 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, + 0, 10, 0, 16, 0, 0, 0, 0, 0, 34, 0, 0, 8, 34, 0, + 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 42, + 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 33, 0, 0, 8, + 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, + 0, 58, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 55, 0, + 0, 12, 242, 0, 16, 0, 1, 0, 0, 0, 86, 5, 16, 0, 0, + 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, + 0, 60, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, 26, 0, 16, 0, 0, 0, 0, 0, 55, + 0, 0, 12, 242, 0, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 14, 16, 0, 1, 0, 0, 0, 2, 64, 0, + 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, + 128, 63, 29, 0, 0, 7, 18, 0, 16, 0, 1, 0, 0, 0, 1, + 64, 0, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, + 13, 0, 4, 3, 10, 0, 16, 0, 1, 0, 0, 0, 57, 0, 0, + 8, 18, 0, 16, 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 16, + 0, 0, 10, 34, 0, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 2, 64, 0, 0, 154, 153, 153, 62, 154, 153, 25, + 63, 205, 204, 204, 61, 0, 0, 0, 0, 0, 0, 0, 9, 66, 0, + 16, 0, 1, 0, 0, 0, 10, 128, 32, 128, 65, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 34, 0, 16, 0, 1, 0, 0, 0, 26, 0, 16, + 0, 1, 0, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 50, 0, 0, 9, 226, 0, 16, 0, 1, 0, 0, 0, 6, + 9, 16, 0, 0, 0, 0, 0, 166, 10, 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 1, 0, 0, 0, 55, 32, 0, 9, 114, 0, 16, + 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0, 0, 150, 7, + 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 47, + 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, + 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 102, 102, + 230, 63, 102, 102, 230, 63, 102, 102, 230, 63, 0, 0, 0, 0, 25, + 0, 0, 5, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 1, 0, 0, + 0, 86, 5, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 150, 246, + 160, 189, 43, 199, 117, 63, 40, 177, 243, 60, 0, 0, 0, 0, 50, + 0, 0, 12, 114, 0, 16, 0, 1, 0, 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 2, 64, 0, 0, 87, 203, 136, 63, 86, 131, 197, + 60, 225, 104, 227, 58, 0, 0, 0, 0, 70, 2, 16, 0, 1, 0, + 0, 0, 50, 32, 0, 12, 114, 32, 16, 0, 0, 0, 0, 0, 166, + 10, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 5, 9, 34, 60, + 158, 151, 129, 60, 194, 240, 119, 63, 0, 0, 0, 0, 70, 2, 16, + 0, 1, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, + 84, 65, 84, 116, 0, 0, 0, 30, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 4, 0, 0, + 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, +}; + +namespace GpBinarizedShaders +{ + const unsigned char *g_drawQuadRGBICCP_D3D11[2] = { gs_shaderData, gs_shaderData + sizeof(gs_shaderData) }; +}; diff --git a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp index 1647510..2f7b666 100644 --- a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp +++ b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp @@ -32,10 +32,16 @@ struct GpDisplayDriverD3D11_Prefs namespace GpBinarizedShaders { extern const unsigned char *g_drawQuadV_D3D11[2]; + extern const unsigned char *g_drawQuadPaletteP_D3D11[2]; extern const unsigned char *g_drawQuadRGBP_D3D11[2]; - extern const unsigned char *g_scaleQuadP_D3D11[2]; extern const unsigned char *g_drawQuad15BitP_D3D11[2]; + + extern const unsigned char *g_drawQuadPaletteICCP_D3D11[2]; + extern const unsigned char *g_drawQuadRGBICCP_D3D11[2]; + extern const unsigned char *g_drawQuad15BitICCP_D3D11[2]; + + extern const unsigned char *g_scaleQuadP_D3D11[2]; } struct GpShaderCodeBlob @@ -469,12 +475,18 @@ bool GpDisplayDriverD3D11::InitResources(uint32_t virtualWidth, uint32_t virtual const GpShaderCodeBlob drawQuadPalettePBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadPaletteP_D3D11); const GpShaderCodeBlob drawQuadRGBPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadRGBP_D3D11); const GpShaderCodeBlob drawQuad15BitPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuad15BitP_D3D11); + const GpShaderCodeBlob drawQuadPaletteICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadPaletteICCP_D3D11); + const GpShaderCodeBlob drawQuadRGBICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuadRGBICCP_D3D11); + const GpShaderCodeBlob drawQuad15BitICCPBlob = GetBinarizedShader(GpBinarizedShaders::g_drawQuad15BitICCP_D3D11); const GpShaderCodeBlob scaleQuadPBlob = GetBinarizedShader(GpBinarizedShaders::g_scaleQuadP_D3D11); m_device->CreateVertexShader(drawQuadVBlob.m_data, drawQuadVBlob.m_size, nullptr, m_drawQuadVertexShader.GetMutablePtr()); m_device->CreatePixelShader(drawQuadPalettePBlob.m_data, drawQuadPalettePBlob.m_size, nullptr, m_drawQuadPalettePixelShader.GetMutablePtr()); m_device->CreatePixelShader(drawQuadRGBPBlob.m_data, drawQuadRGBPBlob.m_size, nullptr, m_drawQuadRGBPixelShader.GetMutablePtr()); m_device->CreatePixelShader(drawQuad15BitPBlob.m_data, drawQuad15BitPBlob.m_size, nullptr, m_drawQuad15BitPixelShader.GetMutablePtr()); + m_device->CreatePixelShader(drawQuadPaletteICCPBlob.m_data, drawQuadPaletteICCPBlob.m_size, nullptr, m_drawQuadPaletteICCPixelShader.GetMutablePtr()); + m_device->CreatePixelShader(drawQuadRGBICCPBlob.m_data, drawQuadRGBICCPBlob.m_size, nullptr, m_drawQuadRGBICCPixelShader.GetMutablePtr()); + m_device->CreatePixelShader(drawQuad15BitICCPBlob.m_data, drawQuad15BitICCPBlob.m_size, nullptr, m_drawQuad15BitICCPixelShader.GetMutablePtr()); m_device->CreatePixelShader(scaleQuadPBlob.m_data, scaleQuadPBlob.m_size, nullptr, m_scaleQuadPixelShader.GetMutablePtr()); // Quad input layout @@ -1330,7 +1342,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t m_paletteTextureSRV }; - m_deviceContext->PSSetShader(m_drawQuadPalettePixelShader, nullptr, 0); + m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuadPaletteICCPixelShader : m_drawQuadPalettePixelShader, nullptr, 0); m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews); } else if (pixelFormat == GpPixelFormats::kRGB555) @@ -1340,7 +1352,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t d3d11Surface->GetSRV(), }; - m_deviceContext->PSSetShader(m_drawQuad15BitPixelShader, nullptr, 0); + m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuad15BitICCPixelShader : m_drawQuad15BitPixelShader, nullptr, 0); m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews); } else if (pixelFormat == GpPixelFormats::kRGB32) @@ -1350,7 +1362,7 @@ void GpDisplayDriverD3D11::DrawSurface(IGpDisplayDriverSurface *surface, int32_t d3d11Surface->GetSRV(), }; - m_deviceContext->PSSetShader(m_drawQuadRGBPixelShader, nullptr, 0); + m_deviceContext->PSSetShader(m_useICCProfile ? m_drawQuadRGBICCPixelShader : m_drawQuadRGBPixelShader, nullptr, 0); m_deviceContext->PSSetShaderResources(0, sizeof(psResourceViews) / sizeof(psResourceViews[0]), psResourceViews); } else @@ -1437,6 +1449,12 @@ void GpDisplayDriverD3D11::SetBackgroundDarkenEffect(bool isDark) m_bgIsDark = isDark; } + +void GpDisplayDriverD3D11::SetUseICCProfile(bool useICCProfile) +{ + m_useICCProfile = useICCProfile; +} + void GpDisplayDriverD3D11::RequestToggleFullScreen(uint32_t timestamp) { // Alt-Enter gets re-sent after a full-screen toggle, so we ignore toggle requests until half a second has elapsed @@ -1510,6 +1528,7 @@ GpDisplayDriverD3D11::GpDisplayDriverD3D11(const GpDisplayDriverProperties &prop , m_isResolutionResetDesired(false) , m_lastFullScreenToggleTimeStamp(0) , m_bgIsDark(false) + , m_useICCProfile(false) { memset(&m_syncTimeBase, 0, sizeof(m_syncTimeBase)); memset(&m_windowModeRevertRect, 0, sizeof(m_windowModeRevertRect)); diff --git a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.h b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.h index 61ec143..54b6740 100644 --- a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.h +++ b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.h @@ -53,6 +53,8 @@ public: void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) override; void SetBackgroundDarkenEffect(bool isDark) override; + void SetUseICCProfile(bool useICCProfile) override; + void RequestToggleFullScreen(uint32_t timestamp) override; void RequestResetVirtualResolution() override; @@ -129,6 +131,9 @@ private: GpComPtr m_drawQuadPalettePixelShader; GpComPtr m_drawQuad15BitPixelShader; GpComPtr m_drawQuadRGBPixelShader; + GpComPtr m_drawQuadPaletteICCPixelShader; + GpComPtr m_drawQuad15BitICCPixelShader; + GpComPtr m_drawQuadRGBICCPixelShader; GpComPtr m_scaleQuadPixelShader; GpComPtr m_drawQuadVertexConstantBuffer; GpComPtr m_drawQuadPixelConstantBuffer; @@ -184,4 +189,6 @@ private: float m_bgColor[4]; bool m_bgIsDark; + + bool m_useICCProfile; }; diff --git a/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj b/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj index 5daf19b..2023697 100644 --- a/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj +++ b/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj @@ -126,8 +126,11 @@ + + + diff --git a/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj.filters b/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj.filters index b99af81..9ad0eda 100644 --- a/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj.filters +++ b/GpDisplayDriver_D3D11/GpDisplayDriver_D3D11.vcxproj.filters @@ -42,6 +42,15 @@ Source Files\CompiledShaders + + Source Files\CompiledShaders + + + Source Files\CompiledShaders + + + Source Files\CompiledShaders + diff --git a/ShaderSrc/DrawQuadPaletteP.hlsl b/ShaderSrc/DrawQuadPaletteP.hlsl index b86ba6c..7385aff 100644 --- a/ShaderSrc/DrawQuadPaletteP.hlsl +++ b/ShaderSrc/DrawQuadPaletteP.hlsl @@ -29,7 +29,7 @@ SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input) if (result.color.a <= 0.0) discard; - result.color.rgb = AppleRGBToSRGBLinear(result.color.rgb); + result.color.rgb = ApplyColorSpaceTransform(result.color.rgb); return result; } diff --git a/ShaderSrc/DrawQuadRGBP.hlsl b/ShaderSrc/DrawQuadRGBP.hlsl index 00a98e2..ca44ea1 100644 --- a/ShaderSrc/DrawQuadRGBP.hlsl +++ b/ShaderSrc/DrawQuadRGBP.hlsl @@ -27,7 +27,7 @@ SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input) if (result.color.a <= 0.0) discard; - result.color.rgb = AppleRGBToSRGBLinear(result.color.rgb); + result.color.rgb = ApplyColorSpaceTransform(result.color.rgb); return result; } diff --git a/ShaderSrc/Functions.h b/ShaderSrc/Functions.h index 58b46ed..17cc3c9 100644 --- a/ShaderSrc/Functions.h +++ b/ShaderSrc/Functions.h @@ -68,3 +68,12 @@ float3 AppleRGBToSRGBLinear(float3 color) return result; } + +float3 ApplyColorSpaceTransform(float3 color) +{ +#ifdef USE_ICC_PROFILE + return saturate(AppleRGBToSRGBLinear(color)); +#else + return SRGBToLinear(color); +#endif +}