Direct3D11: Fix all rendering issues with this one neat trick

This commit is contained in:
UnknownShadow200 2021-09-24 17:32:55 +10:00
parent ee0d8ae311
commit fb00a8a78a

View File

@ -254,6 +254,7 @@ cc_bool render;
void Gfx_SetVertexFormat(VertexFormat fmt) {
if (fmt == gfx_format) return;
gfx_format = fmt;
gfx_stride = strideSizes[fmt];
render = fmt == VERTEX_FORMAT_TEXTURED;
IA_UpdateLayout();
@ -306,6 +307,10 @@ void Gfx_UnlockDynamicVb(GfxResourceID vb) {
}
void Gfx_SetDynamicVbData(GfxResourceID vb, void* vertices, int vCount) {
void* data = Gfx_LockDynamicVb(vb, gfx_format, vCount);
Mem_Copy(data, vertices, vCount * gfx_stride);
Gfx_UnlockDynamicVb(vb);
Gfx_BindVb(vb);
}