Comments (5)
268435456 is the default limit, you need to explicitly request higher limits via required_limits
when you create the device.
from wgpu.
I think that would resolve gfx-rs/wgpu-native#408 as well?
from wgpu.
@teoxoy I'll check that out and close the issue if so.
Meanwhile, now that I'm actually requesting larger buffers, it is actually failing to run (after successfully giving me the device), with a "Validation Error" :( I'll try to replicate on the latest compute example in wgpu_native and see how that goes.
from wgpu.
I have verified that it appears to be working correctly in the latest wgpu_native compute example. We'll have to update our version to the latest and hopefully that fixes the issue.
Also note the question in the code comments below about how to set the RequiredLimits to all defaults except ones you specifically set -- I could not find that exposed in the C interface?
WGPUSupportedLimits sup;
wgpuAdapterGetLimits(adapter, &sup);
WGPULimits limits; // note: I could not find a call that sets all fields to the default "undefined" value: 0xffffffff
// so I had to just use all the supported limits. we have this DefaultLimits() function in our Go wrapper,
// and I found this method in rust: https://docs.rs/wgpu/latest/wgpu/struct.Limits.html -- but nothing in the .h file.
// how is anyone supposed to just specify a few limits to override in their requested limits??
WGPURequiredLimits req;
req.limits = sup.limits;
req.limits.maxStorageBufferBindingSize = 0x1FFFFFFF; // note: it doesn't seem to care about this
req.limits.maxBufferSize = 0x1FFFFFFF; // this is the only one that mattered, relative to bufSize below.
WGPUDeviceDescriptor desc;
desc.requiredLimits = &req;
WGPUDevice device = NULL;
wgpuAdapterRequestDevice(adapter, &desc, handle_request_device,
(void *)&device);
assert(device);
WGPUQueue queue = wgpuDeviceGetQueue(device);
assert(queue);
WGPUShaderModule shader_module =
frmwrk_load_shader_module(device, "shader.wgsl");
assert(shader_module);
WGPUBuffer staging_buffer = wgpuDeviceCreateBuffer(
device, &(const WGPUBufferDescriptor){
.label = "staging_buffer",
.usage = WGPUBufferUsage_MapRead | WGPUBufferUsage_CopyDst,
.size = numbers_size,
.mappedAtCreation = false,
});
assert(staging_buffer);
uint32_t bufSize = 0xFFFFFFFF; // this fails if > size specified above, works if <
WGPUBuffer storage_buffer = wgpuDeviceCreateBuffer(
device, &(const WGPUBufferDescriptor){
.label = "storage_buffer",
.usage = WGPUBufferUsage_Storage | WGPUBufferUsage_CopyDst |
WGPUBufferUsage_CopySrc,
.size = bufSize,
.mappedAtCreation = false,
});
assert(storage_buffer);
from wgpu.
I would open an issue at https://github.com/webgpu-native/webgpu-headers.
from wgpu.
Related Issues (20)
- `Instance::request_adapter` silently fails when browser doesn't support WebGPU and `wgpu` compiled without `webgl` feature.
- WebGPU backend: "Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer" if buffer is destroyed
- Support the `readonly_and_readwrite_storage_textures` WGSL language extension HOT 2
- [d3d12] Make sure WARP device creation works properly HOT 2
- [naga wgsl-out] `let`declarations are wrongly detected as const HOT 4
- [glsl-in] lost statement of multi part loop-expression
- WGL and EGL's context activation is unsound
- Unable to break out of the loop in SPIR-V
- Texture usages TextureUsages(STORAGE_BINDING) are not allowed on a texture of type R8Uint HOT 1
- `Texture` from `ID3D12Resource/ID3D11Resource`? HOT 4
- `const_assert` doesn't evaluate conditions properly HOT 5
- Are `wgpu_hal::CommandEncoder::set_bind_group`'s guarantees too weak / too strong? HOT 2
- DX12: Surface::configure panics if old TextureView is still alive HOT 1
- support `enable clip_distances` extension
- New minor release? HOT 1
- `DepthStencilState::bias` should be named `depth_bias`
- wgpu needs a better (and stable) public API HOT 3
- WGLSL and WebGL Primary Full Support
- Linux + Nvidia + EGL + X11 picks the wrong adapter
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 wgpu.