summaryrefslogtreecommitdiffstats
path: root/tools/gfx-util/shader-cursor.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-06-02 16:58:25 -0700
committerGitHub <noreply@github.com>2021-06-02 16:58:25 -0700
commite67af5b1a3993529c702ff2924dea11fd1017d2e (patch)
treec4359fb6df6110d81a658278aef9ab7244af5496 /tools/gfx-util/shader-cursor.cpp
parent8e571669b3c8d4ac8236d0aed7a960bf88ad2bd1 (diff)
Various Fixes to gfx, reflection and emit. (#1867)
* Various Fixes to gfx, reflection and emit. - Fix GLSL emit to properly output `*bitsTo*` functions for `IRBitCast` insts. - Add line directive mode setting for `ISession`. - Extend `TypeLayout::getElementStride` to handle `VectorType` case. - Fix `IDevice::readBufferResource` 's D3D12 implementation to copy only the requested bytes out. - Fix `render-test` to use the `ISession` from `gfx` instead of creating its own `ISession` to make sure `gfx` and `render-test` agree on WitnessTable and RTTI IDs. - Extend `render-test` to support filling vector and matrix values in the new `set x = ...` TEST_INPUT syntax. - Add a `dynamic-dispatch-15` test case to make sure packing / unpacking works correctly across all targets, and to make sure render-test's RTTI/WitnessTable ID filling logic is correct for non-trivial cases. * Remove default-major test * Fix cyclic reference in `ExtendedTypeLayout`. * Move `lineDirectiveMode` setting to `TargetDesc`. Add `structureSize` to `TargetDesc` and `SessionDesc` for future binary compatibility. * Cleanup. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx-util/shader-cursor.cpp')
-rw-r--r--tools/gfx-util/shader-cursor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/gfx-util/shader-cursor.cpp b/tools/gfx-util/shader-cursor.cpp
index afb1540d5..efdde44b8 100644
--- a/tools/gfx-util/shader-cursor.cpp
+++ b/tools/gfx-util/shader-cursor.cpp
@@ -195,6 +195,19 @@ ShaderCursor ShaderCursor::getElement(SlangInt index) const
return fieldCursor;
}
break;
+
+ case slang::TypeReflection::Kind::Vector:
+ case slang::TypeReflection::Kind::Matrix:
+ {
+ ShaderCursor fieldCursor;
+ fieldCursor.m_baseObject = m_baseObject;
+ fieldCursor.m_typeLayout = m_typeLayout->getElementTypeLayout();
+ fieldCursor.m_offset.uniformOffset = m_offset.uniformOffset + m_typeLayout->getElementStride(SLANG_PARAMETER_CATEGORY_UNIFORM) * index;
+ fieldCursor.m_offset.bindingRangeIndex = m_offset.bindingRangeIndex;
+ fieldCursor.m_offset.bindingArrayIndex = m_offset.bindingArrayIndex;
+ return fieldCursor;
+ }
+ break;
}
return ShaderCursor();