Comments (3)
Original addition was #809
There don't seem to be any mention of why this was done.
As for using OpConstantNull
instead: I would be against: the OpUndef has the advantage to be clear: it is not a desired value. Meaning we can do static analysis on the SPIR-V, and possibly find cases where there is a bug. If we use OpConstantNull, then we cannot differentiate actual null from bugs.
from directxshadercompiler.
Hi!
Thanks for the report & nice catch!
For some reasons when the return is not defined for a branch (here the compiler don't know both branches of the if/else returned), we generate an OpConstantNull instead of an OpUndef.
I'll fix that.
from directxshadercompiler.
@Keenuts See if you can find the reason in the history. I prefer using OpConstantNull when possible because if that code is triggered, it will give consistent results. That would be easier to debug. For types where OpConstantNull is not allowed, using undef is a good.
from directxshadercompiler.
Related Issues (20)
- [SPIR-V] Static class member initializer not implemented
- Segfault when trying to use hull shader as lib.
- Missing validation error on DS compilation with no patch constant signature
- Resources in groupshared memory causes internal compiler error
- QuadReadAcross(bool) Fails to Compile HOT 5
- [SPIR-V] Hitting max ID bound
- DxilValidation: TGSM size check should be per-entry in lib target
- integral_constant is exposed to the global namespace in DXC (trunk) HOT 2
- [SPIR-V][SM6.6] Payload access qualifiers HOT 1
- SamplerDescriptorHeap can be used to load textures. HOT 1
- SamplerDescriptorHeap = ResourceDescriptorHeap crashes DXC
- Multiple subscript into descriptor heaps are allowed.
- [Feature Request] Transplant XIC (Xbox Iterative Compiler) to General DXC HOT 1
- HLSL 2021 abandoned SELECT HOT 2
- [SPIR-V] Texture2D used with sampleCmp not tagged as depth texture HOT 2
- Non-determinism in Reassociate caused by address coincidences
- Initializing a struct to 0 with a resource type doesn't always produce a useful error
- DXC.EXE lacks support for long file paths HOT 3
- New include path behaviour
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.