Comments (5)
Can you copy-paste in the error message you see?
My guess is that I'm just missing some overloads of operator*
. I hope it isn't something more serious.
from slang.
One more note-to-self issue here is that I'm realizing there could be subtle problems if cross-compilation involves scalar-to-matrix conversion. float4x4(a)
produces a matrix with 16 elements of a
, while mat4(a)
produces a diagonal matrix.
There is a similar issue where I need to make sure to translate HLSL operator*
on matrices to the appropriate componentMul
call.
from slang.
from slang.
I think I misunderstood this error. The problem is not that we are giving an error on a matrix-scalar multiply in GLSL code, but rather that we are giving the error on Slang code that tries to do matrix-times-scalar.
It seems like this error shouldn't be specific to cross-compilation, then, and should occur for any Slang code that tries to do this.
from slang.
Yep. I can repro this is a bare Slang file, so this is just a plain old screw-up on my part.
There are two reasonable ways to fix this:
- Implement implicit promotion of scalars to matrices, after which the ordinary component-wise multiply will be taken
- Implement explicit overloads of
operator*
(and probably others) for the matrix/scalar and scalar/matrix cases (and same for vector/scalar, ...)
It isn't clear to me which is the way that HLSL interprets this kind of things internally.
from slang.
Related Issues (20)
- Function param input modifiers `out` and `inout` are unexpectedly strict HOT 2
- Latest macOS release x64 build is actually an ARM64 build
- `and` intrinsic does not support vector arguments HOT 1
- SPIRV and Metal `TextureBufferType` support HOT 4
- Missing `uint2` variant of `asdouble`
- Unexpected error: unable to parse target intrinsic snippet: `CheckAccessFullyMapped`
- `countbits` intrinsic does not support vector arguments
- SPIR-V: `SubpassInput` should default to `float4` if explicit type parameter is not provided
- Missing support for `or` intrinsic
- Add support for matrix variants of `select`
- SPIR-V: Error message for `WaveMultiPrefix` functions is not easy to understand HOT 1
- Missing SM 6.6 function: `IsHelperLane()` HOT 2
- `Load(in int Location, out uint Status)` missing from `Buffer/RWBuffer`? HOT 2
- Does Slang allow function implementation to live outside of namespace? HOT 2
- Improve documentation and error message to clarify user defined data structures: `struct` vs `class` HOT 1
- Use of base struct's resource member causes assert HOT 1
- Does/should Slang allow left side cast? HOT 1
- Hitting assert due to NULL struct type layout
- NULL pointer access when retrieving field layout HOT 6
- Does Slang allow for static const global references to `cbuffer` data?
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 slang.