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)
- tests/cpu-program/gfx-smoke.slang causes slang compiler to assert HOT 1
- Make CUDA vector layout consistent with other platforms.
- Add diagnostic to disallow initialization of global groupshared variables.
- Error when specifying explicit underlying type on unscoped enums HOT 2
- "Ambiguous reference to This" in extension method returning This HOT 2
- slang-module embedded in source (-emit-ir not working?) HOT 2
- Prototype the Metal backend.
- ForceInline atomic operations on Byte Address Buffers HOT 3
- Pointer support requires clarification in user-guide HOT 1
- Multiple entry points in a single invocation of slangc doesn't seem to work? HOT 3
- Possible to generate multiple entry points into one output file? HOT 20
- Add compiler option to disable capability-related diagnostic errors
- Investigate silent failures in slang-torch cpp binding generation
- Snooze DXC warning "-Wbitwise-op-parentheses" HOT 1
- We need to create a new release to support old version of GLIBC down to 2.27
- Narrowing bit_cast fails vulkan validation HOT 1
- Add `ignore-capabilities` flag
- Prototype separate compilation of slang module into a dxil library.
- Pointer deref inside mesh shader results in compiler error on spirv HOT 3
- Flag to prevent cbuffer elements from being packed into a struct 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 slang.