Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Kangz
Copy link
Contributor

@Kangz Kangz commented May 26, 2020

Start with a minimum maximum of 2^14 as that's the limit in Vulkan
that's hit for various ARM devices and for Swiftshader. Limits for Metal
and D3D12 are unclear but should be more than this.

The limit could be increased if we decided that the ARM devices should
be falling back to a WebGPU-compatibility feature level instead.


Preview | Diff

Start with a minimum maximum of 2^14 as that's the limit in Vulkan
that's hit for various ARM devices and for Swiftshader. Limits for Metal
and D3D12 are unclear but should be more than this.

The limit could be increased if we decided that the ARM devices should
be falling back to a WebGPU-compatibility feature level instead.
@Jiawei-Shao
Copy link
Contributor

D3D compiler FXC has a maximum allowed size for constant buffers (16384 bytes).

For example,
layout(std140, set = 0, binding = 0) uniform uBufferNotDynamic {
uvec2 notDynamicValue[65536];
};

// Error from FXC
error X4601: the size of constant buffer uBufferNotDynamic is 65535 16-byte entries, which exceeds maximum allowed size of 4096 entries

@Kangz
Copy link
Contributor Author

Kangz commented May 26, 2020

The error message seems to indicate the maximum is 4096 * 16 = 65536 bytes for D3D12.

@kainino0x
Copy link
Contributor

kainino0x commented May 26, 2020

Metal says "Maximum number of function constants" is 65536 on all platforms. There is no documentation anywhere about what that means, but I would guess that 65536 of something must be at least 65536 B in size.

Myles pointed out that this is about the specialization-constant style "Function Constants" in Metal.

@Kangz
Copy link
Contributor Author

Kangz commented May 27, 2020

Addressed all comments!

@kvark kvark requested a review from JusSn May 28, 2020 16:06
map with {{GPUBufferUsage/UNIFORM}} flag.

Issue: This validation should take into account the default when {{GPUBufferBinding/size}} is not set.
Also should {{GPUBufferBinding/size}} default to the `buffer.byteLength - offset` or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you default to min(buffer.byteLength - offset, limits.maxUniformBufferBindingSize) would it always pass validation when it shouldn't?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just merged this but @Kangz can you check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would always pass validation but could result in clipping the data in surprising ways for the developer.

@kdashg
Copy link
Contributor

kdashg commented Jun 1, 2020

Agreed in meeting 2020-06-01.
We can change it later if we find it's too loose.

@kdashg kdashg merged commit 1c06701 into gpuweb:master Jun 1, 2020
@Kangz Kangz deleted the maxUniformBindingSize branch March 25, 2022 14:21
ben-clayton added a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
* common/runtime: Improve error handling

Catch exeptions raised while gathering test cases and running them.

Properly emit a 200 status code on success.

* Update server.ts

Emit `404` for test not found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants