Comments (6)
This is deliberate but it's something we might get around to. The problem is that these don't map directly; the prior handler required the implementation to track pairs of Open/Close to build up a the include chain to resolve relative references (and also to track the system vs. local include types).
The new interface is easier to use - the compiler itself enforces rules around system vs. local includes and handles probing for files in the right order; the implementation simply needs to know to deal with the file not being found. It will also deal with absolute paths as much as possible.
This allows a pretty trivial implementation over an actual file system or a synthesized set of files. It does mean however that it's hard to implement the new interface over a prior implementation.
There are a few solutions we could attempt. If you can change your include handler, the easiest thing to do would be to have that implement the new interface as well, and we can change our bridge to QI for that and use it if available.
If you can't change the implementation of your include handler, it gets messier, as the right strategy will likely be couple to the implementation's behavior and, for example, whether it's resilient to missed files (or whether it goes into an error state and becomes unusable after a failed probe, for example).
from directxshadercompiler.
Cool, thanks for the info -- that does sound a lot nicer! I am able to modify the include handler, so I'll probably write a new bridge method that just passes through the new interface directly but leaves the other stuff intact.
(In time we'll want to move over to the new interface completely, this is just a temporary thing to get us up and running quickly).
from directxshadercompiler.
@simontaylor81, I have a patch to handle the use of D3D_COMPILE_STANDARD_FILE_INCLUDE, but unfortunately my prior suggestion cannot be implemented - ID3DInclude doesn't inherit from IUnknown as far as I can tell (d3dcommon.h has it declared with DECLARE_INTERFACE with no base type). I think that's as far as we'll be able to go with a generic bridge.
from directxshadercompiler.
Ok cool, thanks for the update. I've already switched to using the new interface anyway -- it's much nicer in general for various reasons so I'm definitely not complaining!
Maybe this limitation should be documented somewhere (if it isn't already)? Otherwise I'm happy to close this issue if you are.
from directxshadercompiler.
@simontaylor81 I've included a short version of this discussion over at https://github.com/Microsoft/DirectXShaderCompiler/wiki/D3DCompiler-DXC-Bridge. Please feel free to close the issue, and thanks!
from directxshadercompiler.
In the interest of historical cross-referencing, the issue thread #166 has a good discussion on the topic of include handler design.
from directxshadercompiler.
Related Issues (20)
- [Feature Request] Include information about WaveSizeRange in reflection data
- Calling global functions increases the compile-time high compare to calling member functions HOT 1
- [Mesh Nodes] Mesh nodes should have the usage masks set in RDAT HOT 1
- IDxcResult output enumeration is reporting multiple DXC_OUT_NONE values and missing supported DXC_OUT_ values. HOT 2
- dxcapi.h is missing #defines for 2 DXC_PART_ values ('S','F','I','0' and 'P','S','V','0') HOT 2
- ftime-trace-granularity.hlsl test fails periodically, possibly due to timing condition
- [Feature Request] Add ARM64 builds to the CI pipeline
- Globals cbuffer is not compiled if all variables are unused. HOT 3
- [SPIR-V] Casting from float to uint16/int16 inserts a cast to float16 in between. HOT 2
- [SPIR-V] Remove bug report request when inline SPIR-V is used HOT 1
- [0017] Implement conforming literals proposal
- Update specs on new Barrier and block new Barrier on SM < 6.8
- Add -mesh-nodes-preview suffix to packages version
- [SPIR-V] [Proposal 0011] SPIR-V Type for a PhysicalStorageBuffer class OpTypePointer fails to compile because of missing offsets for a struct HOT 5
- [SPIR-V] Conflicting input locations with -pack_optimized in geometry shaders HOT 1
- [SPIR-V] Implement WaveMatch intrinsic support HOT 8
- [SPIR-V] Using `[[vk::combinedImageSampler]]` on arrays of textures and samplers fails HOT 1
- Add assertions enabled build of DXC trunk to Compiler Explorer HOT 2
- [SPIR-V] RawBufferStore still trips up on missing member offsets HOT 2
- pow of literal 0.0f not optimized away in some cases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directxshadercompiler.