diff options
| author | Yong He <yonghe@outlook.com> | 2024-07-15 22:23:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-15 22:23:10 -0700 |
| commit | 6bcf92d28d919eba7607c93c8581966875d2add6 (patch) | |
| tree | 09f2e9a954615a9893219e71d76dc002263aef10 /tools/gfx/d3d11/d3d11-shader-object.cpp | |
| parent | bd6314de8bb113e2a317230f5e0fb6200c39a2e9 (diff) | |
gfx/metal uniform data binding and memory leak fix. (#4644)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/d3d11/d3d11-shader-object.cpp')
| -rw-r--r-- | tools/gfx/d3d11/d3d11-shader-object.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/gfx/d3d11/d3d11-shader-object.cpp b/tools/gfx/d3d11/d3d11-shader-object.cpp index 40d671843..a83b115fa 100644 --- a/tools/gfx/d3d11/d3d11-shader-object.cpp +++ b/tools/gfx/d3d11/d3d11-shader-object.cpp @@ -318,12 +318,6 @@ Result ShaderObjectImpl::bindAsConstantBuffer( // buffer for any "ordinary" data in `X`, and then bind the remaining // resources and sub-objects. // - // The one important detail to keep track of its that *if* we bind - // a constant buffer for ordinary data we will need to account for - // it in the offset we use for binding the remaining data. That - // detail is dealt with here by the way that `_bindOrdinaryDataBufferIfNeeded` - // will modify the `offset` parameter if it binds anything. - // BindingOffset offset = inOffset; SLANG_RETURN_ON_FAIL(_bindOrdinaryDataBufferIfNeeded(context, /*inout*/ offset, specializedLayout)); @@ -331,8 +325,10 @@ Result ShaderObjectImpl::bindAsConstantBuffer( // the rest of the state, which can use logic shared with the case // for interface-type sub-object ranges. // - // Note that this call will use the `offset` value that might have - // been modified during `_bindOrindaryDataBufferIfNeeded`. + // Note that this call will use the `inOffset` value instead of the offset + // modified by `_bindOrindaryDataBufferIfNeeded', because the indexOffset in + // the binding range should already take care of the offset due to the default + // cbuffer. // SLANG_RETURN_ON_FAIL(bindAsValue(context, inOffset, specializedLayout)); |
