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": {
"category": "enum",
"values": [
{"value": 0, "name": "point"},
{"value": 1, "name": "line"},
{"value": 0, "name": "point list"},
{"value": 1, "name": "line list"},
{"value": 2, "name": "line strip"},
{"value": 3, "name": "triangle"},
{"value": 3, "name": "triangle list"},
{"value": 4, "name": "triangle strip"}
]
},

View File

@ -57,7 +57,7 @@ namespace backend {
Ref<DepthStencilStateBase> depthStencilState;
Ref<InputStateBase> inputState;
// 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;
uint32_t subpass;
};

View File

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

View File

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

View File

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

View File

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

View File

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