mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 15:00:36 +01:00
aco: use size_t for monotonic_buffer_resource
Necessary for really big shaders.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14650
Backport-to: 25.3
(cherry picked from commit 874255e899)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
parent
76bd2fb438
commit
e7cf76d40d
2 changed files with 5 additions and 5 deletions
|
|
@ -274,7 +274,7 @@
|
|||
"description": "aco: use size_t for monotonic_buffer_resource",
|
||||
"nominated": true,
|
||||
"nomination_type": 4,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ public:
|
|||
}
|
||||
|
||||
/* create new larger buffer */
|
||||
uint32_t total_size = buffer->data_size + sizeof(Buffer);
|
||||
size_t total_size = buffer->data_size + sizeof(Buffer);
|
||||
do {
|
||||
total_size *= 2;
|
||||
} while (total_size - sizeof(Buffer) < size);
|
||||
|
|
@ -302,8 +302,8 @@ public:
|
|||
private:
|
||||
struct Buffer {
|
||||
Buffer* next;
|
||||
uint32_t current_idx;
|
||||
uint32_t data_size;
|
||||
size_t current_idx;
|
||||
size_t data_size;
|
||||
uint8_t data[];
|
||||
};
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ public:
|
|||
/* Memory Allocation */
|
||||
T* allocate(size_t size)
|
||||
{
|
||||
uint32_t bytes = sizeof(T) * size;
|
||||
size_t bytes = sizeof(T) * size;
|
||||
return (T*)memory_resource.get().allocate(bytes, alignof(T));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue