Rename std lib to core module

This commit is contained in:
Lauro Oyen 2024-11-23 23:25:30 +01:00
parent 6612431e0a
commit ba20d75cd4
2 changed files with 8 additions and 6 deletions

View File

@ -4,7 +4,7 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
use std::ffi::{c_char, c_int, c_void};
// Based on Slang version 2024.14.3
// Based on Slang version 2024.14.5
#[repr(C)]
pub struct ICastableVtable {
@ -43,9 +43,9 @@ pub struct IGlobalSessionVtable {
pub getSharedLibraryLoader: unsafe extern "C" fn(*mut c_void) -> *mut ISlangSharedLibraryLoader,
pub checkCompileTargetSupport: unsafe extern "C" fn(*mut c_void, target: SlangCompileTarget) -> SlangResult,
pub checkPassThroughSupport: unsafe extern "C" fn(*mut c_void, passThrough: SlangPassThrough) -> SlangResult,
pub compileStdLib: unsafe extern "C" fn(*mut c_void, flags: slang_CompileStdLibFlags) -> SlangResult,
pub loadStdLib: unsafe extern "C" fn(*mut c_void, stdLib: *const c_void, stdLibSizeInBytes: usize) -> SlangResult,
pub saveStdLib: unsafe extern "C" fn(*mut c_void, archiveType: SlangArchiveType, outBlob: *mut *mut ISlangBlob) -> SlangResult,
pub compileCoreModule: unsafe extern "C" fn(*mut c_void, flags: slang_CompileCoreModuleFlags) -> SlangResult,
pub loadCoreModule: unsafe extern "C" fn(*mut c_void, coreModule: *const c_void, coreModuleSizeInBytes: usize) -> SlangResult,
pub saveCoreModule: unsafe extern "C" fn(*mut c_void, archiveType: SlangArchiveType, outBlob: *mut *mut ISlangBlob) -> SlangResult,
pub findCapability: unsafe extern "C" fn(*mut c_void, name: *const c_char) -> SlangCapabilityID,
pub setDownstreamCompilerForTransition: unsafe extern "C" fn(*mut c_void, source: SlangCompileTarget, target: SlangCompileTarget, compiler: SlangPassThrough),
pub getDownstreamCompilerForTransition: unsafe extern "C" fn(*mut c_void, source: SlangCompileTarget, target: SlangCompileTarget) -> SlangPassThrough,
@ -109,6 +109,8 @@ pub struct IComponentTypeVtable {
#[repr(C)]
pub struct IEntryPointVtable {
pub _base: IComponentTypeVtable,
pub getFunctionReflection: unsafe extern "C" fn(*mut c_void) -> *mut slang_FunctionReflection,
}
#[repr(C)]

View File

@ -170,10 +170,10 @@ impl GlobalSession {
)?)))
}
pub fn new_without_std_lib() -> Option<GlobalSession> {
pub fn new_without_core_module() -> Option<GlobalSession> {
let mut global_session = null_mut();
unsafe {
sys::slang_createGlobalSessionWithoutStdLib(
sys::slang_createGlobalSessionWithoutCoreModule(
sys::SLANG_API_VERSION as _,
&mut global_session,
)