-
Notifications
You must be signed in to change notification settings - Fork 17
/
renderPass.cpp
53 lines (43 loc) · 1.32 KB
/
renderPass.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Copyright © 2024 Weta Digital Limited
//
// SPDX-License-Identifier: Apache-2.0
//
#include "renderPass.h"
#include "renderBuffer.h"
#include "renderer.h"
#include "debugCodes.h"
#include <pxr/imaging/hd/aov.h>
#include <pxr/imaging/hd/renderPassState.h>
PXR_NAMESPACE_OPEN_SCOPE
HdTriRenderPass::HdTriRenderPass(HdRenderIndex* index,
const HdRprimCollection& collection)
: HdRenderPass(index, collection)
{
}
HdTriRenderPass::~HdTriRenderPass() {}
bool
HdTriRenderPass::IsConverged() const
{
return _converged;
}
void
HdTriRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassState,
const TfTokenVector& renderTags)
{
TF_DEBUG(HDTRI_GENERAL)
.Msg("[%s] Executing render pass\n", TF_FUNC_NAME().c_str());
// Iterate over each AOV.
HdRenderPassAovBindingVector aovBindings =
renderPassState->GetAovBindings();
for (const HdRenderPassAovBinding& aovBinding : aovBindings) {
// We will only write into the color AOV buffer.
if (aovBinding.aovName == HdAovTokens->color) {
HdTriRenderBuffer* renderBuffer =
static_cast<HdTriRenderBuffer*>(aovBinding.renderBuffer);
HdTriRenderer::DrawTriangle(renderBuffer);
}
}
_converged = true;
}
PXR_NAMESPACE_CLOSE_SCOPE