Comments (6)
Can you confirm what the desired GLSL equivalent is?
I'm guessing HLSL Buffer
maps to GLSL textureBuffer
or imageBuffer
, but it isn't clear which.
Also: can an HLSL Buffer<T>
use an arbitrary type T
(like a struct
) or is that limited to StructuredBuffer
?
from slang.
Buffer<T>
== textureBuffer
RWBuffer<T>
== imageBuffer
.
Our internal shaders only use Buffer
. The ShaderBuffers
sample uses both, but I'll its shaders convert it to GLSL.
T
can't be a struct, it's a subset of DXGI_FORMAT.
from slang.
Thanks.
I assume that it follows that the right mapping for RWTexture2D
is image2D
. I've got some work to do in order to cover all this.
from slang.
ParticleSimulate.cs.slang uses AppendStructuredBuffer
, RWStructuredBuffer
and RWByteAddressBuffer
.
Unfortunately, AppendStructuredBuffer
requires UAV-counters which are not supported in Vulkan. The solution would be to create a typed-buffer for the counter and use atomic operations for it.
Raw-buffers have no GLSL equivalent, but we can mimic them using imageBuffer with r8 layout
from slang.
Notes to self:
-
Lowering
Buffer<T>
totextureBuffer
(andb[i]
totexelFetch
) should work, and just puts a bit more emphasis on making sure that thehackSamplerForTexelFetch
thing works. -
Mapping raw buffers to
imageBuffer
withr8
labor sounds reasonable (although "byte-address" buffers are actually more "uint32-address" buffers). The challenge is mapping all the intrinsic operations reasonably. Does GLSL support atomic son images? -
creating an additional buffer just to store an atomic counter is annoying in a lot of ways. I suppose it can't be helped, but this seems like it will be lower on the priority order.
from slang.
I'll disable the particle system for Vulkan for now
from slang.
Related Issues (20)
- Add alignment information to the ByteAddressBuffer Inst HOT 1
- Enabling debug symbol can cause compilation failure.
- VKCTS nightly runs start failing on run #38 HOT 9
- -emit-spirv-via-glsl is missing in slang API compilation HOT 2
- Fix autodiff test failures after enabling debug symbol.
- Fix `packSnorm2x16` and re-enable `tests/glsl-intrinsic/intrinsic-basic.slang` on direct spirv backend. HOT 1
- No debuginfo generated for buffer references HOT 14
- Warnings emitted during link time are not filtered by diagnostic settings HOT 3
- UserAttribute is missing in the reflection information for scalar variable declaration. HOT 1
- Prefer vector operations over unary operations for various GLSL/SPIRV/HLSL functions HOT 4
- Add unit testing to updated slang capabilities system
- `spReflection_getEntryPointCount` returns 0, am I using the api wrong? HOT 2
- Use SMin/UMin for SPIR-V target HOT 12
- Improve robustness of slang-test against random driver failures HOT 1
- Overload resolution prefers `int64->int` over `int64->uint64`.
- Incorrect WaveMatch result with SPIR/V
- Nested associated types with multiple possible implementations will crash the compiler. HOT 1
- Comparing unsigned and signed value yields an unexpected result
- `struct` construction using braces fails if differentiable member associations are missing.
- Crash when "uint(-1)" is used for "operator%()" or "operator/()" HOT 2
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.