Files
Xenia-Canary/src/xenia/gpu/shaders/apply_gamma_table.hlsli
Triang3l fe3f0f26e4 [UI] Image post-processing and full presentation/window rework
[GPU] Add FXAA post-processing
[UI] Add FidelityFX FSR and CAS post-processing
[UI] Add blue noise dithering from 10bpc to 8bpc
[GPU] Apply the DC PWL gamma ramp closer to the spec, supporting fully white color
[UI] Allow the GPU CP thread to present on the host directly, bypassing the UI thread OS paint event
[UI] Allow variable refresh rate (or tearing)
[UI] Present the newest frame (restart) on DXGI
[UI] Replace GraphicsContext with a far more advanced Presenter with more coherent surface connection and UI overlay state management
[UI] Connect presentation to windows via the Surface class, not native window handles
[Vulkan] Switch to simpler Vulkan setup with no instance/device separation due to interdependencies and to pass fewer objects around
[Vulkan] Lower the minimum required Vulkan version to 1.0
[UI/GPU] Various cleanup, mainly ComPtr usage
[UI] Support per-monitor DPI awareness v2 on Windows
[UI] DPI-scale Dear ImGui
[UI] Replace the remaining non-detachable window delegates with unified window event and input listeners
[UI] Allow listeners to safely destroy or close the window, and to register/unregister listeners without use-after-free and the ABA problem
[UI] Explicit Z ordering of input listeners and UI overlays, top-down for input, bottom-up for drawing
[UI] Add explicit window lifecycle phases
[UI] Replace Window virtual functions with explicit desired state, its application, actual state, its feedback
[UI] GTK: Apply the initial size to the drawing area
[UI] Limit internal UI frame rate to that of the monitor
[UI] Hide the cursor using a timer instead of polling due to no repeated UI thread paints with GPU CP thread presentation, and only within the window
2022-01-29 13:22:03 +03:00

24 lines
922 B
HLSL

// float XeApplyGammaGetAlpha(float3 color) needs to be specified externally.
cbuffer XeApplyGammaRampConstants : register(b0) {
uint2 xe_apply_gamma_size;
};
RWTexture2D<unorm float4> xe_apply_gamma_dest : register(u0);
Texture2D<float3> xe_apply_gamma_source : register(t0);
Buffer<float3> xe_apply_gamma_ramp : register(t1);
[numthreads(8, 8, 1)]
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
[branch] if (any(xe_thread_id.xy >= xe_apply_gamma_size)) {
return;
}
// UNORM conversion according to the Direct3D 10+ rules.
uint3 input = uint3(xe_apply_gamma_source[xe_thread_id.xy] * 255.0f + 0.5f);
// The ramp is BGR, not RGB.
float3 output = float3(xe_apply_gamma_ramp[input.r].b,
xe_apply_gamma_ramp[input.g].g,
xe_apply_gamma_ramp[input.b].r);
xe_apply_gamma_dest[xe_thread_id.xy] =
float4(output, XeApplyGammaGetAlpha(output));
}