Skip to content

Commit

Permalink
Fix a code change needed to update to orign/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamFelt committed Apr 16, 2024
1 parent 328dcb4 commit 3b95872
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions pxr/imaging/hdx/pickTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ HdxPickTask::_InitIfNeeded()

_pickBuffer = hdStResourceRegistry->AllocateSingleBufferArrayRange(
_HdxPickTokens->Picking,
bufferSpecs,
HdBufferArrayUsageHint());
bufferSpecs, HdBufferArrayUsageHintBitsStorage);
}

if (_pickableAovBuffers.empty()) {
Expand Down Expand Up @@ -637,8 +636,8 @@ HdxPickTask::Prepare(HdTaskContext* ctx,
if (renderPassShader) {
if (_pickBuffer) {
renderPassShader->AddBufferBinding(
HdBindingRequest(
HdBinding::SSBO,
HdStBindingRequest(
HdStBinding::SSBO,
_HdxPickTokens->PickBufferBinding,
_pickBuffer,
/*interleaved*/ false,
Expand Down
8 changes: 4 additions & 4 deletions pxr/imaging/hdx/shaders/renderPass.glslfx
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,21 @@ compareOrSet(

// Potentially available slot, store the values and return true if successful.
int expected = -9;
primIdValue = ATOMIC_COMPARE_SWAP(PickBuffer[primIdOffset], expected, primId);
primIdValue = ATOMIC_COMP_SWAP(PickBuffer[primIdOffset], expected, primId);

// Exit if the slot was unavailable.
if (primIdValue != -9 && primIdValue != primId)
return false;

expected = -9;
instanceIdValue = ATOMIC_COMPARE_SWAP(PickBuffer[instanceIdOffset], expected, instanceId);
instanceIdValue = ATOMIC_COMP_SWAP(PickBuffer[instanceIdOffset], expected, instanceId);

// Exit if the slot was unavailable.
if (instanceIdValue != -9 && instanceIdValue != instanceId)
return false;

expected = -9;
partIdValue = ATOMIC_COMPARE_SWAP(PickBuffer[partIdOffset], expected, partId);
partIdValue = ATOMIC_COMP_SWAP(PickBuffer[partIdOffset], expected, partId);

// Exit if the slot was unavailable.
if (partIdValue != -9 && partIdValue != partId)
Expand Down Expand Up @@ -284,7 +284,7 @@ void RenderOutput(vec4 Peye, vec3 Neye, vec4 color, vec4 patchCoord)
{
// see if we need to add a new entry
if (entryNumber == ATOMIC_LOAD(PickBuffer[sizeOffset])) {
ATOMIC_COMPARE_SWAP(PickBuffer[sizeOffset], entryNumber, entryNumber + 1);
ATOMIC_COMP_SWAP(PickBuffer[sizeOffset], entryNumber, entryNumber + 1);
}

// if either the item equals to the current entry or we managed to
Expand Down

0 comments on commit 3b95872

Please sign in to comment.