Point,Line,Triangle -> PointList,LineList,TriangleList

This commit is contained in:
Austin Eng 2017-07-26 18:10:44 -04:00 committed by Austin Eng
parent c2def461a1
commit 439d963ccd
7 changed files with 31 additions and 31 deletions

View File

@ -694,10 +694,10 @@
"primitive topology": { "primitive topology": {
"category": "enum", "category": "enum",
"values": [ "values": [
{"value": 0, "name": "point"}, {"value": 0, "name": "point list"},
{"value": 1, "name": "line"}, {"value": 1, "name": "line list"},
{"value": 2, "name": "line strip"}, {"value": 2, "name": "line strip"},
{"value": 3, "name": "triangle"}, {"value": 3, "name": "triangle list"},
{"value": 4, "name": "triangle strip"} {"value": 4, "name": "triangle strip"}
] ]
}, },

View File

@ -57,7 +57,7 @@ namespace backend {
Ref<DepthStencilStateBase> depthStencilState; Ref<DepthStencilStateBase> depthStencilState;
Ref<InputStateBase> inputState; Ref<InputStateBase> inputState;
// TODO(enga@google.com): Remove default when we validate that all required properties are set // TODO(enga@google.com): Remove default when we validate that all required properties are set
nxt::PrimitiveTopology primitiveTopology = nxt::PrimitiveTopology::Triangle; nxt::PrimitiveTopology primitiveTopology = nxt::PrimitiveTopology::TriangleList;
Ref<RenderPassBase> renderPass; Ref<RenderPassBase> renderPass;
uint32_t subpass; uint32_t subpass;
}; };

View File

@ -28,13 +28,13 @@ namespace d3d12 {
namespace { namespace {
D3D12_PRIMITIVE_TOPOLOGY D3D12PrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) { D3D12_PRIMITIVE_TOPOLOGY D3D12PrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) {
switch (primitiveTopology) { switch (primitiveTopology) {
case nxt::PrimitiveTopology::Point: case nxt::PrimitiveTopology::PointList:
return D3D_PRIMITIVE_TOPOLOGY_POINTLIST; return D3D_PRIMITIVE_TOPOLOGY_POINTLIST;
case nxt::PrimitiveTopology::Line: case nxt::PrimitiveTopology::LineList:
return D3D_PRIMITIVE_TOPOLOGY_LINELIST; return D3D_PRIMITIVE_TOPOLOGY_LINELIST;
case nxt::PrimitiveTopology::LineStrip: case nxt::PrimitiveTopology::LineStrip:
return D3D_PRIMITIVE_TOPOLOGY_LINESTRIP; return D3D_PRIMITIVE_TOPOLOGY_LINESTRIP;
case nxt::PrimitiveTopology::Triangle: case nxt::PrimitiveTopology::TriangleList:
return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
case nxt::PrimitiveTopology::TriangleStrip: case nxt::PrimitiveTopology::TriangleStrip:
return D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; return D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
@ -45,12 +45,12 @@ namespace d3d12 {
D3D12_PRIMITIVE_TOPOLOGY_TYPE D3D12PrimitiveTopologyType(nxt::PrimitiveTopology primitiveTopology) { D3D12_PRIMITIVE_TOPOLOGY_TYPE D3D12PrimitiveTopologyType(nxt::PrimitiveTopology primitiveTopology) {
switch (primitiveTopology) { switch (primitiveTopology) {
case nxt::PrimitiveTopology::Point: case nxt::PrimitiveTopology::PointList:
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT; return D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT;
case nxt::PrimitiveTopology::Line: case nxt::PrimitiveTopology::LineList:
case nxt::PrimitiveTopology::LineStrip: case nxt::PrimitiveTopology::LineStrip:
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE; return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE;
case nxt::PrimitiveTopology::Triangle: case nxt::PrimitiveTopology::TriangleList:
case nxt::PrimitiveTopology::TriangleStrip: case nxt::PrimitiveTopology::TriangleStrip:
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
default: default:

View File

@ -26,13 +26,13 @@ namespace metal {
namespace { namespace {
MTLPrimitiveType MTLPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) { MTLPrimitiveType MTLPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) {
switch (primitiveTopology) { switch (primitiveTopology) {
case nxt::PrimitiveTopology::Point: case nxt::PrimitiveTopology::PointList:
return MTLPrimitiveTypePoint; return MTLPrimitiveTypePoint;
case nxt::PrimitiveTopology::Line: case nxt::PrimitiveTopology::LineList:
return MTLPrimitiveTypeLine; return MTLPrimitiveTypeLine;
case nxt::PrimitiveTopology::LineStrip: case nxt::PrimitiveTopology::LineStrip:
return MTLPrimitiveTypeLineStrip; return MTLPrimitiveTypeLineStrip;
case nxt::PrimitiveTopology::Triangle: case nxt::PrimitiveTopology::TriangleList:
return MTLPrimitiveTypeTriangle; return MTLPrimitiveTypeTriangle;
case nxt::PrimitiveTopology::TriangleStrip: case nxt::PrimitiveTopology::TriangleStrip:
return MTLPrimitiveTypeTriangleStrip; return MTLPrimitiveTypeTriangleStrip;
@ -41,12 +41,12 @@ namespace metal {
MTLPrimitiveTopologyClass MTLInputPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) { MTLPrimitiveTopologyClass MTLInputPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) {
switch (primitiveTopology) { switch (primitiveTopology) {
case nxt::PrimitiveTopology::Point: case nxt::PrimitiveTopology::PointList:
return MTLPrimitiveTopologyClassPoint; return MTLPrimitiveTopologyClassPoint;
case nxt::PrimitiveTopology::Line: case nxt::PrimitiveTopology::LineList:
case nxt::PrimitiveTopology::LineStrip: case nxt::PrimitiveTopology::LineStrip:
return MTLPrimitiveTopologyClassLine; return MTLPrimitiveTopologyClassLine;
case nxt::PrimitiveTopology::Triangle: case nxt::PrimitiveTopology::TriangleList:
case nxt::PrimitiveTopology::TriangleStrip: case nxt::PrimitiveTopology::TriangleStrip:
return MTLPrimitiveTopologyClassTriangle; return MTLPrimitiveTopologyClassTriangle;
} }

View File

@ -24,13 +24,13 @@ namespace opengl {
namespace { namespace {
GLenum GLPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) { GLenum GLPrimitiveTopology(nxt::PrimitiveTopology primitiveTopology) {
switch (primitiveTopology) { switch (primitiveTopology) {
case nxt::PrimitiveTopology::Point: case nxt::PrimitiveTopology::PointList:
return GL_POINTS; return GL_POINTS;
case nxt::PrimitiveTopology::Line: case nxt::PrimitiveTopology::LineList:
return GL_LINES; return GL_LINES;
case nxt::PrimitiveTopology::LineStrip: case nxt::PrimitiveTopology::LineStrip:
return GL_LINE_STRIP; return GL_LINE_STRIP;
case nxt::PrimitiveTopology::Triangle: case nxt::PrimitiveTopology::TriangleList:
return GL_TRIANGLES; return GL_TRIANGLES;
case nxt::PrimitiveTopology::TriangleStrip: case nxt::PrimitiveTopology::TriangleStrip:
return GL_TRIANGLE_STRIP; return GL_TRIANGLE_STRIP;

View File

@ -249,8 +249,8 @@ class PrimitiveTopologyTest : public NXTTest {
}; };
// Test Point primitive topology // Test Point primitive topology
TEST_P(PrimitiveTopologyTest, Point) { TEST_P(PrimitiveTopologyTest, PointList) {
DoTest(nxt::PrimitiveTopology::Point, { DoTest(nxt::PrimitiveTopology::PointList, {
// Check that the points are drawn // Check that the points are drawn
TestPoints(kPointTestLocations, true), TestPoints(kPointTestLocations, true),
@ -263,8 +263,8 @@ TEST_P(PrimitiveTopologyTest, Point) {
} }
// Test Line primitive topology // Test Line primitive topology
TEST_P(PrimitiveTopologyTest, Line) { TEST_P(PrimitiveTopologyTest, LineList) {
DoTest(nxt::PrimitiveTopology::Line, { DoTest(nxt::PrimitiveTopology::LineList, {
// Check that lines are drawn // Check that lines are drawn
TestPoints(kLineTestLocations, true), TestPoints(kLineTestLocations, true),
@ -289,8 +289,8 @@ TEST_P(PrimitiveTopologyTest, LineStrip) {
} }
// Test Triangle primitive topology // Test Triangle primitive topology
TEST_P(PrimitiveTopologyTest, Triangle) { TEST_P(PrimitiveTopologyTest, TriangleList) {
DoTest(nxt::PrimitiveTopology::Triangle, { DoTest(nxt::PrimitiveTopology::TriangleList, {
// Check that triangles are drawn // Check that triangles are drawn
TestPoints(kTriangleTestLocations, true), TestPoints(kTriangleTestLocations, true),

View File

@ -48,7 +48,7 @@ class RenderPipelineValidationTest : public ValidationTest {
.SetLayout(pipelineLayout) .SetLayout(pipelineLayout)
.SetStage(nxt::ShaderStage::Vertex, vsModule, "main") .SetStage(nxt::ShaderStage::Vertex, vsModule, "main")
.SetStage(nxt::ShaderStage::Fragment, fsModule, "main") .SetStage(nxt::ShaderStage::Fragment, fsModule, "main")
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle); .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList);
return builder; return builder;
} }
@ -74,7 +74,7 @@ TEST_F(RenderPipelineValidationTest, CreationMissingProperty) {
.SetSubpass(renderpass, 0) .SetSubpass(renderpass, 0)
.SetLayout(pipelineLayout) .SetLayout(pipelineLayout)
.SetStage(nxt::ShaderStage::Fragment, fsModule, "main") .SetStage(nxt::ShaderStage::Fragment, fsModule, "main")
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle) .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList)
.GetResult(); .GetResult();
} }
@ -84,7 +84,7 @@ TEST_F(RenderPipelineValidationTest, CreationMissingProperty) {
.SetSubpass(renderpass, 0) .SetSubpass(renderpass, 0)
.SetLayout(pipelineLayout) .SetLayout(pipelineLayout)
.SetStage(nxt::ShaderStage::Vertex, vsModule, "main") .SetStage(nxt::ShaderStage::Vertex, vsModule, "main")
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle) .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList)
.GetResult(); .GetResult();
} }
@ -94,7 +94,7 @@ TEST_F(RenderPipelineValidationTest, CreationMissingProperty) {
.SetLayout(pipelineLayout) .SetLayout(pipelineLayout)
.SetStage(nxt::ShaderStage::Vertex, vsModule, "main") .SetStage(nxt::ShaderStage::Vertex, vsModule, "main")
.SetStage(nxt::ShaderStage::Fragment, fsModule, "main") .SetStage(nxt::ShaderStage::Fragment, fsModule, "main")
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle) .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList)
.GetResult(); .GetResult();
} }
} }
@ -107,7 +107,7 @@ TEST_F(RenderPipelineValidationTest, DISABLED_TodoCreationMissingProperty) {
.SetSubpass(renderpass, 0) .SetSubpass(renderpass, 0)
.SetStage(nxt::ShaderStage::Vertex, vsModule, "main") .SetStage(nxt::ShaderStage::Vertex, vsModule, "main")
.SetStage(nxt::ShaderStage::Fragment, fsModule, "main") .SetStage(nxt::ShaderStage::Fragment, fsModule, "main")
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle) .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList)
.GetResult(); .GetResult();
} }
@ -134,7 +134,7 @@ TEST_F(RenderPipelineValidationTest, DISABLED_CreationDuplicates) {
// Fails because primitive topology is set twice // Fails because primitive topology is set twice
{ {
AddDefaultStates(AssertWillBeError(device.CreateRenderPipelineBuilder())) AddDefaultStates(AssertWillBeError(device.CreateRenderPipelineBuilder()))
.SetPrimitiveTopology(nxt::PrimitiveTopology::Triangle) .SetPrimitiveTopology(nxt::PrimitiveTopology::TriangleList)
.GetResult(); .GetResult();
} }