#kgfx - a graphics library designed to be medium-level (sort of an RHI)

21 messages · Page 1 of 1 (latest)

echo anvil
#

currently working on the 4th redesign on the "redesign" branch

#

kgfx - a graphics library designed to be high-level yet moden

#

kgfx - a graphics library designed to be high-level yet modern

echo anvil
#

so

#

resources

#

plan is

#

user does this

create resources (textures/buffers)
get required sizes and alignments
create heap (with enough allocated for resources to fit and match alignment)
emplace resources in heap at proper aligned offsets
#

now how should referencing them work

#

maybe a separate handle

echo anvil
# echo anvil user does this ``` create resources (textures/buffers) get required sizes and al...
KGFXTexture texture = kgfxCreateTexture(...);
KGFXBuffer buffer = kgfxCreateBuffer(...);

KGFXu64 s = kgfxGetTextureSizeRequirement(..., texture);
KGFXu64 a = kgfxGetBufferAlignmentRequirement(..., buffer);
KGFXu64 r = s % a;

KGFXu64 size = s + ((r == 0) ? r : s - r) + kgfxGetBufferSizeRequirement(..., buffer);
KGFXHeap heap = kgfxCreateHeap(..., size, KGFX_HEAP_TYPE_DEVICE, ...);
kgfxEmplaceHeapTexture(..., heap, texture, 0);
kgfxEmplaceHeapBuffer(..., heap, buffer, s + ((r == 0) ? r : s - r));
echo anvil
#

now instead

#
KGFXTexture texture = kgfxCreateTexture(..., resourceType, format, width, height, depth);
KGFXBuffer buffer = kgfxCreateBuffer(..., resourceType, format, size);
carmine wigeon
#

this is very close to vulkan

#

whats the goal of this lib

echo anvil
#

it's meant to be high level compared to Vulkan but not OpenGL level

echo anvil
#

cursed code inside the buffer creation to initialize with a pointer to buffer data

#

kgfx - a graphics library designed to be medium-level (sort of an RHI)

echo anvil
#

buffer copies working

#

along with implicit transitioning

echo anvil
#

buffer to image copying working