-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP vulkan: add MSAA support for visibility pass
Vis will render at half the res but 4x MSAA which should essentially result in a no-op. Also add legacy path for devices with no depth write in compute.
- Loading branch information
Showing
18 changed files
with
654 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#define ENABLE_MSAA_VIS_BUFFER | ||
#include "fill_gbuffer.comp.hlsl" |
3 changes: 3 additions & 0 deletions
3
src/renderer/shader/vis_buffer/fill_gbuffer_msaa_with_depth_resolve.comp.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define ENABLE_MSAA_VIS_BUFFER | ||
#define ENABLE_MSAA_DEPTH_RESOLVE | ||
#include "fill_gbuffer.comp.hlsl" |
24 changes: 24 additions & 0 deletions
24
src/renderer/shader/vis_buffer/resolve_depth_legacy.frag.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "lib/base.hlsl" | ||
|
||
VK_BINDING(0, 0) Texture2DMS<float> DepthMS; | ||
|
||
struct PS_INPUT | ||
{ | ||
float4 PositionCS : SV_Position; | ||
float2 PositionUV : TEXCOORD0; | ||
}; | ||
|
||
struct PS_OUTPUT | ||
{ | ||
float depth : SV_Depth; | ||
}; | ||
|
||
void main(in PS_INPUT input, out PS_OUTPUT output) | ||
{ | ||
uint2 position_ts = input.PositionCS.xy; | ||
uint sample_location = (position_ts.x & 1) + (position_ts.y & 1) * 2; | ||
|
||
const float depth = DepthMS.Load(uint3(position_ts / 2, 0), sample_location); | ||
|
||
output.depth = depth; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.