mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Added ability to configure minimum uniform buffer size.
This commit is contained in:
committed by
Бранимир Караџић
parent
71e0db9369
commit
16cf4f8683
@@ -2083,8 +2083,9 @@ public static class bgfx
|
||||
public uint32 maxOcclusionQueries;
|
||||
public uint32 maxEncoders;
|
||||
public uint32 minResourceCbSize;
|
||||
public uint32 transientVbSize;
|
||||
public uint32 transientIbSize;
|
||||
public uint32 maxTransientVbSize;
|
||||
public uint32 matTansientIbSize;
|
||||
public uint32 minUniformBufferSize;
|
||||
}
|
||||
|
||||
public RendererType rendererType;
|
||||
@@ -2138,8 +2139,9 @@ public static class bgfx
|
||||
{
|
||||
public uint16 maxEncoders;
|
||||
public uint32 minResourceCbSize;
|
||||
public uint32 transientVbSize;
|
||||
public uint32 transientIbSize;
|
||||
public uint32 maxTransientVbSize;
|
||||
public uint32 matTransientIbSize;
|
||||
public uint32 minUniformBufferSize;
|
||||
}
|
||||
|
||||
public RendererType type;
|
||||
|
||||
@@ -1379,9 +1379,11 @@ struct CapsLimits
|
||||
// Minimum resource command buffer size.
|
||||
uint minResourceCbSize;
|
||||
// Maximum transient vertex buffer size.
|
||||
uint transientVbSize;
|
||||
uint maxTransientVbSize;
|
||||
// Maximum transient index buffer size.
|
||||
uint transientIbSize;
|
||||
uint matTansientIbSize;
|
||||
// Mimimum uniform buffer size.
|
||||
uint minUniformBufferSize;
|
||||
}
|
||||
|
||||
// Renderer capabilities.
|
||||
@@ -1491,9 +1493,11 @@ struct InitLimits
|
||||
// Minimum resource command buffer size.
|
||||
uint minResourceCbSize;
|
||||
// Maximum transient vertex buffer size.
|
||||
uint transientVbSize;
|
||||
uint maxTransientVbSize;
|
||||
// Maximum transient index buffer size.
|
||||
uint transientIbSize;
|
||||
uint matTransientIbSize;
|
||||
// Mimimum uniform buffer size.
|
||||
uint minUniformBufferSize;
|
||||
}
|
||||
|
||||
// Initialization parameters used by `bgfx::init`.
|
||||
|
||||
@@ -2064,8 +2064,9 @@ public static partial class bgfx
|
||||
public uint maxOcclusionQueries;
|
||||
public uint maxEncoders;
|
||||
public uint minResourceCbSize;
|
||||
public uint transientVbSize;
|
||||
public uint transientIbSize;
|
||||
public uint maxTransientVbSize;
|
||||
public uint matTansientIbSize;
|
||||
public uint minUniformBufferSize;
|
||||
}
|
||||
|
||||
public RendererType rendererType;
|
||||
@@ -2114,8 +2115,9 @@ public static partial class bgfx
|
||||
{
|
||||
public ushort maxEncoders;
|
||||
public uint minResourceCbSize;
|
||||
public uint transientVbSize;
|
||||
public uint transientIbSize;
|
||||
public uint maxTransientVbSize;
|
||||
public uint matTransientIbSize;
|
||||
public uint minUniformBufferSize;
|
||||
}
|
||||
|
||||
public RendererType type;
|
||||
|
||||
@@ -9,7 +9,7 @@ import bindbc.common.types: c_int64, c_uint64, va_list;
|
||||
import bindbc.bgfx.config;
|
||||
static import bgfx.impl;
|
||||
|
||||
enum uint apiVersion = 131;
|
||||
enum uint apiVersion = 132;
|
||||
|
||||
alias ViewID = ushort;
|
||||
|
||||
@@ -1027,8 +1027,9 @@ extern(C++, "bgfx") struct Caps{
|
||||
uint maxOcclusionQueries; ///Maximum number of occlusion query handles.
|
||||
uint maxEncoders; ///Maximum number of encoder threads.
|
||||
uint minResourceCBSize; ///Minimum resource command buffer size.
|
||||
uint transientVBSize; ///Maximum transient vertex buffer size.
|
||||
uint transientIBSize; ///Maximum transient index buffer size.
|
||||
uint maxTransientVBSize; ///Maximum transient vertex buffer size.
|
||||
uint matTansientIBSize; ///Maximum transient index buffer size.
|
||||
uint minUniformBufferSize; ///Mimimum uniform buffer size.
|
||||
}
|
||||
|
||||
RendererType rendererType; ///Renderer backend type. See: `bgfx::RendererType`
|
||||
@@ -1134,8 +1135,9 @@ extern(C++, "bgfx") struct Init{
|
||||
extern(C++) struct Limits{
|
||||
ushort maxEncoders; ///Maximum number of encoder threads.
|
||||
uint minResourceCBSize; ///Minimum resource command buffer size.
|
||||
uint transientVBSize; ///Maximum transient vertex buffer size.
|
||||
uint transientIBSize; ///Maximum transient index buffer size.
|
||||
uint maxTransientVBSize; ///Maximum transient vertex buffer size.
|
||||
uint matTransientIBSize; ///Maximum transient index buffer size.
|
||||
uint minUniformBufferSize; ///Mimimum uniform buffer size.
|
||||
extern(D) mixin(joinFnBinds((){
|
||||
FnBind[] ret = [
|
||||
{q{void}, q{this}, q{}, ext: `C++`},
|
||||
|
||||
@@ -1309,8 +1309,9 @@ pub const Caps = extern struct {
|
||||
maxOcclusionQueries: u32,
|
||||
maxEncoders: u32,
|
||||
minResourceCbSize: u32,
|
||||
transientVbSize: u32,
|
||||
transientIbSize: u32,
|
||||
maxTransientVbSize: u32,
|
||||
matTansientIbSize: u32,
|
||||
minUniformBufferSize: u32,
|
||||
};
|
||||
|
||||
rendererType: RendererType,
|
||||
@@ -1354,8 +1355,9 @@ pub const Init = extern struct {
|
||||
pub const Limits = extern struct {
|
||||
maxEncoders: u16,
|
||||
minResourceCbSize: u32,
|
||||
transientVbSize: u32,
|
||||
transientIbSize: u32,
|
||||
maxTransientVbSize: u32,
|
||||
matTransientIbSize: u32,
|
||||
minUniformBufferSize: u32,
|
||||
};
|
||||
|
||||
type: RendererType,
|
||||
|
||||
@@ -715,10 +715,11 @@ namespace bgfx
|
||||
{
|
||||
Limits();
|
||||
|
||||
uint16_t maxEncoders; //!< Maximum number of encoder threads.
|
||||
uint32_t minResourceCbSize; //!< Minimum resource command buffer size.
|
||||
uint32_t transientVbSize; //!< Maximum transient vertex buffer size.
|
||||
uint32_t transientIbSize; //!< Maximum transient index buffer size.
|
||||
uint16_t maxEncoders; //!< Maximum number of encoder threads.
|
||||
uint32_t minResourceCbSize; //!< Minimum resource command buffer size.
|
||||
uint32_t maxTransientVbSize; //!< Maximum transient vertex buffer size.
|
||||
uint32_t maxTransientIbSize; //!< Maximum transient index buffer size.
|
||||
uint32_t minUniformBufferSize; //!< Mimimum uniform buffer size.
|
||||
};
|
||||
|
||||
Limits limits; //!< Configurable runtime limits.
|
||||
@@ -817,8 +818,9 @@ namespace bgfx
|
||||
uint32_t maxOcclusionQueries; //!< Maximum number of occlusion query handles.
|
||||
uint32_t maxEncoders; //!< Maximum number of encoder threads.
|
||||
uint32_t minResourceCbSize; //!< Minimum resource command buffer size.
|
||||
uint32_t transientVbSize; //!< Maximum transient vertex buffer size.
|
||||
uint32_t transientIbSize; //!< Maximum transient index buffer size.
|
||||
uint32_t maxTransientVbSize; //!< Maximum transient vertex buffer size.
|
||||
uint32_t maxTransientIbSize; //!< Maximum transient index buffer size.
|
||||
uint32_t minUniformBufferSize; //!< Mimimum uniform buffer size.
|
||||
};
|
||||
|
||||
Limits limits; //!< Renderer runtime limits.
|
||||
|
||||
@@ -538,8 +538,9 @@ typedef struct bgfx_caps_limits_s
|
||||
uint32_t maxOcclusionQueries; /** Maximum number of occlusion query handles. */
|
||||
uint32_t maxEncoders; /** Maximum number of encoder threads. */
|
||||
uint32_t minResourceCbSize; /** Minimum resource command buffer size. */
|
||||
uint32_t transientVbSize; /** Maximum transient vertex buffer size. */
|
||||
uint32_t transientIbSize; /** Maximum transient index buffer size. */
|
||||
uint32_t maxTransientVbSize; /** Maximum transient vertex buffer size. */
|
||||
uint32_t matTansientIbSize; /** Maximum transient index buffer size. */
|
||||
uint32_t minUniformBufferSize; /** Mimimum uniform buffer size. */
|
||||
|
||||
} bgfx_caps_limits_t;
|
||||
|
||||
@@ -664,8 +665,9 @@ typedef struct bgfx_init_limits_s
|
||||
{
|
||||
uint16_t maxEncoders; /** Maximum number of encoder threads. */
|
||||
uint32_t minResourceCbSize; /** Minimum resource command buffer size. */
|
||||
uint32_t transientVbSize; /** Maximum transient vertex buffer size. */
|
||||
uint32_t transientIbSize; /** Maximum transient index buffer size. */
|
||||
uint32_t maxTransientVbSize; /** Maximum transient vertex buffer size. */
|
||||
uint32_t matTransientIbSize; /** Maximum transient index buffer size. */
|
||||
uint32_t minUniformBufferSize; /** Mimimum uniform buffer size. */
|
||||
|
||||
} bgfx_init_limits_t;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef BGFX_DEFINES_H_HEADER_GUARD
|
||||
#define BGFX_DEFINES_H_HEADER_GUARD
|
||||
|
||||
#define BGFX_API_VERSION UINT32_C(131)
|
||||
#define BGFX_API_VERSION UINT32_C(132)
|
||||
|
||||
/**
|
||||
* Color RGB/alpha/depth write. When it's not specified write will be disabled.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- vim: syntax=lua
|
||||
-- bgfx interface
|
||||
|
||||
version(131)
|
||||
version(132)
|
||||
|
||||
typedef "bool"
|
||||
typedef "char"
|
||||
@@ -732,8 +732,9 @@ struct.Limits { namespace = "Caps" }
|
||||
.maxOcclusionQueries "uint32_t" --- Maximum number of occlusion query handles.
|
||||
.maxEncoders "uint32_t" --- Maximum number of encoder threads.
|
||||
.minResourceCbSize "uint32_t" --- Minimum resource command buffer size.
|
||||
.transientVbSize "uint32_t" --- Maximum transient vertex buffer size.
|
||||
.transientIbSize "uint32_t" --- Maximum transient index buffer size.
|
||||
.maxTransientVbSize "uint32_t" --- Maximum transient vertex buffer size.
|
||||
.matTansientIbSize "uint32_t" --- Maximum transient index buffer size.
|
||||
.minUniformBufferSize "uint32_t" --- Mimimum uniform buffer size.
|
||||
|
||||
--- Renderer capabilities.
|
||||
struct.Caps
|
||||
@@ -803,10 +804,11 @@ struct.Resolution { ctor }
|
||||
|
||||
--- Configurable runtime limits parameters.
|
||||
struct.Limits { ctor, namespace = "Init" }
|
||||
.maxEncoders "uint16_t" --- Maximum number of encoder threads.
|
||||
.minResourceCbSize "uint32_t" --- Minimum resource command buffer size.
|
||||
.transientVbSize "uint32_t" --- Maximum transient vertex buffer size.
|
||||
.transientIbSize "uint32_t" --- Maximum transient index buffer size.
|
||||
.maxEncoders "uint16_t" --- Maximum number of encoder threads.
|
||||
.minResourceCbSize "uint32_t" --- Minimum resource command buffer size.
|
||||
.maxTransientVbSize "uint32_t" --- Maximum transient vertex buffer size.
|
||||
.matTransientIbSize "uint32_t" --- Maximum transient index buffer size.
|
||||
.minUniformBufferSize "uint32_t" --- Mimimum uniform buffer size.
|
||||
|
||||
--- Initialization parameters used by `bgfx::init`.
|
||||
struct.Init { ctor }
|
||||
|
||||
23
src/bgfx.cpp
23
src/bgfx.cpp
@@ -1649,8 +1649,9 @@ namespace bgfx
|
||||
LIMITS(maxOcclusionQueries);
|
||||
LIMITS(maxEncoders);
|
||||
LIMITS(minResourceCbSize);
|
||||
LIMITS(transientVbSize);
|
||||
LIMITS(transientIbSize);
|
||||
LIMITS(maxTransientVbSize);
|
||||
LIMITS(maxTransientIbSize);
|
||||
LIMITS(minUniformBufferSize);
|
||||
#undef LIMITS
|
||||
|
||||
BX_TRACE("");
|
||||
@@ -2016,14 +2017,14 @@ namespace bgfx
|
||||
m_textVideoMemBlitter.init(m_init.resolution.debugTextScale);
|
||||
m_clearQuad.init();
|
||||
|
||||
m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.transientVbSize);
|
||||
m_submit->m_transientIb = createTransientIndexBuffer(_init.limits.transientIbSize);
|
||||
m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.maxTransientVbSize);
|
||||
m_submit->m_transientIb = createTransientIndexBuffer(_init.limits.maxTransientIbSize);
|
||||
frame();
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_MULTITHREADED) )
|
||||
{
|
||||
m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.transientVbSize);
|
||||
m_submit->m_transientIb = createTransientIndexBuffer(_init.limits.transientIbSize);
|
||||
m_submit->m_transientVb = createTransientVertexBuffer(_init.limits.maxTransientVbSize);
|
||||
m_submit->m_transientIb = createTransientIndexBuffer(_init.limits.maxTransientIbSize);
|
||||
frame();
|
||||
}
|
||||
|
||||
@@ -3511,8 +3512,9 @@ namespace bgfx
|
||||
Init::Limits::Limits()
|
||||
: maxEncoders(BGFX_CONFIG_DEFAULT_MAX_ENCODERS)
|
||||
, minResourceCbSize(BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE)
|
||||
, transientVbSize(BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE)
|
||||
, transientIbSize(BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE)
|
||||
, maxTransientVbSize(BGFX_CONFIG_MAX_TRANSIENT_VERTEX_BUFFER_SIZE)
|
||||
, maxTransientIbSize(BGFX_CONFIG_MAX_TRANSIENT_INDEX_BUFFER_SIZE)
|
||||
, minUniformBufferSize(BGFX_CONFIG_MIN_UNIFORM_BUFFER_SIZE)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -3606,8 +3608,9 @@ namespace bgfx
|
||||
g_caps.limits.maxFBAttachments = 1;
|
||||
g_caps.limits.maxEncoders = init.limits.maxEncoders;
|
||||
g_caps.limits.minResourceCbSize = init.limits.minResourceCbSize;
|
||||
g_caps.limits.transientVbSize = init.limits.transientVbSize;
|
||||
g_caps.limits.transientIbSize = init.limits.transientIbSize;
|
||||
g_caps.limits.maxTransientVbSize = init.limits.maxTransientVbSize;
|
||||
g_caps.limits.maxTransientIbSize = init.limits.maxTransientIbSize;
|
||||
g_caps.limits.minUniformBufferSize = init.limits.minUniformBufferSize;
|
||||
|
||||
g_caps.vendorId = init.vendorId;
|
||||
g_caps.deviceId = init.deviceId;
|
||||
|
||||
@@ -1478,7 +1478,7 @@ namespace bgfx
|
||||
class UniformBuffer
|
||||
{
|
||||
public:
|
||||
static UniformBuffer* create(uint32_t _size = 1<<20)
|
||||
static UniformBuffer* create(uint32_t _size) // = BGFX_CONFIG_UNIFORM_BUFFER_SIZE)
|
||||
{
|
||||
const uint32_t structSize = sizeof(UniformBuffer)-sizeof(UniformBuffer::m_buffer);
|
||||
|
||||
@@ -2191,7 +2191,7 @@ namespace bgfx
|
||||
|
||||
for (uint32_t ii = 0; ii < num; ++ii)
|
||||
{
|
||||
m_uniformBuffer[ii] = UniformBuffer::create();
|
||||
m_uniformBuffer[ii] = UniformBuffer::create(g_caps.limits.minUniformBufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2247,7 +2247,7 @@ namespace bgfx
|
||||
{
|
||||
const uint32_t offset = bx::strideAlign(m_iboffset, _indexSize);
|
||||
uint32_t iboffset = offset + _num*_indexSize;
|
||||
iboffset = bx::min<uint32_t>(iboffset, g_caps.limits.transientIbSize);
|
||||
iboffset = bx::min<uint32_t>(iboffset, g_caps.limits.maxTransientIbSize);
|
||||
const uint32_t num = (iboffset-offset)/_indexSize;
|
||||
return num;
|
||||
}
|
||||
@@ -2266,7 +2266,7 @@ namespace bgfx
|
||||
{
|
||||
uint32_t offset = bx::strideAlign(m_vboffset, _stride);
|
||||
uint32_t vboffset = offset + _num * _stride;
|
||||
vboffset = bx::min<uint32_t>(vboffset, g_caps.limits.transientVbSize);
|
||||
vboffset = bx::min<uint32_t>(vboffset, g_caps.limits.maxTransientVbSize);
|
||||
uint32_t num = (vboffset-offset)/_stride;
|
||||
return num;
|
||||
}
|
||||
|
||||
57
src/config.h
57
src/config.h
@@ -321,37 +321,46 @@ static_assert(bx::isPowerOf2(BGFX_CONFIG_MAX_VIEWS), "BGFX_CONFIG_MAX_VIEWS must
|
||||
# define BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE (64<<10)
|
||||
#endif // BGFX_CONFIG_MIN_RESOURCE_COMMAND_BUFFER_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
|
||||
# define BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20)
|
||||
#endif // BGFX_CONFIG_TRANSIENT_VERTEX_BUFFER_SIZE
|
||||
#ifndef BGFX_CONFIG_MAX_TRANSIENT_VERTEX_BUFFER_SIZE
|
||||
/// Maximum transient vertex buffer size. There is no growth, and all transient
|
||||
/// vertices must fit into this buffer.
|
||||
# define BGFX_CONFIG_MAX_TRANSIENT_VERTEX_BUFFER_SIZE (6<<20)
|
||||
#endif // BGFX_CONFIG_MAX_TRANSIENT_VERTEX_BUFFER_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
|
||||
# define BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
|
||||
#endif // BGFX_CONFIG_TRANSIENT_INDEX_BUFFER_SIZE
|
||||
#ifndef BGFX_CONFIG_MAX_TRANSIENT_INDEX_BUFFER_SIZE
|
||||
/// Maximum transient index buffer size. There is no growth, and all transient
|
||||
/// indices must fit into this buffer.
|
||||
# define BGFX_CONFIG_MAX_TRANSIENT_INDEX_BUFFER_SIZE (2<<20)
|
||||
#endif // BGFX_CONFIG_MAX_TRANSIENT_INDEX_BUFFER_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE
|
||||
#ifndef BGFX_CONFIG_MIN_UNIFORM_BUFFER_SIZE
|
||||
/// Mimumum uniform buffer size. This buffer will resize on demand.
|
||||
# define BGFX_CONFIG_MIN_UNIFORM_BUFFER_SIZE (1<<20)
|
||||
#endif // BGFX_CONFIG_MIN_UNIFORM_BUFFER_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_CACHED_DEVICE_MEMORY_ALLOCATIONS_SIZE
|
||||
/// Amount of allowed memory allocations left on device to use for recycling during
|
||||
/// later allocations. This can be beneficial in case the driver is slow allocating memory
|
||||
/// on the device.
|
||||
/// Note: Currently only used by the Vulkan backend.
|
||||
# define BGFX_CONFIG_CACHED_DEVICE_MEMORY_ALLOCATIONS_SIZE (128 << 20)
|
||||
#endif // BGFX_CONFIG_CACHED_DEVICE_MEMORY_ALLOCATIONS_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_STAGING_SCRATCH_BUFFER_SIZE
|
||||
/// The threshold of data size above which the staging scratch buffer will
|
||||
/// not be used, but instead a separate device memory allocation will take
|
||||
/// place to stage the data for copying to device.
|
||||
# define BGFX_CONFIG_MAX_STAGING_SCRATCH_BUFFER_SIZE (16 << 20)
|
||||
#endif // BGFX_CONFIG_MAX_STAGING_SCRATCH_BUFFER_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE
|
||||
/// Amount of scratch buffer size (per in-flight frame) that will be reserved
|
||||
/// for staging data for copying to the device (such as vertex buffer data,
|
||||
/// texture data, etc). This buffer will be used instead of allocating memory
|
||||
/// on device separately for every data copy.
|
||||
/// Note: Currently only used by the Vulkan backend.
|
||||
# define BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE (32<<20)
|
||||
#endif
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_BYTES_CACHED_DEVICE_MEMORY_ALLOCATIONS
|
||||
/// Amount of allowed memory allocations left on device to use for recycling during
|
||||
/// later allocations. This can be beneficial in case the driver is slow allocating memory
|
||||
/// on the device.
|
||||
/// Note: Currently only used by the Vulkan backend.
|
||||
# define BGFX_CONFIG_MAX_BYTES_CACHED_DEVICE_MEMORY_ALLOCATIONS (128 << 20)
|
||||
#endif
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER
|
||||
/// The threshold of data size above which the staging scratch buffer will
|
||||
/// not be used, but instead a separate device memory allocation will take
|
||||
/// place to stage the data for copying to device.
|
||||
# define BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER (16 << 20)
|
||||
#endif
|
||||
# define BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE (32<<20)
|
||||
#endif // BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE
|
||||
|
||||
#ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
|
||||
# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
|
||||
|
||||
@@ -2026,7 +2026,7 @@ VK_IMPORT_DEVICE
|
||||
for (uint32_t ii = 0; ii < m_numFramesInFlight; ++ii)
|
||||
{
|
||||
BX_TRACE("Create scratch staging buffer %d", ii);
|
||||
m_scratchStagingBuffer[ii].createStaging(BGFX_CONFIG_PER_FRAME_SCRATCH_STAGING_BUFFER_SIZE);
|
||||
m_scratchStagingBuffer[ii].createStaging(BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4524,7 +4524,7 @@ VK_IMPORT_DEVICE
|
||||
StagingBufferVK result;
|
||||
ScratchBufferVK &scratch = m_scratchStagingBuffer[m_cmd.m_currentFrameInFlight];
|
||||
|
||||
if (_size <= BGFX_CONFIG_MAX_STAGING_SIZE_FOR_SCRATCH_BUFFER)
|
||||
if (_size <= BGFX_CONFIG_MAX_STAGING_SCRATCH_BUFFER_SIZE)
|
||||
{
|
||||
const uint32_t scratchOffset = scratch.alloc(_size, _align);
|
||||
|
||||
@@ -4750,7 +4750,7 @@ VK_DESTROY
|
||||
}
|
||||
totalSizeCached += _alloc.size;
|
||||
|
||||
while (totalSizeCached > BGFX_CONFIG_MAX_BYTES_CACHED_DEVICE_MEMORY_ALLOCATIONS)
|
||||
while (totalSizeCached > BGFX_CONFIG_CACHED_DEVICE_MEMORY_ALLOCATIONS_SIZE)
|
||||
{
|
||||
BX_ASSERT(lru.getNumHandles() > 0, "Memory badly counted.");
|
||||
uint16_t handle = lru.getBack();
|
||||
|
||||
Reference in New Issue
Block a user