Prechádzať zdrojové kódy

Convert primitive type to point list regardless of draw call specified primitive type to emulate point fill mode on D3D11. Closes #1028.

Lasse Öörni 10 rokov pred
rodič
commit
e4b6749880

+ 10 - 1
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -161,7 +161,7 @@ static const D3D11_FILL_MODE d3dFillMode[] =
 {
     D3D11_FILL_SOLID,
     D3D11_FILL_WIREFRAME,
-    D3D11_FILL_WIREFRAME // Point mode not supported
+    D3D11_FILL_WIREFRAME // Point fill mode not supported
 };
 
 static unsigned GetD3DColor(const Color& color)
@@ -821,6 +821,9 @@ void Graphics::Draw(PrimitiveType type, unsigned vertexStart, unsigned vertexCou
     unsigned primitiveCount;
     D3D_PRIMITIVE_TOPOLOGY d3dPrimitiveType;
 
+    if (fillMode_ == FILL_POINT)
+        type = POINT_LIST;
+
     GetD3DPrimitiveType(vertexCount, type, primitiveCount, d3dPrimitiveType);
     if (d3dPrimitiveType != primitiveType_)
     {
@@ -843,6 +846,9 @@ void Graphics::Draw(PrimitiveType type, unsigned indexStart, unsigned indexCount
     unsigned primitiveCount;
     D3D_PRIMITIVE_TOPOLOGY d3dPrimitiveType;
 
+    if (fillMode_ == FILL_POINT)
+        type = POINT_LIST;
+
     GetD3DPrimitiveType(indexCount, type, primitiveCount, d3dPrimitiveType);
     if (d3dPrimitiveType != primitiveType_)
     {
@@ -866,6 +872,9 @@ void Graphics::DrawInstanced(PrimitiveType type, unsigned indexStart, unsigned i
     unsigned primitiveCount;
     D3D_PRIMITIVE_TOPOLOGY d3dPrimitiveType;
 
+    if (fillMode_ == FILL_POINT)
+        type = POINT_LIST;
+
     GetD3DPrimitiveType(indexCount, type, primitiveCount, d3dPrimitiveType);
     if (d3dPrimitiveType != primitiveType_)
     {