Remove typedefs for passed deprecations

Bug: None
Change-Id: I922fc4b1149c94f891692e6961423162a5a131e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62360
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2021-08-23 10:10:11 +00:00 committed by Dawn LUCI CQ
parent dd1a5b3ad3
commit da230e5e5c
8 changed files with 49 additions and 73 deletions

View File

@ -208,10 +208,6 @@
{"name": "dst factor", "type": "blend factor", "default": "zero"}
]
},
"blend descriptor": {
"category": "typedef",
"type": "blend component"
},
"blend factor": {
"category": "enum",
"values": [
@ -294,10 +290,6 @@
}
]
},
"buffer copy view": {
"category": "typedef",
"type": "image copy buffer"
},
"buffer descriptor": {
"category": "structure",
"extensible": true,
@ -1032,10 +1024,6 @@
{"name": "shader location", "type": "uint32_t"}
]
},
"vertex attribute descriptor": {
"category": "typedef",
"type": "vertex attribute"
},
"vertex buffer layout": {
"category": "structure",
"extensible": false,
@ -1046,10 +1034,6 @@
{"name": "attributes", "type": "vertex attribute", "annotation": "const*", "length": "attribute count"}
]
},
"vertex buffer layout descriptor": {
"category": "typedef",
"type": "vertex buffer layout"
},
"input step mode": {
"category": "typedef",
"type": "vertex step mode"
@ -1750,10 +1734,6 @@
{"name": "pass op", "type": "stencil operation", "default": "keep"}
]
},
"stencil state face descriptor": {
"category": "typedef",
"type": "stencil face state"
},
"surface": {
"category": "object"
},
@ -1902,10 +1882,6 @@
{"value": 3, "name": "depth comparison"}
]
},
"texture copy view": {
"category": "typedef",
"type": "image copy texture"
},
"texture data layout": {
"category": "structure",
"extensible": true,

View File

@ -274,7 +274,7 @@ namespace dawn_native { namespace d3d12 {
}
}
D3D12_DEPTH_STENCILOP_DESC StencilOpDesc(const StencilStateFaceDescriptor descriptor) {
D3D12_DEPTH_STENCILOP_DESC StencilOpDesc(const StencilFaceState& descriptor) {
D3D12_DEPTH_STENCILOP_DESC desc;
desc.StencilFailOp = StencilOp(descriptor.failOp);

View File

@ -151,7 +151,7 @@ namespace dawn_native { namespace opengl {
state->writeMask & wgpu::ColorWriteMask::Alpha);
}
bool Equal(const BlendDescriptor& lhs, const BlendDescriptor& rhs) {
bool Equal(const BlendComponent& lhs, const BlendComponent& rhs) {
return lhs.operation == rhs.operation && lhs.srcFactor == rhs.srcFactor &&
lhs.dstFactor == rhs.dstFactor;
}

View File

@ -843,7 +843,7 @@ TEST_P(ColorStateTest, IndependentColorState) {
// Blend state intentionally omitted for target 2
wgpu::BlendDescriptor blendComponent3;
wgpu::BlendComponent blendComponent3;
blendComponent3.operation = wgpu::BlendOperation::Min;
blendComponent3.srcFactor = wgpu::BlendFactor::One;
blendComponent3.dstFactor = wgpu::BlendFactor::One;

View File

@ -66,7 +66,7 @@ class VertexStateTest : public DawnTest {
VertexFormat format;
VertexStepMode step;
};
wgpu::RenderPipeline MakeTestPipeline(const utils::ComboVertexStateDescriptor& vertexState,
wgpu::RenderPipeline MakeTestPipeline(const utils::ComboVertexState& vertexState,
int multiplier,
const std::vector<ShaderTestSpec>& testSpec) {
std::ostringstream vs;
@ -166,7 +166,7 @@ class VertexStateTest : public DawnTest {
};
void MakeVertexState(const std::vector<VertexBufferSpec>& buffers,
utils::ComboVertexStateDescriptor* vertexState) {
utils::ComboVertexState* vertexState) {
uint32_t vertexBufferCount = 0;
uint32_t totalNumAttributes = 0;
for (const VertexBufferSpec& buffer : buffers) {
@ -248,7 +248,7 @@ class VertexStateTest : public DawnTest {
// Test compilation and usage of the fixture :)
TEST_P(VertexStateTest, Basic) {
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{4 * sizeof(float), VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x4}}}},
&vertexState);
@ -270,7 +270,7 @@ TEST_P(VertexStateTest, ZeroStride) {
// This test was failing only on AMD but the OpenGL backend doesn't gather PCI info yet.
DAWN_SUPPRESS_TEST_IF(IsLinux() && IsOpenGL());
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState({{0, VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x4}}}}, &vertexState);
wgpu::RenderPipeline pipeline =
MakeTestPipeline(vertexState, 0, {{0, VertexFormat::Float32x4, VertexStepMode::Vertex}});
@ -291,7 +291,7 @@ TEST_P(VertexStateTest, AttributeExpanding) {
// R32F case
{
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState({{0, VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32}}}},
&vertexState);
wgpu::RenderPipeline pipeline =
@ -302,7 +302,7 @@ TEST_P(VertexStateTest, AttributeExpanding) {
}
// RG32F case
{
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState({{0, VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x2}}}},
&vertexState);
wgpu::RenderPipeline pipeline = MakeTestPipeline(
@ -313,7 +313,7 @@ TEST_P(VertexStateTest, AttributeExpanding) {
}
// RGB32F case
{
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState({{0, VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x3}}}},
&vertexState);
wgpu::RenderPipeline pipeline = MakeTestPipeline(
@ -329,7 +329,7 @@ TEST_P(VertexStateTest, StrideLargerThanAttributes) {
// This test was failing only on AMD but the OpenGL backend doesn't gather PCI info yet.
DAWN_SUPPRESS_TEST_IF(IsLinux() && IsOpenGL());
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{8 * sizeof(float), VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x4}}}},
&vertexState);
@ -348,7 +348,7 @@ TEST_P(VertexStateTest, StrideLargerThanAttributes) {
// Test two attributes at an offset, vertex version
TEST_P(VertexStateTest, TwoAttributesAtAnOffsetVertex) {
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{8 * sizeof(float),
VertexStepMode::Vertex,
@ -369,7 +369,7 @@ TEST_P(VertexStateTest, TwoAttributesAtAnOffsetVertex) {
// Test two attributes at an offset, instance version
TEST_P(VertexStateTest, TwoAttributesAtAnOffsetInstance) {
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{8 * sizeof(float),
VertexStepMode::Instance,
@ -390,7 +390,7 @@ TEST_P(VertexStateTest, TwoAttributesAtAnOffsetInstance) {
// Test a pure-instance input state
TEST_P(VertexStateTest, PureInstance) {
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{4 * sizeof(float), VertexStepMode::Instance, {{0, 0, VertexFormat::Float32x4}}}},
&vertexState);
@ -411,7 +411,7 @@ TEST_P(VertexStateTest, PureInstance) {
// Test with mixed everything, vertex vs. instance, different stride and offsets
// different attribute types
TEST_P(VertexStateTest, MixedEverything) {
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState(
{{12 * sizeof(float),
VertexStepMode::Vertex,
@ -447,7 +447,7 @@ TEST_P(VertexStateTest, MixedEverything) {
// Test input state is unaffected by unused vertex slot
TEST_P(VertexStateTest, UnusedVertexSlot) {
// Instance input state, using slot 1
utils::ComboVertexStateDescriptor instanceVertexState;
utils::ComboVertexState instanceVertexState;
MakeVertexState(
{{0, VertexStepMode::Vertex, {}},
{4 * sizeof(float), VertexStepMode::Instance, {{0, 0, VertexFormat::Float32x4}}}},
@ -488,7 +488,7 @@ TEST_P(VertexStateTest, UnusedVertexSlot) {
// SetVertexBuffer should be reapplied when the input state changes.
TEST_P(VertexStateTest, MultiplePipelinesMixedVertexState) {
// Basic input state, using slot 0
utils::ComboVertexStateDescriptor vertexVertexState;
utils::ComboVertexState vertexVertexState;
MakeVertexState(
{{4 * sizeof(float), VertexStepMode::Vertex, {{0, 0, VertexFormat::Float32x4}}}},
&vertexVertexState);
@ -496,7 +496,7 @@ TEST_P(VertexStateTest, MultiplePipelinesMixedVertexState) {
vertexVertexState, 1, {{0, VertexFormat::Float32x4, VertexStepMode::Vertex}});
// Instance input state, using slot 1
utils::ComboVertexStateDescriptor instanceVertexState;
utils::ComboVertexState instanceVertexState;
MakeVertexState(
{{0, VertexStepMode::Instance, {}},
{4 * sizeof(float), VertexStepMode::Instance, {{0, 0, VertexFormat::Float32x4}}}},
@ -538,7 +538,7 @@ TEST_P(VertexStateTest, MultiplePipelinesMixedVertexState) {
TEST_P(VertexStateTest, LastAllowedVertexBuffer) {
constexpr uint32_t kBufferIndex = kMaxVertexBuffers - 1;
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
// All the other vertex buffers default to no attributes
vertexState.vertexBufferCount = kMaxVertexBuffers;
vertexState.cVertexBuffers[kBufferIndex].arrayStride = 4 * sizeof(float);
@ -560,7 +560,7 @@ TEST_P(VertexStateTest, LastAllowedVertexBuffer) {
TEST_P(VertexStateTest, OverlappingVertexAttributes) {
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 3, 3);
utils::ComboVertexStateDescriptor vertexState;
utils::ComboVertexState vertexState;
MakeVertexState({{16,
VertexStepMode::Vertex,
{

View File

@ -20,7 +20,7 @@
class VertexStateTest : public ValidationTest {
protected:
void CreatePipeline(bool success,
const utils::ComboVertexStateDescriptor& state,
const utils::ComboVertexState& state,
const char* vertexSource) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, vertexSource);
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@ -52,13 +52,13 @@ class VertexStateTest : public ValidationTest {
// Check an empty vertex input is valid
TEST_F(VertexStateTest, EmptyIsOk) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
CreatePipeline(true, state, kDummyVertexShader);
}
// Check null buffer is valid
TEST_F(VertexStateTest, NullBufferIsOk) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
// One null buffer (buffer[0]) is OK
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 0;
@ -87,7 +87,7 @@ TEST_F(VertexStateTest, NullBufferIsOk) {
// Check validation that pipeline vertex buffers are backed by attributes in the vertex input
// Check validation that pipeline vertex buffers are backed by attributes in the vertex input
TEST_F(VertexStateTest, PipelineCompatibility) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 2 * sizeof(float);
state.cVertexBuffers[0].attributeCount = 2;
@ -127,7 +127,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) {
// Test that a arrayStride of 0 is valid
TEST_F(VertexStateTest, StrideZero) {
// Works ok without attributes
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 0;
state.cVertexBuffers[0].attributeCount = 1;
@ -142,7 +142,7 @@ TEST_F(VertexStateTest, StrideZero) {
// if vertex buffer arrayStride is not zero.
TEST_F(VertexStateTest, SetOffsetOutOfBounds) {
// Control case, setting correct arrayStride and offset
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 2 * sizeof(float);
state.cVertexBuffers[0].attributeCount = 2;
@ -163,7 +163,7 @@ TEST_F(VertexStateTest, SetOffsetOutOfBounds) {
// Check out of bounds condition on total number of vertex buffers
TEST_F(VertexStateTest, SetVertexBuffersNumLimit) {
// Control case, setting max vertex buffer number
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = kMaxVertexBuffers;
for (uint32_t i = 0; i < kMaxVertexBuffers; ++i) {
state.cVertexBuffers[i].attributeCount = 1;
@ -180,7 +180,7 @@ TEST_F(VertexStateTest, SetVertexBuffersNumLimit) {
// Check out of bounds condition on total number of vertex attributes
TEST_F(VertexStateTest, SetVertexAttributesNumLimit) {
// Control case, setting max vertex attribute number
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 2;
state.cVertexBuffers[0].attributeCount = kMaxVertexAttributes;
for (uint32_t i = 0; i < kMaxVertexAttributes; ++i) {
@ -197,7 +197,7 @@ TEST_F(VertexStateTest, SetVertexAttributesNumLimit) {
// Check out of bounds condition on input arrayStride
TEST_F(VertexStateTest, SetInputStrideOutOfBounds) {
// Control case, setting max input arrayStride
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = kMaxVertexBufferArrayStride;
state.cVertexBuffers[0].attributeCount = 1;
@ -211,7 +211,7 @@ TEST_F(VertexStateTest, SetInputStrideOutOfBounds) {
// Check multiple of 4 bytes constraint on input arrayStride
TEST_F(VertexStateTest, SetInputStrideNotAligned) {
// Control case, setting input arrayStride 4 bytes.
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 4;
state.cVertexBuffers[0].attributeCount = 1;
@ -225,7 +225,7 @@ TEST_F(VertexStateTest, SetInputStrideNotAligned) {
// Test that we cannot set an already set attribute
TEST_F(VertexStateTest, AlreadySetAttribute) {
// Control case, setting attribute 0
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 1;
state.cAttributes[0].shaderLocation = 0;
@ -241,7 +241,7 @@ TEST_F(VertexStateTest, AlreadySetAttribute) {
// Test that a arrayStride of 0 is valid
TEST_F(VertexStateTest, SetSameShaderLocation) {
// Control case, setting different shader locations in two attributes
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 2;
state.cAttributes[0].shaderLocation = 0;
@ -266,7 +266,7 @@ TEST_F(VertexStateTest, SetSameShaderLocation) {
// Check out of bounds condition on attribute shader location
TEST_F(VertexStateTest, SetAttributeLocationOutOfBounds) {
// Control case, setting last attribute shader location
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 1;
state.cAttributes[0].shaderLocation = kMaxVertexAttributes - 1;
@ -280,7 +280,7 @@ TEST_F(VertexStateTest, SetAttributeLocationOutOfBounds) {
// Check attribute offset out of bounds
TEST_F(VertexStateTest, SetAttributeOffsetOutOfBounds) {
// Control case, setting max attribute offset for FloatR32 vertex format
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 1;
state.cAttributes[0].offset = kMaxVertexBufferArrayStride - sizeof(wgpu::VertexFormat::Float32);
@ -294,7 +294,7 @@ TEST_F(VertexStateTest, SetAttributeOffsetOutOfBounds) {
// Check the min(4, formatSize) alignment constraint for the offset.
TEST_F(VertexStateTest, SetOffsetNotAligned) {
// Control case, setting the offset at the correct alignments.
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 1;
@ -333,7 +333,7 @@ TEST_F(VertexStateTest, SetOffsetNotAligned) {
// Check attribute offset overflow
TEST_F(VertexStateTest, SetAttributeOffsetOverflow) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].attributeCount = 1;
state.cAttributes[0].offset = std::numeric_limits<uint32_t>::max();
@ -342,7 +342,7 @@ TEST_F(VertexStateTest, SetAttributeOffsetOverflow) {
// Check for some potential underflow in the vertex input validation
TEST_F(VertexStateTest, VertexFormatLargerThanNonZeroStride) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 4;
state.cVertexBuffers[0].attributeCount = 1;
@ -353,7 +353,7 @@ TEST_F(VertexStateTest, VertexFormatLargerThanNonZeroStride) {
// Check that the vertex format base type must match the shader's variable base type.
TEST_F(VertexStateTest, BaseTypeMatching) {
auto DoTest = [&](wgpu::VertexFormat format, std::string shaderType, bool success) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 16;
state.cVertexBuffers[0].attributeCount = 1;
@ -407,7 +407,7 @@ TEST_F(VertexStateTest, BaseTypeMatching) {
// Check that we only check base type compatibility for vertex inputs the shader uses.
TEST_F(VertexStateTest, BaseTypeMatchingForInexistentInput) {
auto DoTest = [&](wgpu::VertexFormat format) {
utils::ComboVertexStateDescriptor state;
utils::ComboVertexState state;
state.vertexBufferCount = 1;
state.cVertexBuffers[0].arrayStride = 16;
state.cVertexBuffers[0].attributeCount = 1;

View File

@ -20,11 +20,11 @@ namespace utils {
// For creating deprecated render pipeline descriptors
ComboVertexStateDescriptor::ComboVertexStateDescriptor() {
ComboVertexState::ComboVertexState() {
vertexBufferCount = 0;
// Fill the default values for vertexBuffers and vertexAttributes in buffers.
wgpu::VertexAttributeDescriptor vertexAttribute;
wgpu::VertexAttribute vertexAttribute;
vertexAttribute.shaderLocation = 0;
vertexAttribute.offset = 0;
vertexAttribute.format = wgpu::VertexFormat::Float32;

View File

@ -24,18 +24,18 @@
namespace utils {
// Primarily used by tests to easily set up the vertex buffer state portion of a RenderPipeline.
class ComboVertexStateDescriptor {
class ComboVertexState {
public:
ComboVertexStateDescriptor();
ComboVertexState();
ComboVertexStateDescriptor(const ComboVertexStateDescriptor&) = delete;
ComboVertexStateDescriptor& operator=(const ComboVertexStateDescriptor&) = delete;
ComboVertexStateDescriptor(ComboVertexStateDescriptor&&) = delete;
ComboVertexStateDescriptor& operator=(ComboVertexStateDescriptor&&) = delete;
ComboVertexState(const ComboVertexState&) = delete;
ComboVertexState& operator=(const ComboVertexState&) = delete;
ComboVertexState(ComboVertexState&&) = delete;
ComboVertexState& operator=(ComboVertexState&&) = delete;
uint32_t vertexBufferCount;
std::array<wgpu::VertexBufferLayoutDescriptor, kMaxVertexBuffers> cVertexBuffers;
std::array<wgpu::VertexAttributeDescriptor, kMaxVertexAttributes> cAttributes;
std::array<wgpu::VertexBufferLayout, kMaxVertexBuffers> cVertexBuffers;
std::array<wgpu::VertexAttribute, kMaxVertexAttributes> cAttributes;
};
class ComboRenderPipelineDescriptor : public wgpu::RenderPipelineDescriptor {