Skip to content

Commit

Permalink
[HdSt] Reorganized resource binding for indirect draw batches
Browse files Browse the repository at this point in the history
Implemented common methods for binding and unbinding draw item
resources used for drawing and also for instanced and non-instanced
view frustum culling.

The two methods previously used for instanced and non-instanced
view frustum culling have been combined, since most of the code
is common to both methods. Also, moved some culling specific code
from from the Prepare() method down into the culling implementation.

(Internal change: 2205708)
  • Loading branch information
davidgyu authored and pixar-oss committed Dec 17, 2021
1 parent 4a90e2b commit 6ad61d3
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 476 deletions.
6 changes: 6 additions & 0 deletions pxr/imaging/hdSt/drawBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ HdSt_DrawBatch::_GetDrawingProgram(HdStRenderPassStateSharedPtr const &state,
return _program;
}

bool
HdSt_DrawBatch::_DrawingProgram::IsValid() const
{
return _glslProgram && _glslProgram->Validate();
}

bool
HdSt_DrawBatch::_DrawingProgram::CompileShader(
HdStDrawItem const *drawItem,
Expand Down
3 changes: 3 additions & 0 deletions pxr/imaging/hdSt/drawBatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class HdSt_DrawBatch
public:
_DrawingProgram() {}

HDST_API
bool IsValid() const;

HDST_API
bool CompileShader(
HdStDrawItem const *drawItem,
Expand Down
Loading

0 comments on commit 6ad61d3

Please sign in to comment.