Merge branch 'master' of github.com:bkaradzic/bgfx

This commit is contained in:
Branimir Karadžić 2016-04-19 15:47:24 -07:00
commit 4036371a75
3 changed files with 19 additions and 5 deletions

View File

@ -298,10 +298,12 @@ typedef struct bgfx_hmd
/**/
typedef struct bgfx_stats
{
uint64_t cpuTime;
uint64_t cpuTimeBegin;
uint64_t cpuTimeEnd;
uint64_t cpuTimerFreq;
uint64_t gpuTime;
uint64_t gpuTimeBegin;
uint64_t gpuTimeEnd;
uint64_t gpuTimerFreq;
} bgfx_stats_t;

View File

@ -3657,11 +3657,17 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame, BGFX_RENDER_FRAME_COUNT);
BX_STATIC_ASSERT(sizeof(_cppstruct) == sizeof(_c99struct) )
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory, bgfx_memory_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform, bgfx_transform_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::HMD::Eye, bgfx_hmd_eye_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::HMD, bgfx_hmd_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats, bgfx_stats_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexDecl, bgfx_vertex_decl_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer, bgfx_transient_index_buffer_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer, bgfx_instance_data_buffer_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TextureInfo, bgfx_texture_info_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Attachment, bgfx_attachment_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Caps::GPU, bgfx_caps_gpu_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Caps, bgfx_caps_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::PlatformData, bgfx_platform_data_t);
BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InternalData, bgfx_internal_data_t);

View File

@ -2385,7 +2385,10 @@ namespace bgfx
}
uint32_t offset = (dib.m_startIndex + _startIndex)*indexSize;
uint32_t size = bx::uint32_min(bx::uint32_satsub(dib.m_size, _startIndex*indexSize), _mem->size);
uint32_t size = bx::uint32_min(offset
+ bx::uint32_min(bx::uint32_satsub(dib.m_size, _startIndex*indexSize), _mem->size)
, BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE) - offset
;
BX_CHECK(_mem->size <= size, "Truncating dynamic index buffer update (size %d, mem size %d)."
, size
, _mem->size
@ -2535,9 +2538,12 @@ namespace bgfx
}
uint32_t offset = (dvb.m_startVertex + _startVertex)*dvb.m_stride;
uint32_t size = bx::uint32_min(bx::uint32_satsub(dvb.m_size, _startVertex*dvb.m_stride), _mem->size);
uint32_t size = bx::uint32_min(offset
+ bx::uint32_min(bx::uint32_satsub(dvb.m_size, _startVertex*dvb.m_stride), _mem->size)
, BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE) - offset
;
BX_CHECK(_mem->size <= size, "Truncating dynamic vertex buffer update (size %d, mem size %d)."
, dvb.m_size
, size
, _mem->size
);