LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.03k stars 135 forks source link

CreateBuffer w. > 1MB bind=VertexBuffer on static build crashes #73

Closed dmiller423 closed 1 year ago

dmiller423 commented 2 years ago

Not much more to say, built static lib using clang modified your own triangle test code change buffer size to 2MB and crash. Building with clang 12 on win64

LukasBanana commented 2 years ago

What renderer did you use and can you share some example code?

LukasBanana commented 1 year ago

I just tested this with all backends and it works fine (200 MB):

LLGL::BufferDescriptor vertexBufferDesc;
{
    vertexBufferDesc.size           = 200000000; // 200 MB
    vertexBufferDesc.bindFlags      = LLGL::BindFlags::VertexBuffer;
    vertexBufferDesc.vertexAttribs  = vertexFormat.attributes;
}
LLGL::Buffer* vertexBuffer = renderer->CreateBuffer(vertexBufferDesc);
renderer->WriteBuffer(*vertexBuffer, 0, vertices, sizeof(vertices));

At 2 GB I get an VK_ERROR_OUT_OF_DEVICE_MEMORY error code from the Vulkan backend, even though my GPU has 8 GB or VRAM. Nothing to be concerned about at the moment, though.