summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-04-20 13:17:29 -0700
committerGitHub <noreply@github.com>2021-04-20 13:17:29 -0700
commit34fba7b5e726136c6eee8a318ab9a75381399c00 (patch)
tree39a496c7052256cef9b089b78ab4bd48316571bd /slang.h
parent6bba674f9d732eccc27dcf004611e6a8eb9bc14e (diff)
Various fixes to make `model-viewer` example almost working. (#1801)
* Fixing `PseudoPtr` legalization and `gfx` lifetime issues. * Fixing `model-viewer` example. This change contains various fixes to bring `model-viewer` example to fully functional. These fixes include: 1. Add `spReflectionTypeLayout_getSubObjectRangeSpaceOffset` function to return the space index for a sub object referenced through a `ParameterBlock` binding. 2. Make sure `D3D12Device` specifies column major matrix order creating a Slang session. 3. Fix `platform::Window::close()` and `platform::Application::quit()`. 4. Fix memory leak during `model-viewer''s model loading. 5. Fix command buffer recording in `model-viewer`. With these changes, model viewer can now produce an image with a gray cube. The lighting is still incorrect becuase the `gfx` shader object implementation still does not handle "pending layout" resulting from global existential parameters. * Fix d3d12 root signature creation. * Use row-major matrix layout in model-viewer
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 060ac2dce..df0a783be 100644
--- a/slang.h
+++ b/slang.h
@@ -2012,6 +2012,7 @@ extern "C"
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeCount(SlangReflectionTypeLayout* typeLayout);
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeBindingRangeIndex(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex);
+ SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeSpaceOffset(SlangReflectionTypeLayout* typeLayout, SlangInt subObjectRangeIndex);
#if 0
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeCount(SlangReflectionTypeLayout* typeLayout);
@@ -2687,6 +2688,13 @@ namespace slang
(SlangReflectionTypeLayout*) this,
subObjectRangeIndex);
}
+
+ SlangInt getSubObjectRangeSpaceOffset(SlangInt subObjectRangeIndex)
+ {
+ return spReflectionTypeLayout_getSubObjectRangeSpaceOffset(
+ (SlangReflectionTypeLayout*) this,
+ subObjectRangeIndex);
+ }
};
struct Modifier