-
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.
vulkan: hook HZB to multiple mip views for downsampling
Remove previous downsample step
- Loading branch information
Showing
12 changed files
with
161 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "lib/base.hlsl" | ||
|
||
#include "copy_to_depth_from_hzb.share.hlsl" | ||
|
||
VK_PUSH_CONSTANT_HELPER(CopyDepthFromHZBPushConstants) consts; | ||
|
||
VK_BINDING(0, 0) Texture2D<float2> HZBMip; | ||
|
||
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) | ||
{ | ||
const float2 depth_min_max_cs = HZBMip.Load(int3(input.PositionCS.xy, 0)); | ||
|
||
if (consts.copy_min) | ||
{ | ||
output.depth = depth_min_max_cs.x; | ||
} | ||
else | ||
{ | ||
output.depth = depth_min_max_cs.y; | ||
} | ||
} |
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,18 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
/// Reaper | ||
/// | ||
/// Copyright (c) 2015-2022 Thibault Schueller | ||
/// This file is distributed under the MIT License | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef COPY_DEPTH_FROM_HZB_SHARE_INCLUDED | ||
#define COPY_DEPTH_FROM_HZB_SHARE_INCLUDED | ||
|
||
#include "shared_types.hlsl" | ||
|
||
struct CopyDepthFromHZBPushConstants | ||
{ | ||
hlsl_uint copy_min; | ||
}; | ||
|
||
#endif |
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.