fix: lower UBO max size to account buffer cache offset (#2388)

* fix: lower UBO max size to account buffer cache offset

* review comments

* remove UBO size from spec and always set it to max on shader side
This commit is contained in:
psucien 2025-02-09 22:03:20 +01:00 committed by GitHub
parent 34a4f6e60e
commit 04fe3a79b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 61 additions and 40 deletions

View file

@ -633,8 +633,8 @@ void EmitContext::DefineBuffers() {
for (const auto& desc : info.buffers) {
const auto sharp = desc.GetSharp(info);
const bool is_storage = desc.IsStorage(sharp);
const u32 array_size = sharp.NumDwords() != 0 ? sharp.NumDwords() : MaxUboDwords;
const bool is_storage = desc.IsStorage(sharp, profile);
const u32 array_size = profile.max_ubo_size >> 2;
const auto* data_types = True(desc.used_types & IR::Type::F32) ? &F32 : &U32;
const Id data_type = (*data_types)[1];
const Id record_array_type{is_storage ? TypeRuntimeArray(data_type)