Skip to content

Commit

Permalink
fix(hifirush): add missing header
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Mar 24, 2024
1 parent c828be1 commit 3fc14d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/hifirush/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
// Must be 32bit aligned
// Should be 4x32
struct ShaderInjectData {
float toneMapperEnum;
float gamePeakWhite;
float gamePaperWhite;
float uiPaperWhite;
float toneMapType;
float toneMapPeakNits;
float toneMapGameNits;
float toneMapUINits;
float colorGradeHighlights;
float colorGradeShadows;
float colorGradeContrast;
float colorGradeSaturation;
};

#endif // SRC_HIFIRUSH_SHARED_H_
10 changes: 10 additions & 0 deletions src/hifirush/tonemapper00_0xF6E7E494.ps_5_0.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Output tonemapper

#include "shared.h"

Texture2D<float4> t0 : register(t0);
Texture2D<float4> t1 : register(t1);
Texture2D<float4> t2 : register(t2);
Expand All @@ -18,6 +20,10 @@ cbuffer cb1 : register(b1) {
float4 cb1[136];
}

cbuffer cb2 : register(b2) {
ShaderInjectData injectedData : packoffset(c0);
}

// 3Dmigoto declarations
#define cmp -

Expand Down Expand Up @@ -147,6 +153,10 @@ float4 main(
o0.xyz = r0.xyz;
}

// if (injectedData.toneMapType == 0) {
// } else if (injectedData.toneMapType == 1) {
// o0.rgb = texture0Input.rgb;
// }
o0.rgb = texture0Input.rgb;
o0.rgb = sign(o0.rgb) * pow(abs(o0.rgb), 1.f / 2.2f);
return o0;
Expand Down

0 comments on commit 3fc14d1

Please sign in to comment.