diff --git a/Source/Game/Runtime.cpp b/Source/Game/Runtime.cpp index 44183f78..af2d7813 100644 --- a/Source/Game/Runtime.cpp +++ b/Source/Game/Runtime.cpp @@ -61,6 +61,11 @@ const char* currentVersion = #ifdef PERIMETER_DEBUG " Debug" #endif +#ifdef PERIMETER_ARCH_64 +" 64 bits" +#else +" 32 bits" +#endif ; uint16_t currentVersionNumbers[] = {0, 0, 0}; diff --git a/Source/Render/D3D/D3DRender.cpp b/Source/Render/D3D/D3DRender.cpp index 6e1c56ce..1decde70 100644 --- a/Source/Render/D3D/D3DRender.cpp +++ b/Source/Render/D3D/D3DRender.cpp @@ -1234,7 +1234,11 @@ void cD3DRender::DeleteDynamicBuffers() { } const uint32_t D3D_LOCK_FLAGS_STATIC = D3DLOCK_NOSYSLOCK | D3DLOCK_NO_DIRTY_UPDATE; +#ifndef PERIMETER_ARCH_64 const uint32_t D3D_LOCK_FLAGS_DYNAMIC = D3D_LOCK_FLAGS_STATIC | D3DLOCK_DISCARD; +#else +const uint32_t D3D_LOCK_FLAGS_DYNAMIC = D3D_LOCK_FLAGS_STATIC; +#endif void cD3DRender::UpdateD3DVertexBuffer(VertexBuffer* vb, size_t len) { xassert(!vb->burned); @@ -1267,8 +1271,15 @@ void cD3DRender::UpdateD3DVertexBuffer(VertexBuffer* vb, size_t len) { void* lock_ptr = nullptr; uint32_t flags = vb->dynamic ? D3D_LOCK_FLAGS_DYNAMIC : D3D_LOCK_FLAGS_STATIC; RDCALL(vb->d3d->Lock(0, len, &lock_ptr, flags)); - memcpy(lock_ptr, vb->data, len); - vb->d3d->Unlock(); + if (lock_ptr) { + memcpy(lock_ptr, vb->data, len); + vb->d3d->Unlock(); + } else { + xassert(0); +#ifdef PERIMETER_EXODUS + fprintf(stderr, "D3D vertex buffer lock failed!\n"); +#endif + } } void cD3DRender::UpdateD3DIndexBuffer(IndexBuffer* ib, size_t len) { @@ -1301,8 +1312,15 @@ void cD3DRender::UpdateD3DIndexBuffer(IndexBuffer* ib, size_t len) { void* lock_ptr = nullptr; uint32_t flags = ib->dynamic ? D3D_LOCK_FLAGS_DYNAMIC : D3D_LOCK_FLAGS_STATIC; RDCALL(ib->d3d->Lock(0, len, &lock_ptr, flags)); - memcpy(lock_ptr, ib->data, len); - ib->d3d->Unlock(); + if (lock_ptr) { + memcpy(lock_ptr, ib->data, len); + ib->d3d->Unlock(); + } else { + xassert(0); +#ifdef PERIMETER_EXODUS + fprintf(stderr, "D3D index buffer lock failed!\n"); +#endif + } } void cD3DRender::DeleteVertexBuffer(VertexBuffer &vb) {