Skip to content

Commit

Permalink
gi: minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Dec 16, 2024
1 parent 0cbcffe commit dd784f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/gi/impl/Gi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,12 +1644,12 @@ namespace gtl
auto& oldAov = oldAovs[i];
auto& newAov = newAovs[i];

if (oldAov.aovId != newAov.aovId || oldAov.renderBuffer != newAov.renderBuffer)
if (oldAov.aovId != newAov.aovId)
{
aovsChanged = true;
break;
}
if (memcmp(oldAov.clearValue, newAov.clearValue, GI_MAX_AOV_COMP_SIZE) == 0)
if (memcmp(oldAov.clearValue, newAov.clearValue, GI_MAX_AOV_COMP_SIZE) != 0)
{
aovDefaultsChanged = true;
}
Expand All @@ -1661,7 +1661,7 @@ namespace gtl
}
if (aovsChanged || aovDefaultsChanged)
{
flags |= GiSceneDirtyFlags::DirtyAovBindingDefaults;
flags |= GiSceneDirtyFlags::DirtyAovBindingDefaults | GiSceneDirtyFlags::DirtyFramebuffer;
}

if (memcmp(&a.camera, &b.camera, sizeof(GiCameraDesc)) != 0 ||
Expand Down Expand Up @@ -1786,10 +1786,10 @@ namespace gtl
for (uint32_t i = 0; i < params.aovBindings.size(); i++)
{
const GiAovBinding& binding = params.aovBindings[i];
memcpy(&defaultsData[i * GI_MAX_AOV_COMP_SIZE], &binding.clearValue[0], GI_MAX_AOV_COMP_SIZE);
memcpy(&defaultsData[int(binding.aovId) * GI_MAX_AOV_COMP_SIZE], &binding.clearValue[0], GI_MAX_AOV_COMP_SIZE);
}

if (!s_stager->stageToBuffer(&defaultsData[0], conservativeSize, scene->aovDefaultValues, 0) ||
if (!s_stager->stageToBuffer(&defaultsData[0], defaultsData.size(), scene->aovDefaultValues) ||
!s_stager->flush())
{
GB_ERROR("failed to stage AOV default values");
Expand Down
2 changes: 1 addition & 1 deletion src/hdGatling/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class GraphicalTestContext

HdRenderPassAovBindingVector aovBindings(1);
aovBindings[0].aovName = aovName;
aovBindings[0].clearValue = VtValue(GfVec4f(1.0f));
aovBindings[0].clearValue = aovDesc.clearValue;
aovBindings[0].renderBuffer = renderBuffer;
renderPassState->SetAovBindings(aovBindings);

Expand Down
8 changes: 6 additions & 2 deletions src/hdGatling/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ void HdGatlingRenderDelegate::DestroyInstancer(HdInstancer* instancer)

HdAovDescriptor HdGatlingRenderDelegate::GetDefaultAovDescriptor(const TfToken& name) const
{
if (name == HdAovTokens->depth)
if (name == HdAovTokens->color)
{
return HdAovDescriptor(HdFormatFloat32Vec4, true, VtValue(GfVec4f(1.0f)));
}
else if (name == HdAovTokens->depth)
{
return HdAovDescriptor(HdFormatFloat32, true, VtValue(1.0f));
}
Expand All @@ -230,7 +234,7 @@ HdAovDescriptor HdGatlingRenderDelegate::GetDefaultAovDescriptor(const TfToken&
return HdAovDescriptor(HdFormatInt32, true, VtValue(-1));
}

return HdAovDescriptor(HdFormatFloat32Vec4, true, VtValue(0.0f));
return HdAovDescriptor(HdFormatFloat32Vec4, true, VtValue(GfVec4f(0.0f)));
}

HdRenderParam* HdGatlingRenderDelegate::GetRenderParam() const
Expand Down

0 comments on commit dd784f4

Please sign in to comment.