diff --git a/dawn.json b/dawn.json index 575a650a97..9ff66697a8 100644 --- a/dawn.json +++ b/dawn.json @@ -1051,7 +1051,7 @@ "extensible": true, "members": [ {"name": "layout", "type": "pipeline layout"}, - {"name": "vertex stage", "type": "pipeline stage descriptor", "annotation": "const*"}, + {"name": "vertex stage", "type": "pipeline stage descriptor"}, {"name": "fragment stage", "type": "pipeline stage descriptor", "annotation": "const*", "optional": true}, {"name": "vertex input", "type": "vertex input descriptor", "annotation": "const*", "optional": true}, {"name": "primitive topology", "type": "primitive topology"}, diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index 362b8d0f40..1712f9ea89 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -117,7 +117,7 @@ void init() { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat(); diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp index 37ac2333a7..c5642ee6f6 100644 --- a/examples/CHelloTriangle.cpp +++ b/examples/CHelloTriangle.cpp @@ -61,11 +61,9 @@ void init() { DawnRenderPipelineDescriptor descriptor; descriptor.nextInChain = nullptr; - DawnPipelineStageDescriptor vertexStage; - vertexStage.nextInChain = nullptr; - vertexStage.module = vsModule; - vertexStage.entryPoint = "main"; - descriptor.vertexStage = &vertexStage; + descriptor.vertexStage.nextInChain = nullptr; + descriptor.vertexStage.module = vsModule; + descriptor.vertexStage.entryPoint = "main"; DawnPipelineStageDescriptor fragmentStage; fragmentStage.nextInChain = nullptr; diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 74c8d66133..d11150ad99 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -122,7 +122,7 @@ void initRender() { depthStencilView = CreateDefaultDepthStencilView(device); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cVertexInput.bufferCount = 2; diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index baa7937a1c..f3af2c6af4 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -127,7 +127,7 @@ void init() { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cVertexInput.bufferCount = 1; descriptor.cVertexInput.cBuffers[0].stride = 4 * sizeof(float); diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index 56d339eb77..517e06f48f 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -205,7 +205,7 @@ void init() { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pl; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.vertexInput = &vertexInput; descriptor.depthStencilState = &descriptor.cDepthStencilState; @@ -218,7 +218,7 @@ void init() { utils::ComboRenderPipelineDescriptor pDescriptor(device); pDescriptor.layout = pl; - pDescriptor.cVertexStage.module = vsModule; + pDescriptor.vertexStage.module = vsModule; pDescriptor.cFragmentStage.module = fsModule; pDescriptor.vertexInput = &vertexInput; pDescriptor.depthStencilState = &pDescriptor.cDepthStencilState; @@ -232,7 +232,7 @@ void init() { utils::ComboRenderPipelineDescriptor rfDescriptor(device); rfDescriptor.layout = pl; - rfDescriptor.cVertexStage.module = vsModule; + rfDescriptor.vertexStage.module = vsModule; rfDescriptor.cFragmentStage.module = fsReflectionModule; rfDescriptor.vertexInput = &vertexInput; rfDescriptor.depthStencilState = &rfDescriptor.cDepthStencilState; diff --git a/generator/templates/dawn_wire/WireCmd.cpp b/generator/templates/dawn_wire/WireCmd.cpp index c465ae0a58..c07e35da61 100644 --- a/generator/templates/dawn_wire/WireCmd.cpp +++ b/generator/templates/dawn_wire/WireCmd.cpp @@ -123,23 +123,27 @@ {% endfor %} //* Gather how much space will be needed for pointer members. - {% for member in members if member.annotation != "value" and member.length != "strlen" and not member.skip_serialize %} + {% for member in members if member.length != "strlen" and not member.skip_serialize %} {% if member.type.category != "object" and member.optional %} if (record.{{as_varName(member.name)}} != nullptr) {% endif %} { - size_t memberLength = {{member_length(member, "record.")}}; - result += memberLength * {{member_transfer_sizeof(member)}}; - - //* Structures might contain more pointers so we need to add their extra size as well. - {% if member.type.category == "structure" %} - for (size_t i = 0; i < memberLength; ++i) { - {% if member.annotation == "const*const*" %} - result += {{as_cType(member.type.name)}}GetExtraRequiredSize(*record.{{as_varName(member.name)}}[i]); - {% else %} - result += {{as_cType(member.type.name)}}GetExtraRequiredSize(record.{{as_varName(member.name)}}[i]); - {% endif %} - } + {% if member.annotation != "value" %} + size_t memberLength = {{member_length(member, "record.")}}; + result += memberLength * {{member_transfer_sizeof(member)}}; + //* Structures might contain more pointers so we need to add their extra size as well. + {% if member.type.category == "structure" %} + for (size_t i = 0; i < memberLength; ++i) { + {% if member.annotation == "const*const*" %} + result += {{as_cType(member.type.name)}}GetExtraRequiredSize(*record.{{as_varName(member.name)}}[i]); + {% else %} + {{assert(member.annotation == "const*")}} + result += {{as_cType(member.type.name)}}GetExtraRequiredSize(record.{{as_varName(member.name)}}[i]); + {% endif %} + } + {% endif %} + {% elif member.type.category == "structure" %} + result += {{as_cType(member.type.name)}}GetExtraRequiredSize(record.{{as_varName(member.name)}}); {% endif %} } {% endfor %} @@ -192,8 +196,8 @@ { size_t memberLength = {{member_length(member, "record.")}}; auto memberBuffer = reinterpret_cast<{{member_transfer_type(member)}}*>(*buffer); - *buffer += memberLength * {{member_transfer_sizeof(member)}}; + for (size_t i = 0; i < memberLength; ++i) { {{serialize_member(member, "record." + memberName + "[i]", "memberBuffer[i]" )}} } diff --git a/src/dawn_native/RenderPipeline.cpp b/src/dawn_native/RenderPipeline.cpp index 6d9c532228..1550a26a46 100644 --- a/src/dawn_native/RenderPipeline.cpp +++ b/src/dawn_native/RenderPipeline.cpp @@ -283,7 +283,7 @@ namespace dawn_native { } DAWN_TRY(ValidatePrimitiveTopology(descriptor->primitiveTopology)); - DAWN_TRY(ValidatePipelineStageDescriptor(device, descriptor->vertexStage, + DAWN_TRY(ValidatePipelineStageDescriptor(device, &descriptor->vertexStage, descriptor->layout, SingleShaderStage::Vertex)); DAWN_TRY(ValidatePipelineStageDescriptor(device, descriptor->fragmentStage, descriptor->layout, SingleShaderStage::Fragment)); @@ -292,7 +292,7 @@ namespace dawn_native { DAWN_TRY(ValidateRasterizationStateDescriptor(descriptor->rasterizationState)); } - if ((descriptor->vertexStage->module->GetUsedVertexAttributes() & ~attributesSetMask) + if ((descriptor->vertexStage.module->GetUsedVertexAttributes() & ~attributesSetMask) .any()) { return DAWN_VALIDATION_ERROR( "Pipeline vertex stage uses inputs not in the input state"); @@ -361,8 +361,8 @@ namespace dawn_native { mPrimitiveTopology(descriptor->primitiveTopology), mSampleMask(descriptor->sampleMask), mAlphaToCoverageEnabled(descriptor->alphaToCoverageEnabled), - mVertexModule(descriptor->vertexStage->module), - mVertexEntryPoint(descriptor->vertexStage->entryPoint), + mVertexModule(descriptor->vertexStage.module), + mVertexEntryPoint(descriptor->vertexStage.entryPoint), mFragmentModule(descriptor->fragmentStage->module), mFragmentEntryPoint(descriptor->fragmentStage->entryPoint), mIsBlueprint(blueprint) { diff --git a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp index ef8f91bfe6..92c286535a 100644 --- a/src/dawn_native/d3d12/RenderPipelineD3D12.cpp +++ b/src/dawn_native/d3d12/RenderPipelineD3D12.cpp @@ -312,8 +312,8 @@ namespace dawn_native { namespace d3d12 { D3D12_SHADER_BYTECODE* shader = nullptr; switch (stage) { case SingleShaderStage::Vertex: - module = ToBackend(descriptor->vertexStage->module); - entryPoint = descriptor->vertexStage->entryPoint; + module = ToBackend(descriptor->vertexStage.module); + entryPoint = descriptor->vertexStage.entryPoint; shader = &descriptorD3D12.VS; compileTarget = "vs_5_1"; break; diff --git a/src/dawn_native/metal/RenderPipelineMTL.mm b/src/dawn_native/metal/RenderPipelineMTL.mm index 4758fe270e..c00d488cac 100644 --- a/src/dawn_native/metal/RenderPipelineMTL.mm +++ b/src/dawn_native/metal/RenderPipelineMTL.mm @@ -314,8 +314,8 @@ namespace dawn_native { namespace metal { MTLRenderPipelineDescriptor* descriptorMTL = [MTLRenderPipelineDescriptor new]; - const ShaderModule* vertexModule = ToBackend(descriptor->vertexStage->module); - const char* vertexEntryPoint = descriptor->vertexStage->entryPoint; + const ShaderModule* vertexModule = ToBackend(descriptor->vertexStage.module); + const char* vertexEntryPoint = descriptor->vertexStage.entryPoint; ShaderModule::MetalFunctionData vertexData = vertexModule->GetFunction( vertexEntryPoint, SingleShaderStage::Vertex, ToBackend(GetLayout())); descriptorMTL.vertexFunction = vertexData.function; diff --git a/src/dawn_native/opengl/RenderPipelineGL.cpp b/src/dawn_native/opengl/RenderPipelineGL.cpp index d347d5cb55..efbe76184b 100644 --- a/src/dawn_native/opengl/RenderPipelineGL.cpp +++ b/src/dawn_native/opengl/RenderPipelineGL.cpp @@ -198,7 +198,7 @@ namespace dawn_native { namespace opengl { mVertexArrayObject(0), mGlPrimitiveTopology(GLPrimitiveTopology(GetPrimitiveTopology())) { PerStage modules(nullptr); - modules[SingleShaderStage::Vertex] = ToBackend(descriptor->vertexStage->module); + modules[SingleShaderStage::Vertex] = ToBackend(descriptor->vertexStage.module); modules[SingleShaderStage::Fragment] = ToBackend(descriptor->fragmentStage->module); PipelineGL::Initialize(device->gl, ToBackend(GetLayout()), modules); diff --git a/src/dawn_native/vulkan/RenderPipelineVk.cpp b/src/dawn_native/vulkan/RenderPipelineVk.cpp index 7eb164ffb6..8b8f5bf266 100644 --- a/src/dawn_native/vulkan/RenderPipelineVk.cpp +++ b/src/dawn_native/vulkan/RenderPipelineVk.cpp @@ -320,8 +320,8 @@ namespace dawn_native { namespace vulkan { shaderStages[0].flags = 0; shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT; shaderStages[0].pSpecializationInfo = nullptr; - shaderStages[0].module = ToBackend(descriptor->vertexStage->module)->GetHandle(); - shaderStages[0].pName = descriptor->vertexStage->entryPoint; + shaderStages[0].module = ToBackend(descriptor->vertexStage.module)->GetHandle(); + shaderStages[0].pName = descriptor->vertexStage.entryPoint; shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shaderStages[1].pNext = nullptr; diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index 4abcc4f621..41e47fa784 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -124,7 +124,7 @@ TEST_P(BindGroupTests, ReusedUBO) { utils::ComboRenderPipelineDescriptor textureDescriptor(device); textureDescriptor.layout = pipelineLayout; - textureDescriptor.cVertexStage.module = vsModule; + textureDescriptor.vertexStage.module = vsModule; textureDescriptor.cFragmentStage.module = fsModule; textureDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -205,7 +205,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); pipelineDescriptor.layout = pipelineLayout; - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = fsModule; pipelineDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -329,7 +329,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { utils::ComboRenderPipelineDescriptor textureDescriptor(device); textureDescriptor.layout = pipelineLayout; - textureDescriptor.cVertexStage.module = vsModule; + textureDescriptor.vertexStage.module = vsModule; textureDescriptor.cFragmentStage.module = fsModule; textureDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -422,7 +422,7 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); pipelineDescriptor.layout = pipelineLayout; - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = fsModule; pipelineDescriptor.cColorStates[0]->format = renderPass.colorFormat; diff --git a/src/tests/end2end/ClipSpaceTests.cpp b/src/tests/end2end/ClipSpaceTests.cpp index 8d653103e1..58bd477fd6 100644 --- a/src/tests/end2end/ClipSpaceTests.cpp +++ b/src/tests/end2end/ClipSpaceTests.cpp @@ -36,7 +36,7 @@ class ClipSpaceTest : public DawnTest { void main() { gl_Position = vec4(pos[gl_VertexIndex], 1.0); })"; - pipelineDescriptor.cVertexStage.module = + pipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, vs); const char* fs = diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index ae22b784c5..fb28b060be 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -71,7 +71,7 @@ class ColorStateTest : public DawnTest { utils::ComboRenderPipelineDescriptor baseDescriptor(device); baseDescriptor.layout = pipelineLayout; - baseDescriptor.cVertexStage.module = vsModule; + baseDescriptor.vertexStage.module = vsModule; baseDescriptor.cFragmentStage.module = fsModule; baseDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -79,7 +79,7 @@ class ColorStateTest : public DawnTest { utils::ComboRenderPipelineDescriptor testDescriptor(device); testDescriptor.layout = pipelineLayout; - testDescriptor.cVertexStage.module = vsModule; + testDescriptor.vertexStage.module = vsModule; testDescriptor.cFragmentStage.module = fsModule; testDescriptor.cColorStates[0] = &colorStateDescriptor; testDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -797,7 +797,7 @@ TEST_P(ColorStateTest, IndependentColorState) { utils::ComboRenderPipelineDescriptor baseDescriptor(device); baseDescriptor.layout = pipelineLayout; - baseDescriptor.cVertexStage.module = vsModule; + baseDescriptor.vertexStage.module = vsModule; baseDescriptor.cFragmentStage.module = fsModule; baseDescriptor.colorStateCount = 4; @@ -805,7 +805,7 @@ TEST_P(ColorStateTest, IndependentColorState) { utils::ComboRenderPipelineDescriptor testDescriptor(device); testDescriptor.layout = pipelineLayout; - testDescriptor.cVertexStage.module = vsModule; + testDescriptor.vertexStage.module = vsModule; testDescriptor.cFragmentStage.module = fsModule; testDescriptor.colorStateCount = 4; @@ -899,7 +899,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) { utils::ComboRenderPipelineDescriptor baseDescriptor(device); baseDescriptor.layout = pipelineLayout; - baseDescriptor.cVertexStage.module = vsModule; + baseDescriptor.vertexStage.module = vsModule; baseDescriptor.cFragmentStage.module = fsModule; baseDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -907,7 +907,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) { utils::ComboRenderPipelineDescriptor testDescriptor(device); testDescriptor.layout = pipelineLayout; - testDescriptor.cVertexStage.module = vsModule; + testDescriptor.vertexStage.module = vsModule; testDescriptor.cFragmentStage.module = fsModule; testDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -1023,7 +1023,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) { utils::ComboRenderPipelineDescriptor baseDescriptor(device); baseDescriptor.layout = pipelineLayout; - baseDescriptor.cVertexStage.module = vsModule; + baseDescriptor.vertexStage.module = vsModule; baseDescriptor.cFragmentStage.module = fsModule; baseDescriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -1031,7 +1031,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) { utils::ComboRenderPipelineDescriptor testDescriptor(device); testDescriptor.layout = pipelineLayout; - testDescriptor.cVertexStage.module = vsModule; + testDescriptor.vertexStage.module = vsModule; testDescriptor.cFragmentStage.module = fsModule; testDescriptor.cColorStates[0]->format = renderPass.colorFormat; testDescriptor.cColorStates[0]->writeMask = dawn::ColorWriteMask::Red; diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp index 8315a50d78..84ed2d95b1 100644 --- a/src/tests/end2end/CompressedTextureFormatTests.cpp +++ b/src/tests/end2end/CompressedTextureFormatTests.cpp @@ -163,7 +163,7 @@ class CompressedTextureBCFormatTest : public DawnTest { void main() { fragColor = texture(sampler2D(texture0, sampler0), texCoord); })"); - renderPipelineDescriptor.cVertexStage.module = vsModule; + renderPipelineDescriptor.vertexStage.module = vsModule; renderPipelineDescriptor.cFragmentStage.module = fsModule; renderPipelineDescriptor.layout = pipelineLayout; renderPipelineDescriptor.cColorStates[0]->format = diff --git a/src/tests/end2end/CullingTests.cpp b/src/tests/end2end/CullingTests.cpp index de919efa09..eaa8a02b3d 100644 --- a/src/tests/end2end/CullingTests.cpp +++ b/src/tests/end2end/CullingTests.cpp @@ -36,7 +36,7 @@ class CullingTest : public DawnTest { void main() { gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); })"; - pipelineDescriptor.cVertexStage.module = + pipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, vs); // gl_FragCoord of pixel(x, y) in framebuffer coordinate is (x + 0.5, y + 0.5). And we use diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index 8e5c4fad98..93de654c52 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -275,7 +275,7 @@ class DepthStencilStateTest : public DawnTest { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pipelineLayout; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cDepthStencilState = test.depthStencilState; descriptor.cDepthStencilState.format = dawn::TextureFormat::Depth24PlusStencil8; diff --git a/src/tests/end2end/DestroyTests.cpp b/src/tests/end2end/DestroyTests.cpp index 415bf501cf..98a2cca72b 100644 --- a/src/tests/end2end/DestroyTests.cpp +++ b/src/tests/end2end/DestroyTests.cpp @@ -43,7 +43,7 @@ class DestroyTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp index ce23862a48..5f7395ba8f 100644 --- a/src/tests/end2end/DrawIndexedIndirectTests.cpp +++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp @@ -43,7 +43,7 @@ class DrawIndexedIndirectTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/DrawIndexedTests.cpp b/src/tests/end2end/DrawIndexedTests.cpp index 35d72a88e4..6d28857fb2 100644 --- a/src/tests/end2end/DrawIndexedTests.cpp +++ b/src/tests/end2end/DrawIndexedTests.cpp @@ -43,7 +43,7 @@ class DrawIndexedTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/DrawIndirectTests.cpp b/src/tests/end2end/DrawIndirectTests.cpp index 2e8f5bdefb..21e0c27b85 100644 --- a/src/tests/end2end/DrawIndirectTests.cpp +++ b/src/tests/end2end/DrawIndirectTests.cpp @@ -43,7 +43,7 @@ class DrawIndirectTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/DrawTests.cpp b/src/tests/end2end/DrawTests.cpp index 9a6530c933..f73773b0c2 100644 --- a/src/tests/end2end/DrawTests.cpp +++ b/src/tests/end2end/DrawTests.cpp @@ -43,7 +43,7 @@ class DrawTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp index 9a23146bc8..795d90c336 100644 --- a/src/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp @@ -140,7 +140,7 @@ class DynamicBufferOffsetTests : public DawnTest { utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fs.str().c_str()); utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = fsModule; pipelineDescriptor.cColorStates[0]->format = dawn::TextureFormat::RGBA8Unorm; diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index a0de62070a..001b3f7fb3 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -303,7 +303,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { )"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vs; + descriptor.vertexStage.module = vs; descriptor.cFragmentStage.module = fs; descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); descriptor.cColorStates[0]->format = dawn::TextureFormat::RGBA8Unorm; diff --git a/src/tests/end2end/IndexFormatTests.cpp b/src/tests/end2end/IndexFormatTests.cpp index 93a5ccce27..d6eba864c4 100644 --- a/src/tests/end2end/IndexFormatTests.cpp +++ b/src/tests/end2end/IndexFormatTests.cpp @@ -48,7 +48,7 @@ class IndexFormatTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.indexFormat = format; diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp index 038a77396e..ff9f628c92 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -196,7 +196,7 @@ class MultisampledRenderingTest : public DawnTest { void main() { gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); })"; - pipelineDescriptor.cVertexStage.module = + pipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, vs); pipelineDescriptor.cFragmentStage.module = diff --git a/src/tests/end2end/ObjectCachingTests.cpp b/src/tests/end2end/ObjectCachingTests.cpp index 39ae3642e0..48ecdf5169 100644 --- a/src/tests/end2end/ObjectCachingTests.cpp +++ b/src/tests/end2end/ObjectCachingTests.cpp @@ -213,7 +213,7 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnLayout) { EXPECT_EQ(pl.Get() == samePl.Get(), !UsesWire()); utils::ComboRenderPipelineDescriptor desc(device); - desc.cVertexStage.module = + desc.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( #version 450 void main() { @@ -269,13 +269,13 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnVertexModule) { void main() { })"); - desc.cVertexStage.module = module; + desc.vertexStage.module = module; dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&desc); - desc.cVertexStage.module = sameModule; + desc.vertexStage.module = sameModule; dawn::RenderPipeline samePipeline = device.CreateRenderPipeline(&desc); - desc.cVertexStage.module = otherModule; + desc.vertexStage.module = otherModule; dawn::RenderPipeline otherPipeline = device.CreateRenderPipeline(&desc); EXPECT_NE(pipeline.Get(), otherPipeline.Get()); @@ -305,7 +305,7 @@ TEST_P(ObjectCachingTest, RenderPipelineDeduplicationOnFragmentModule) { EXPECT_EQ(module.Get() == sameModule.Get(), !UsesWire()); utils::ComboRenderPipelineDescriptor desc(device); - desc.cVertexStage.module = + desc.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( #version 450 void main() { diff --git a/src/tests/end2end/OpArrayLengthTests.cpp b/src/tests/end2end/OpArrayLengthTests.cpp index c000c0c0c8..4800d9794b 100644 --- a/src/tests/end2end/OpArrayLengthTests.cpp +++ b/src/tests/end2end/OpArrayLengthTests.cpp @@ -179,7 +179,7 @@ TEST_P(OpArrayLengthTest, Fragment) { .c_str()); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::PointList; descriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -240,7 +240,7 @@ TEST_P(OpArrayLengthTest, Vertex) { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::PointList; descriptor.cColorStates[0]->format = renderPass.colorFormat; diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index 5c9b0900ac..ccd9cd3ffb 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -183,7 +183,7 @@ class PrimitiveTopologyTest : public DawnTest { // Draw the vertices with the given primitive topology and check the pixel values of the test locations void DoTest(dawn::PrimitiveTopology primitiveTopology, const std::vector &locationSpecs) { utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = primitiveTopology; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp index e96a187c83..3a104edb06 100644 --- a/src/tests/end2end/RenderBundleTests.cpp +++ b/src/tests/end2end/RenderBundleTests.cpp @@ -74,7 +74,7 @@ class RenderBundleTest : public DawnTest { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pipelineLayout; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cVertexInput.bufferCount = 1; diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp index ded49d10b9..8cf66c3a04 100644 --- a/src/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/tests/end2end/RenderPassLoadOpTests.cpp @@ -38,7 +38,7 @@ class DrawQuad { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pipelineLayout; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; auto renderPipeline = device.CreateRenderPipeline(&descriptor); diff --git a/src/tests/end2end/RenderPassTests.cpp b/src/tests/end2end/RenderPassTests.cpp index 49b4ed277d..578e2fa3fc 100644 --- a/src/tests/end2end/RenderPassTests.cpp +++ b/src/tests/end2end/RenderPassTests.cpp @@ -44,7 +44,7 @@ protected: })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip; descriptor.cColorStates[0]->format = kFormat; diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp index c311343b51..b26d203f81 100644 --- a/src/tests/end2end/SamplerTests.cpp +++ b/src/tests/end2end/SamplerTests.cpp @@ -75,7 +75,7 @@ protected: utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); pipelineDescriptor.layout = pipelineLayout; - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = fsModule; pipelineDescriptor.cColorStates[0]->format = mRenderPass.colorFormat; diff --git a/src/tests/end2end/ScissorTests.cpp b/src/tests/end2end/ScissorTests.cpp index 35c6cde2de..99be8b58c8 100644 --- a/src/tests/end2end/ScissorTests.cpp +++ b/src/tests/end2end/ScissorTests.cpp @@ -40,7 +40,7 @@ class ScissorTest: public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cColorStates[0]->format = format; diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp index 040e71af0a..fe3e714ddd 100644 --- a/src/tests/end2end/TextureFormatTests.cpp +++ b/src/tests/end2end/TextureFormatTests.cpp @@ -216,7 +216,7 @@ class TextureFormatTest : public DawnTest { dawn::ShaderModule fsModule = utils::CreateShaderModule( device, utils::SingleShaderStage::Fragment, fsSource.str().c_str()); - desc.cVertexStage.module = vsModule; + desc.vertexStage.module = vsModule; desc.cFragmentStage.module = fsModule; desc.layout = utils::MakeBasicPipelineLayout(device, &bgl); desc.cColorStates[0]->format = renderFormatInfo.format; diff --git a/src/tests/end2end/TextureViewTests.cpp b/src/tests/end2end/TextureViewTests.cpp index 542801df34..b89ca68af0 100644 --- a/src/tests/end2end/TextureViewTests.cpp +++ b/src/tests/end2end/TextureViewTests.cpp @@ -167,7 +167,7 @@ protected: utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fragmentShader); utils::ComboRenderPipelineDescriptor textureDescriptor(device); - textureDescriptor.cVertexStage.module = mVSModule; + textureDescriptor.vertexStage.module = mVSModule; textureDescriptor.cFragmentStage.module = fsModule; textureDescriptor.layout = mPipelineLayout; textureDescriptor.cColorStates[0]->format = mRenderPass.colorFormat; @@ -505,7 +505,7 @@ class TextureViewRenderingTest : public DawnTest { device, utils::SingleShaderStage::Fragment, oneColorFragmentShader); utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = oneColorFsModule; pipelineDescriptor.cColorStates[0]->format = kDefaultFormat; diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index 1800c8ec62..16f7bf00cb 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -64,7 +64,7 @@ class TextureZeroInitTest : public DawnTest { void main() { gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0); })"; - pipelineDescriptor.cVertexStage.module = + pipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, vs); const char* fs = @@ -441,7 +441,7 @@ TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) { // Create render pipeline utils::ComboRenderPipelineDescriptor renderPipelineDescriptor(device); renderPipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, &bindGroupLayout); - renderPipelineDescriptor.cVertexStage.module = + renderPipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(#version 450 const vec2 pos[6] = vec2[6](vec2(-1.0f, -1.0f), vec2(-1.0f, 1.0f), diff --git a/src/tests/end2end/VertexFormatTests.cpp b/src/tests/end2end/VertexFormatTests.cpp index ec1c1deaa5..2ba760f74e 100644 --- a/src/tests/end2end/VertexFormatTests.cpp +++ b/src/tests/end2end/VertexFormatTests.cpp @@ -360,7 +360,7 @@ class VertexFormatTest : public DawnTest { } utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cVertexInput.bufferCount = 1; descriptor.cVertexInput.cBuffers[0].stride = strideBytes; diff --git a/src/tests/end2end/VertexInputTests.cpp b/src/tests/end2end/VertexInputTests.cpp index c5812ac858..ae58fd706a 100644 --- a/src/tests/end2end/VertexInputTests.cpp +++ b/src/tests/end2end/VertexInputTests.cpp @@ -128,7 +128,7 @@ class VertexInputTest : public DawnTest { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.vertexInput = &vertexInput; descriptor.cColorStates[0]->format = renderPass.colorFormat; @@ -541,7 +541,7 @@ TEST_P(OptionalVertexInputTest, Basic) { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::PointList; descriptor.vertexInput = nullptr; diff --git a/src/tests/end2end/ViewportOrientationTests.cpp b/src/tests/end2end/ViewportOrientationTests.cpp index 1b2b851f51..153d639c2b 100644 --- a/src/tests/end2end/ViewportOrientationTests.cpp +++ b/src/tests/end2end/ViewportOrientationTests.cpp @@ -40,7 +40,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) { })"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.primitiveTopology = dawn::PrimitiveTopology::PointList; descriptor.cColorStates[0]->format = renderPass.colorFormat; diff --git a/src/tests/end2end/ViewportTests.cpp b/src/tests/end2end/ViewportTests.cpp index 782dcb4164..570b377d39 100644 --- a/src/tests/end2end/ViewportTests.cpp +++ b/src/tests/end2end/ViewportTests.cpp @@ -44,7 +44,7 @@ class ViewportTest : public DawnTest { color = vec4(0.0, 1.0, 0.0, 1.0); } })"; - pipelineDescriptor.cVertexStage.module = + pipelineDescriptor.vertexStage.module = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, vs); const char* fs = diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index c93b55b3ac..c8809a2b74 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -630,7 +630,7 @@ class SetBindGroupValidationTest : public ValidationTest { })"); utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); - pipelineDescriptor.cVertexStage.module = vsModule; + pipelineDescriptor.vertexStage.module = vsModule; pipelineDescriptor.cFragmentStage.module = fsModule; dawn::PipelineLayout pipelineLayout = utils::MakeBasicPipelineLayout(device, &mBindGroupLayout); diff --git a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp index 045de04f4f..660138b4f7 100644 --- a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp +++ b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp @@ -43,7 +43,7 @@ class DrawIndirectValidationTest : public ValidationTest { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pipelineLayout; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; pipeline = device.CreateRenderPipeline(&descriptor); diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp index 5183aba88a..5841de9940 100644 --- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp +++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp @@ -96,7 +96,7 @@ namespace { void InitializeRenderPipelineDescriptor(utils::ComboRenderPipelineDescriptor* descriptor) { descriptor->layout = pipelineLayout; - descriptor->cVertexStage.module = vsModule; + descriptor->vertexStage.module = vsModule; descriptor->cFragmentStage.module = fsModule; descriptor->cVertexInput.bufferCount = 1; descriptor->cVertexInput.cBuffers[0].stride = 2 * sizeof(float); diff --git a/src/tests/unittests/validation/RenderPassValidationTests.cpp b/src/tests/unittests/validation/RenderPassValidationTests.cpp index b89234fb83..9c237ccfc4 100644 --- a/src/tests/unittests/validation/RenderPassValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPassValidationTests.cpp @@ -61,7 +61,7 @@ void main() { utils::ComboRenderPipelineDescriptor descriptor(device); descriptor.layout = pipelineLayout; - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 5c5a54a42c..c000322349 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -45,7 +45,7 @@ class RenderPipelineValidationTest : public ValidationTest { TEST_F(RenderPipelineValidationTest, CreationSuccess) { { utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; device.CreateRenderPipeline(&descriptor); @@ -53,7 +53,7 @@ TEST_F(RenderPipelineValidationTest, CreationSuccess) { { // Vertex input should be optional utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.vertexInput = nullptr; @@ -62,10 +62,9 @@ TEST_F(RenderPipelineValidationTest, CreationSuccess) { { // Rasterization state should be optional utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.rasterizationState = nullptr; - device.CreateRenderPipeline(&descriptor); } } @@ -75,7 +74,7 @@ TEST_F(RenderPipelineValidationTest, ColorStateRequired) { { // This one succeeds because attachment 0 is the color attachment utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.colorStateCount = 1; @@ -84,7 +83,7 @@ TEST_F(RenderPipelineValidationTest, ColorStateRequired) { { // Fail because lack of color states (and depth/stencil state) utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.colorStateCount = 0; @@ -97,7 +96,7 @@ TEST_F(RenderPipelineValidationTest, NonRenderableFormat) { { // Succeeds because RGBA8Unorm is renderable utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cColorStates[0]->format = dawn::TextureFormat::RGBA8Unorm; @@ -107,7 +106,7 @@ TEST_F(RenderPipelineValidationTest, NonRenderableFormat) { { // Fails because RG11B10Float is non-renderable utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.cColorStates[0]->format = dawn::TextureFormat::RG11B10Float; @@ -119,7 +118,7 @@ TEST_F(RenderPipelineValidationTest, NonRenderableFormat) { TEST_F(RenderPipelineValidationTest, SampleCount) { { utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.sampleCount = 4; @@ -128,7 +127,7 @@ TEST_F(RenderPipelineValidationTest, SampleCount) { { utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.sampleCount = 3; @@ -154,7 +153,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { utils::ComboRenderPipelineDescriptor nonMultisampledPipelineDescriptor(device); nonMultisampledPipelineDescriptor.sampleCount = 1; - nonMultisampledPipelineDescriptor.cVertexStage.module = vsModule; + nonMultisampledPipelineDescriptor.vertexStage.module = vsModule; nonMultisampledPipelineDescriptor.cFragmentStage.module = fsModule; dawn::RenderPipeline nonMultisampledPipeline = device.CreateRenderPipeline(&nonMultisampledPipelineDescriptor); @@ -167,7 +166,7 @@ TEST_F(RenderPipelineValidationTest, SampleCountCompatibilityWithRenderPass) { utils::ComboRenderPipelineDescriptor multisampledPipelineDescriptor(device); multisampledPipelineDescriptor.sampleCount = kMultisampledCount; - multisampledPipelineDescriptor.cVertexStage.module = vsModule; + multisampledPipelineDescriptor.vertexStage.module = vsModule; multisampledPipelineDescriptor.cFragmentStage.module = fsModule; dawn::RenderPipeline multisampledPipeline = device.CreateRenderPipeline(&multisampledPipelineDescriptor); diff --git a/src/tests/unittests/validation/VertexBufferValidationTests.cpp b/src/tests/unittests/validation/VertexBufferValidationTests.cpp index 884cfbba7b..6b733f0d9c 100644 --- a/src/tests/unittests/validation/VertexBufferValidationTests.cpp +++ b/src/tests/unittests/validation/VertexBufferValidationTests.cpp @@ -71,7 +71,7 @@ class VertexBufferValidationTest : public ValidationTest { dawn::RenderPipeline MakeRenderPipeline(const dawn::ShaderModule& vsModule, unsigned int bufferCount) { utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; for (unsigned int i = 0; i < bufferCount; ++i) { diff --git a/src/tests/unittests/validation/VertexInputValidationTests.cpp b/src/tests/unittests/validation/VertexInputValidationTests.cpp index bc1be28807..9dbdbae501 100644 --- a/src/tests/unittests/validation/VertexInputValidationTests.cpp +++ b/src/tests/unittests/validation/VertexInputValidationTests.cpp @@ -34,7 +34,7 @@ class VertexInputTest : public ValidationTest { )"); utils::ComboRenderPipelineDescriptor descriptor(device); - descriptor.cVertexStage.module = vsModule; + descriptor.vertexStage.module = vsModule; descriptor.cFragmentStage.module = fsModule; descriptor.vertexInput = &state; descriptor.cColorStates[0]->format = dawn::TextureFormat::RGBA8Unorm; diff --git a/src/tests/unittests/wire/WireArgumentTests.cpp b/src/tests/unittests/wire/WireArgumentTests.cpp index a2334edd35..ebd70038c3 100644 --- a/src/tests/unittests/wire/WireArgumentTests.cpp +++ b/src/tests/unittests/wire/WireArgumentTests.cpp @@ -162,11 +162,9 @@ TEST_F(WireArgumentTests, CStringArgument) { DawnRenderPipelineDescriptor pipelineDescriptor; pipelineDescriptor.nextInChain = nullptr; - DawnPipelineStageDescriptor vertexStage; - vertexStage.nextInChain = nullptr; - vertexStage.module = vsModule; - vertexStage.entryPoint = "main"; - pipelineDescriptor.vertexStage = &vertexStage; + pipelineDescriptor.vertexStage.nextInChain = nullptr; + pipelineDescriptor.vertexStage.module = vsModule; + pipelineDescriptor.vertexStage.entryPoint = "main"; DawnPipelineStageDescriptor fragmentStage; fragmentStage.nextInChain = nullptr; @@ -193,7 +191,7 @@ TEST_F(WireArgumentTests, CStringArgument) { EXPECT_CALL(api, DeviceCreateRenderPipeline( apiDevice, MatchesLambda([](const DawnRenderPipelineDescriptor* desc) -> bool { - return desc->vertexStage->entryPoint == std::string("main"); + return desc->vertexStage.entryPoint == std::string("main"); }))) .WillOnce(Return(apiDummyPipeline)); diff --git a/src/tests/unittests/wire/WireOptionalTests.cpp b/src/tests/unittests/wire/WireOptionalTests.cpp index 84ebd84d1e..3684afa234 100644 --- a/src/tests/unittests/wire/WireOptionalTests.cpp +++ b/src/tests/unittests/wire/WireOptionalTests.cpp @@ -132,11 +132,9 @@ TEST_F(WireOptionalTests, OptionalStructPointer) { DawnRenderPipelineDescriptor pipelineDescriptor; pipelineDescriptor.nextInChain = nullptr; - DawnPipelineStageDescriptor vertexStage; - vertexStage.nextInChain = nullptr; - vertexStage.module = vsModule; - vertexStage.entryPoint = "main"; - pipelineDescriptor.vertexStage = &vertexStage; + pipelineDescriptor.vertexStage.nextInChain = nullptr; + pipelineDescriptor.vertexStage.module = vsModule; + pipelineDescriptor.vertexStage.entryPoint = "main"; DawnPipelineStageDescriptor fragmentStage; fragmentStage.nextInChain = nullptr; diff --git a/src/utils/ComboRenderPipelineDescriptor.cpp b/src/utils/ComboRenderPipelineDescriptor.cpp index dea7874135..2da1f9fe76 100644 --- a/src/utils/ComboRenderPipelineDescriptor.cpp +++ b/src/utils/ComboRenderPipelineDescriptor.cpp @@ -53,10 +53,7 @@ namespace utils { descriptor->sampleCount = 1; // Set defaults for the vertex stage descriptor. - { - descriptor->vertexStage = &cVertexStage; - cVertexStage.entryPoint = "main"; - } + { vertexStage.entryPoint = "main"; } // Set defaults for the fragment stage desriptor. { diff --git a/src/utils/ComboRenderPipelineDescriptor.h b/src/utils/ComboRenderPipelineDescriptor.h index 9448705286..31f34a52e7 100644 --- a/src/utils/ComboRenderPipelineDescriptor.h +++ b/src/utils/ComboRenderPipelineDescriptor.h @@ -35,7 +35,6 @@ namespace utils { public: ComboRenderPipelineDescriptor(const dawn::Device& device); - dawn::PipelineStageDescriptor cVertexStage; dawn::PipelineStageDescriptor cFragmentStage; ComboVertexInputDescriptor cVertexInput;