-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IModule::getDependencyFilePath returns relative path for shaders in cwd
#5332
Comments
In Slang, every module is associated with a file path, that file path can be a real physical path, or an imaginary one. Slang cannot tell if a path is real or not. After all, when you load a module from source, you also get to specify the file path for the source that slang will use to identify this module. It makes sense for slang to return back whatever is being passed to the It is therefore the application's responsibility if they want to make sure a file path slang returns is an actual file. |
In addtion, slang allows applications to pass in a custom |
Because of the restricted view of the file system through the |
I am closing this issue now, since I don't see any good actionable items. I think your workaround makes sense and feels the right way to address the issue. |
I am gonna ping this again, since I was digging a bit deeper after I did my workaround. My problem comes from In either case, it then goes and converts to absolute path for uniqueIdentity, but when asking for Module::getDependencyFilePath I get the "found path" which is "either relative or absolute, depending on the cwd" and not the uniqueIndentity, which is always absolute. I don't think the result of |
For hot reload in SGL, we are pulling on all file dependencies of a slang module to find all the directories we need to watch for changes.
The
IModule::getDependencyFilePath
gives up a bit of a mixed bag of results.It returns:
cbe84a99d1f8c9bdc0f6cc4ffa3b612576d8bd1f
, probably for string modules (as opposed to file modules), would expect a nullptr here as there is no FilePath.Could you please shed some light on the expected behavior? From our side, the ideal behavior would be
nullptr
for modules with no file, and absolute filepath for all file based modules, but even a more detailed description of the possible outputs would help catch it all.We do have a workaround, if the path is not absolute, we try to look for the returned string as a file in cwd, and if it is not there, we assume it is a string based module and skip, but we're not sure we have all the possible options covered.
The text was updated successfully, but these errors were encountered: