Skip to content

Commit c3072e5

Browse files
committed
Enhance HdSt binding and code generation to support shader visibility
- Added `stageVisibility` parameter to `HdStBindingRequest` and related methods to control shader stage visibility. - Updated resource generation logic in `HdSt_CodeGen` to handle different shader stages. - Introduced a mapping for shader stages to streamline resource layout management. - Modified existing functions to accommodate the new stage visibility feature, ensuring proper handling in various shader contexts. - Added TextureType::DEPTH_TEXTURE in codeGen.cpp
1 parent c09a374 commit c3072e5

12 files changed

Lines changed: 289 additions & 182 deletions

pxr/imaging/hdSt/binding.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ class HdStBindingRequest {
166166
HdStBindingRequest(HdStBinding::Type type, TfToken const& name,
167167
HdBufferArrayRangeSharedPtr bar,
168168
bool interleave, bool writable = false,
169-
size_t arraySize = 0, bool concatenateNames = false)
169+
size_t arraySize = 0, bool concatenateNames = false,
170+
HgiShaderStage stageVisibility = HgiShaderStageAll)
170171
: _bindingType(type)
171172
, _dataType(HdTypeInvalid)
172173
, _name(name)
@@ -176,6 +177,7 @@ class HdStBindingRequest {
176177
, _isWritable(writable)
177178
, _arraySize(arraySize)
178179
, _concatenateNames(concatenateNames)
180+
, _stageVisibility(stageVisibility)
179181
{}
180182

181183
// ---------------------------------------------------------------------- //
@@ -265,6 +267,11 @@ class HdStBindingRequest {
265267
return _concatenateNames;
266268
}
267269

270+
/// Returns the stage visibility of the binding
271+
HgiShaderStage GetStageVisibility() const {
272+
return _stageVisibility;
273+
}
274+
268275
// ---------------------------------------------------------------------- //
269276
/// \name Comparison
270277
// ---------------------------------------------------------------------- //
@@ -318,6 +325,8 @@ class HdStBindingRequest {
318325
size_t _arraySize;
319326

320327
bool _concatenateNames;
328+
329+
HgiShaderStage _stageVisibility;
321330
};
322331

323332

0 commit comments

Comments
 (0)