Empty Vertex/Index Buffer Fixes

Reporter: RobertBColton  |  Status: open  |  Last Modified: July 28, 2019, 11:44:18 PM

It has always been the case that Direct3D9 won't run the Minecraft example, this is not a new regression. The problem exhibited in that example is that it sometimes defines empty primitives on the model it uses to render the 3D world. We even have a debug message about that in the model class right now, which I am unsure of whether we should remove. Regardless, Direct3D9 breaks down because the API prevents you from allocating a vertex buffer of size 0 which is different from OpenGL.

Size of the vertex buffer, in bytes. For FVF vertex buffers, Length must be large enough to contain at least one vertex, but it need not be a multiple of the vertex size. Length is not validated for non-FVF buffers. See Remarks.
https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-createvertexbuffer

codecov[bot]  
>Codecov Report

Merging #1840 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1840   +/-   ##
=======================================
  Coverage   24.89%   24.89%           
=======================================
  Files         177      177           
  Lines       16743    16743           
=======================================
  Hits         4169     4169           
  Misses      12574    12574
Impacted Files Coverage Δ
...MAsystem/SHELL/Graphics_Systems/OpenGL1/vertex.cpp 69.42% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7fcb1ce...ed6486e. Read the comment docs.

Please sign in to post comments, or you can view this issue on GitHub.