mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-07-30 23:37:43 -04:00
* Simpler light caching * Simpler cube cache as well, benchmark on RX580 goes from 248ms to 55ms * Fix logic * CRenderContext::CopyTexture copies slices for cube in one GPU command * Do texture copy in a layer so that we handle it all in sequence during scenesystem rendering * Use Transform Version instead of key, get cache texture only when we actually want it, as cheap for the cpu as it was before * Only do static caching if our light is static * Shared cache code for lights (including static cache) instead of duplicating * Potential fix for pull request finding In the vkCmdCopyImage path, dstOffset.y is set from nDestX instead of nDestY. This will copy to the wrong Y position (and can trigger out-of-bounds clamping/validation errors when nDestX != nDestY). Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Class Attributes: [Handles:Sandbox.ManagedTypeName] Set a class to use a handle system. A good example here is Sandbox.PhysicsBody. On creation we call a managed function to get a handle (an int) and we store that in the IPhysicsBody in native. Any time we pass a IPhysicsBody from native to managed, we pass the int and look up the real object. In the constructor of the physics object in native we call into native to destroy the handle. Which ensures that the pointer is cleared and can't try to be used.