mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 00:41:24 +00:00
- backend update from GZDoom.
This commit is contained in:
parent
5b6aa372ea
commit
c96e04e6c9
28 changed files with 352 additions and 119 deletions
|
@ -68,6 +68,8 @@ void VKBuffer::SetData(size_t size, const void *data, bool staticdata)
|
|||
{
|
||||
auto fb = GetVulkanFrameBuffer();
|
||||
|
||||
size = std::max(size, (size_t)16); // For supporting zero byte buffers
|
||||
|
||||
if (staticdata)
|
||||
{
|
||||
mPersistent = false;
|
||||
|
@ -122,6 +124,8 @@ void VKBuffer::SetData(size_t size, const void *data, bool staticdata)
|
|||
|
||||
void VKBuffer::SetSubData(size_t offset, size_t size, const void *data)
|
||||
{
|
||||
size = std::max(size, (size_t)16); // For supporting zero byte buffers
|
||||
|
||||
auto fb = GetVulkanFrameBuffer();
|
||||
if (mStaging)
|
||||
{
|
||||
|
@ -141,6 +145,8 @@ void VKBuffer::SetSubData(size_t offset, size_t size, const void *data)
|
|||
|
||||
void VKBuffer::Resize(size_t newsize)
|
||||
{
|
||||
newsize = std::max(newsize, (size_t)16); // For supporting zero byte buffers
|
||||
|
||||
auto fb = GetVulkanFrameBuffer();
|
||||
|
||||
// Grab old buffer
|
||||
|
@ -187,6 +193,8 @@ void VKBuffer::Unmap()
|
|||
|
||||
void *VKBuffer::Lock(unsigned int size)
|
||||
{
|
||||
size = std::max(size, (unsigned int)16); // For supporting zero byte buffers
|
||||
|
||||
if (!mBuffer)
|
||||
{
|
||||
// The model mesh loaders lock multiple non-persistent buffers at the same time. This is not allowed in vulkan.
|
||||
|
|
|
@ -158,6 +158,9 @@ void VkHardwareTexture::CreateImage(FTexture *tex, int translation, int flags)
|
|||
|
||||
void VkHardwareTexture::CreateTexture(int w, int h, int pixelsize, VkFormat format, const void *pixels)
|
||||
{
|
||||
if (w <= 0 || h <= 0)
|
||||
throw CVulkanError("Trying to create zero size texture");
|
||||
|
||||
auto fb = GetVulkanFrameBuffer();
|
||||
|
||||
int totalSize = w * h * pixelsize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue