Skip to content

Commit

Permalink
Client: Increase the maximum GPU buffer size to 256 MB
Browse files Browse the repository at this point in the history
This is the default WebGPU limit, so it should be safe to use. The existing one is too small to render large maps with normal visualization enabled (such as schg_dun01 or nif_fild01) - there's just too many vertices since each vertex normal necessitates three more for the visualization itself.
  • Loading branch information
rdw-software committed Jan 27, 2024
1 parent a1a79e5 commit 3b2d585
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Core/NativeClient/WebGPU/GPU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local ffi_string = ffi.string
local GPU = {
MAX_VERTEX_COUNT = 200000, -- Should be configurable (later)
MAX_TEXTURE_ARRAY_SIZE = 32,
MAX_BUFFER_SIZE = 256 * 1024 * 1024,
}

-- The FFI bindings don't provide enums for native extensions yet (requires a fix in the runtime)
Expand Down Expand Up @@ -116,7 +117,7 @@ function GPU:RequestLogicalDevice(adapter, options)
maxVertexAttributes = 4, -- Vertex positions, vertex colors, diffuse texture UVs, normals
maxVertexBuffers = 4, -- Vertex positions, vertex colors, diffuse texture UVs, normals
maxInterStageShaderComponents = 8, -- #(vec3f color, vec2f diffuseTextureCoords, float alpha), normal(vec3f)
maxBufferSize = self.MAX_VERTEX_COUNT * 5 * ffi.sizeof("float"), -- #(vec3f position, vec2f transform)
maxBufferSize = GPU.MAX_BUFFER_SIZE, -- DEFAULT
maxVertexBufferArrayStride = 20, -- #(Rml::Vertex)
maxBindGroups = 3, -- Camera, material, transforms
maxUniformBuffersPerShaderStage = 1, -- Camera properties (increase for material, soon?)
Expand Down

0 comments on commit 3b2d585

Please sign in to comment.