Skip to content

Commit

Permalink
Merge branch 'sultimt/fix-highlight' into 'main'
Browse files Browse the repository at this point in the history
Ignore invalid values on highlight

See merge request lightspeedrtx/dxvk-remix-nv!898
  • Loading branch information
nsubtil committed Jul 15, 2024
2 parents 0b3584c + 10822bc commit addff26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dxvk/rtx_render/rtx_postFx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,12 @@ namespace dxvk {

valuesToHighlightCountPow = bitCeilPow2(static_cast<uint32_t>(sorted.size()));

// fill invalid values as UINT32_MAX
// fill invalid values as POST_FX_HIGHLIGHTING_INVALID_VALUE
{
const size_t validCount = sorted.size();
sorted.resize(1 << valuesToHighlightCountPow);
for (size_t i = validCount; i < sorted.size(); i++) {
sorted[i] = UINT32_MAX;
sorted[i] = POST_FX_HIGHLIGHTING_INVALID_VALUE;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dxvk/shaders/rtx/pass/post_fx/post_fx.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct PostFxMotionBlurPrefilterArgs {

#define POST_FX_HIGHLIGHTING_MAX_VALUES_POW 14
#define POST_FX_HIGHLIGHTING_MAX_VALUES (1 << POST_FX_HIGHLIGHTING_MAX_VALUES_POW)
#define POST_FX_HIGHLIGHTING_INVALID_VALUE 0xFFFFFFFF

struct PostFxHighlightingArgs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ bool isGBufferMiss(const uint2 position, Texture2D<float> coneRadiusTexture)

bool findValueInArray(uint target)
{
if (target == POST_FX_HIGHLIGHTING_INVALID_VALUE)
{
return false;
}

// binary search with a uniform memory access pattern
uint foundIndex = 0;

Expand Down

0 comments on commit addff26

Please sign in to comment.