diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index 381975feda..f483075b2a 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -129,8 +129,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); static int f = 0; f++; diff --git a/examples/CHelloTriangle.cpp b/examples/CHelloTriangle.cpp index aee0d0dd73..456aefa31b 100644 --- a/examples/CHelloTriangle.cpp +++ b/examples/CHelloTriangle.cpp @@ -81,12 +81,12 @@ void frame() { backbufferView = nxtTextureViewBuilderGetResult(builder); nxtTextureViewBuilderRelease(builder); } - nxtRenderPassInfo renderpassInfo; + nxtRenderPassDescriptor renderpassInfo; { - nxtRenderPassInfoBuilder builder = nxtDeviceCreateRenderPassInfoBuilder(device); - nxtRenderPassInfoBuilderSetColorAttachment(builder, 0, backbufferView, NXT_LOAD_OP_CLEAR); - renderpassInfo = nxtRenderPassInfoBuilderGetResult(builder); - nxtRenderPassInfoBuilderRelease(builder); + nxtRenderPassDescriptorBuilder builder = nxtDeviceCreateRenderPassDescriptorBuilder(device); + nxtRenderPassDescriptorBuilderSetColorAttachment(builder, 0, backbufferView, NXT_LOAD_OP_CLEAR); + renderpassInfo = nxtRenderPassDescriptorBuilderGetResult(builder); + nxtRenderPassDescriptorBuilderRelease(builder); } nxtCommandBuffer commands; { @@ -103,7 +103,7 @@ void frame() { nxtCommandBufferRelease(commands); nxtTextureTransitionUsage(backbuffer, NXT_TEXTURE_USAGE_BIT_PRESENT); nxtSwapChainPresent(swapchain, backbuffer); - nxtRenderPassInfoRelease(renderpassInfo); + nxtRenderPassDescriptorRelease(renderpassInfo); nxtTextureViewRelease(backbufferView); DoFlush(); diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index dba131d3be..d3e37992f2 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -259,7 +259,7 @@ void initSim() { } } -nxt::CommandBuffer createCommandBuffer(const nxt::RenderPassInfo& renderPass, size_t i) { +nxt::CommandBuffer createCommandBuffer(const nxt::RenderPassDescriptor& renderPass, size_t i) { static const uint32_t zeroOffsets[1] = {0}; auto& bufferSrc = particleBuffers[i]; auto& bufferDst = particleBuffers[(i + 1) % 2]; @@ -298,8 +298,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); nxt::CommandBuffer commandBuffer = createCommandBuffer(renderPass, pingpong); queue.Submit(1, &commandBuffer); diff --git a/examples/HelloCompute.cpp b/examples/HelloCompute.cpp index 74c97892d8..a9f2c8a568 100644 --- a/examples/HelloCompute.cpp +++ b/examples/HelloCompute.cpp @@ -132,8 +132,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() .TransitionBufferUsage(buffer, nxt::BufferUsageBit::Storage) diff --git a/examples/HelloDepthStencil.cpp b/examples/HelloDepthStencil.cpp index 3d9b9ff53c..f0506929c9 100644 --- a/examples/HelloDepthStencil.cpp +++ b/examples/HelloDepthStencil.cpp @@ -278,8 +278,8 @@ void frame() { cameraBuffer.SetSubData(0, sizeof(CameraData), reinterpret_cast(&cameraData)); nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() .BeginRenderPass(renderPass) diff --git a/examples/HelloIndices.cpp b/examples/HelloIndices.cpp index 461d5ffa05..3a350fa2aa 100644 --- a/examples/HelloIndices.cpp +++ b/examples/HelloIndices.cpp @@ -87,8 +87,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); static const uint32_t vertexBufferOffsets[1] = {0}; nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() diff --git a/examples/HelloInstancing.cpp b/examples/HelloInstancing.cpp index b80f9abcc2..7b62e94811 100644 --- a/examples/HelloInstancing.cpp +++ b/examples/HelloInstancing.cpp @@ -92,8 +92,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); static const uint32_t vertexBufferOffsets[1] = {0}; nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() diff --git a/examples/HelloTriangle.cpp b/examples/HelloTriangle.cpp index 1d603d9ff7..557a2c8d57 100644 --- a/examples/HelloTriangle.cpp +++ b/examples/HelloTriangle.cpp @@ -149,8 +149,8 @@ void frame() { if (s.b >= 1.0f) {s.b = 0.0f;} nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); static const uint32_t vertexBufferOffsets[1] = {0}; nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() diff --git a/examples/HelloUBO.cpp b/examples/HelloUBO.cpp index be425753a5..1c280a19cb 100644 --- a/examples/HelloUBO.cpp +++ b/examples/HelloUBO.cpp @@ -98,8 +98,8 @@ void frame() { buffer.SetSubData(0, sizeof(s), reinterpret_cast(&s)); nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() .BeginRenderPass(renderPass) diff --git a/examples/HelloVertices.cpp b/examples/HelloVertices.cpp index f38ef13bad..798aef106d 100644 --- a/examples/HelloVertices.cpp +++ b/examples/HelloVertices.cpp @@ -81,8 +81,8 @@ void init() { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); static const uint32_t vertexBufferOffsets[1] = {0}; nxt::CommandBuffer commands = device.CreateCommandBufferBuilder() diff --git a/examples/RenderToTexture.cpp b/examples/RenderToTexture.cpp index 8cd2d7fdb3..73b003f89e 100644 --- a/examples/RenderToTexture.cpp +++ b/examples/RenderToTexture.cpp @@ -166,11 +166,11 @@ void frame() { nxt::Texture backbuffer = swapchain.GetNextTexture(); auto backbufferView = backbuffer.CreateTextureViewBuilder().GetResult(); - nxt::RenderPassInfo renderPass1 = device.CreateRenderPassInfoBuilder() + nxt::RenderPassDescriptor renderPass1 = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear) .GetResult(); - nxt::RenderPassInfo renderPass2 = device.CreateRenderPassInfoBuilder() + nxt::RenderPassDescriptor renderPass2 = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear) .GetResult(); diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp index c2260237c0..8b8c89e008 100644 --- a/examples/SampleUtils.cpp +++ b/examples/SampleUtils.cpp @@ -147,14 +147,14 @@ nxt::TextureView CreateDefaultDepthStencilView(const nxt::Device& device) { .GetResult(); } -void GetNextRenderPassInfo(const nxt::Device& device, +void GetNextRenderPassDescriptor(const nxt::Device& device, const nxt::SwapChain& swapchain, const nxt::TextureView& depthStencilView, nxt::Texture* backbuffer, - nxt::RenderPassInfo* info) { + nxt::RenderPassDescriptor* info) { *backbuffer = swapchain.GetNextTexture(); auto backbufferView = backbuffer->CreateTextureViewBuilder().GetResult(); - *info = device.CreateRenderPassInfoBuilder() + *info = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear) .SetDepthStencilAttachment(depthStencilView, nxt::LoadOp::Clear, nxt::LoadOp::Clear) .GetResult(); diff --git a/examples/SampleUtils.h b/examples/SampleUtils.h index 17a2760913..e1763bcda2 100644 --- a/examples/SampleUtils.h +++ b/examples/SampleUtils.h @@ -27,8 +27,8 @@ uint64_t GetSwapChainImplementation(); nxt::TextureFormat GetPreferredSwapChainTextureFormat(); nxt::SwapChain GetSwapChain(const nxt::Device& device); nxt::TextureView CreateDefaultDepthStencilView(const nxt::Device& device); -void GetNextRenderPassInfo(const nxt::Device& device, +void GetNextRenderPassDescriptor(const nxt::Device& device, const nxt::SwapChain& swapchain, const nxt::TextureView& depthStencilView, nxt::Texture* backbuffer, - nxt::RenderPassInfo* info); + nxt::RenderPassDescriptor* info); diff --git a/examples/glTFViewer/glTFViewer.cpp b/examples/glTFViewer/glTFViewer.cpp index d5f6aaad89..37e7a1ab41 100644 --- a/examples/glTFViewer/glTFViewer.cpp +++ b/examples/glTFViewer/glTFViewer.cpp @@ -584,8 +584,8 @@ namespace { void frame() { nxt::Texture backbuffer; - nxt::RenderPassInfo renderPass; - GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass); + nxt::RenderPassDescriptor renderPass; + GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass); const auto& defaultSceneNodes = scene.scenes.at(scene.defaultScene); nxt::CommandBufferBuilder cmd = device.CreateCommandBufferBuilder() diff --git a/next.json b/next.json index 16c096fe15..249939a5f8 100644 --- a/next.json +++ b/next.json @@ -345,7 +345,7 @@ { "name": "begin render pass", "args": [ - {"name": "info", "type": "render pass info"} + {"name": "info", "type": "render pass descriptor"} ] }, { @@ -592,8 +592,8 @@ "returns": "depth stencil state builder" }, { - "name": "create render pass info builder", - "returns": "render pass info builder" + "name": "create render pass descriptor builder", + "returns": "render pass descriptor builder" }, { "name": "create input state builder", @@ -814,12 +814,12 @@ } ] }, - "render pass info builder": { + "render pass descriptor builder": { "category": "object", "methods": [ { "name": "get result", - "returns": "render pass info" + "returns": "render pass descriptor" }, { "name": "set color attachment", @@ -858,7 +858,7 @@ } ] }, - "render pass info": { + "render pass descriptor": { "category": "object" }, "render pipeline": { diff --git a/src/backend/CMakeLists.txt b/src/backend/CMakeLists.txt index 5a0635dcb1..1bb41909e9 100644 --- a/src/backend/CMakeLists.txt +++ b/src/backend/CMakeLists.txt @@ -249,8 +249,8 @@ if (NXT_ENABLE_D3D12) ${D3D12_DIR}/PipelineLayoutD3D12.h ${D3D12_DIR}/QueueD3D12.cpp ${D3D12_DIR}/QueueD3D12.h - ${D3D12_DIR}/RenderPassInfoD3D12.cpp - ${D3D12_DIR}/RenderPassInfoD3D12.h + ${D3D12_DIR}/RenderPassDescriptorD3D12.cpp + ${D3D12_DIR}/RenderPassDescriptorD3D12.h ${D3D12_DIR}/RenderPipelineD3D12.cpp ${D3D12_DIR}/RenderPipelineD3D12.h ${D3D12_DIR}/ResourceAllocator.cpp @@ -318,8 +318,8 @@ if (NXT_ENABLE_VULKAN) ${VULKAN_DIR}/PipelineLayoutVk.h ${VULKAN_DIR}/RenderPassCache.cpp ${VULKAN_DIR}/RenderPassCache.h - ${VULKAN_DIR}/RenderPassInfoVk.cpp - ${VULKAN_DIR}/RenderPassInfoVk.h + ${VULKAN_DIR}/RenderPassDescriptorVk.cpp + ${VULKAN_DIR}/RenderPassDescriptorVk.h ${VULKAN_DIR}/RenderPipelineVk.cpp ${VULKAN_DIR}/RenderPipelineVk.h ${VULKAN_DIR}/SamplerVk.cpp @@ -379,8 +379,8 @@ list(APPEND BACKEND_SOURCES ${BACKEND_DIR}/PipelineLayout.h ${BACKEND_DIR}/Queue.cpp ${BACKEND_DIR}/Queue.h - ${BACKEND_DIR}/RenderPassInfo.cpp - ${BACKEND_DIR}/RenderPassInfo.h + ${BACKEND_DIR}/RenderPassDescriptor.cpp + ${BACKEND_DIR}/RenderPassDescriptor.h ${BACKEND_DIR}/RefCounted.cpp ${BACKEND_DIR}/RefCounted.h ${BACKEND_DIR}/Sampler.cpp diff --git a/src/backend/CommandBuffer.cpp b/src/backend/CommandBuffer.cpp index 747fa92195..2ee9c1fce7 100644 --- a/src/backend/CommandBuffer.cpp +++ b/src/backend/CommandBuffer.cpp @@ -368,7 +368,7 @@ namespace backend { case Command::BeginRenderPass: { BeginRenderPassCmd* cmd = mIterator.NextCommand(); - RenderPassInfoBase* info = cmd->info.Get(); + RenderPassDescriptorBase* info = cmd->info.Get(); if (!mState->BeginRenderPass(info)) { return false; } @@ -578,7 +578,7 @@ namespace backend { mAllocator.Allocate(Command::BeginComputePass); } - void CommandBufferBuilder::BeginRenderPass(RenderPassInfoBase* info) { + void CommandBufferBuilder::BeginRenderPass(RenderPassDescriptorBase* info) { BeginRenderPassCmd* cmd = mAllocator.Allocate(Command::BeginRenderPass); new (cmd) BeginRenderPassCmd; cmd->info = info; diff --git a/src/backend/CommandBuffer.h b/src/backend/CommandBuffer.h index 4375cd694d..23f17e289b 100644 --- a/src/backend/CommandBuffer.h +++ b/src/backend/CommandBuffer.h @@ -62,7 +62,7 @@ namespace backend { // NXT API void BeginComputePass(); - void BeginRenderPass(RenderPassInfoBase* info); + void BeginRenderPass(RenderPassDescriptorBase* info); void CopyBufferToBuffer(BufferBase* source, uint32_t sourceOffset, BufferBase* destination, diff --git a/src/backend/CommandBufferStateTracker.cpp b/src/backend/CommandBufferStateTracker.cpp index fe4822f3f5..81971f9023 100644 --- a/src/backend/CommandBufferStateTracker.cpp +++ b/src/backend/CommandBufferStateTracker.cpp @@ -21,7 +21,7 @@ #include "backend/Forward.h" #include "backend/InputState.h" #include "backend/PipelineLayout.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/RenderPipeline.h" #include "backend/Texture.h" #include "common/Assert.h" @@ -166,7 +166,7 @@ namespace backend { return true; } - bool CommandBufferStateTracker::BeginRenderPass(RenderPassInfoBase* info) { + bool CommandBufferStateTracker::BeginRenderPass(RenderPassDescriptorBase* info) { if (mAspects[VALIDATION_ASPECT_COMPUTE_PASS]) { mBuilder->HandleError("Cannot begin a render pass while a compute pass is active"); return false; diff --git a/src/backend/CommandBufferStateTracker.h b/src/backend/CommandBufferStateTracker.h index c2af36fa95..85d2901621 100644 --- a/src/backend/CommandBufferStateTracker.h +++ b/src/backend/CommandBufferStateTracker.h @@ -42,7 +42,7 @@ namespace backend { // State-modifying methods bool BeginComputePass(); bool EndComputePass(); - bool BeginRenderPass(RenderPassInfoBase* info); + bool BeginRenderPass(RenderPassDescriptorBase* info); bool EndRenderPass(); bool SetComputePipeline(ComputePipelineBase* pipeline); bool SetRenderPipeline(RenderPipelineBase* pipeline); @@ -106,7 +106,7 @@ namespace backend { std::map mMostRecentBufferUsages; std::map mMostRecentTextureUsages; - RenderPassInfoBase* mCurrentRenderPass = nullptr; + RenderPassDescriptorBase* mCurrentRenderPass = nullptr; }; } // namespace backend diff --git a/src/backend/Commands.h b/src/backend/Commands.h index e90397c3ba..2d70a1ac04 100644 --- a/src/backend/Commands.h +++ b/src/backend/Commands.h @@ -15,7 +15,7 @@ #ifndef BACKEND_COMMANDS_H_ #define BACKEND_COMMANDS_H_ -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/Texture.h" #include "nxt/nxtcpp.h" @@ -53,7 +53,7 @@ namespace backend { struct BeginComputePassCmd {}; struct BeginRenderPassCmd { - Ref info; + Ref info; }; struct BufferCopyLocation { diff --git a/src/backend/Device.cpp b/src/backend/Device.cpp index 8a02c5656c..9576d94f4d 100644 --- a/src/backend/Device.cpp +++ b/src/backend/Device.cpp @@ -24,7 +24,7 @@ #include "backend/InputState.h" #include "backend/PipelineLayout.h" #include "backend/Queue.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/RenderPipeline.h" #include "backend/Sampler.h" #include "backend/ShaderModule.h" @@ -124,8 +124,8 @@ namespace backend { QueueBuilder* DeviceBase::CreateQueueBuilder() { return new QueueBuilder(this); } - RenderPassInfoBuilder* DeviceBase::CreateRenderPassInfoBuilder() { - return new RenderPassInfoBuilder(this); + RenderPassDescriptorBuilder* DeviceBase::CreateRenderPassDescriptorBuilder() { + return new RenderPassDescriptorBuilder(this); } RenderPipelineBuilder* DeviceBase::CreateRenderPipelineBuilder() { return new RenderPipelineBuilder(this); diff --git a/src/backend/Device.h b/src/backend/Device.h index df23d2232c..b076c2eddd 100644 --- a/src/backend/Device.h +++ b/src/backend/Device.h @@ -46,7 +46,8 @@ namespace backend { virtual InputStateBase* CreateInputState(InputStateBuilder* builder) = 0; virtual PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) = 0; virtual QueueBase* CreateQueue(QueueBuilder* builder) = 0; - virtual RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) = 0; + virtual RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) = 0; virtual RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) = 0; virtual SamplerBase* CreateSampler(SamplerBuilder* builder) = 0; virtual ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) = 0; @@ -85,7 +86,7 @@ namespace backend { InputStateBuilder* CreateInputStateBuilder(); PipelineLayoutBuilder* CreatePipelineLayoutBuilder(); QueueBuilder* CreateQueueBuilder(); - RenderPassInfoBuilder* CreateRenderPassInfoBuilder(); + RenderPassDescriptorBuilder* CreateRenderPassDescriptorBuilder(); RenderPipelineBuilder* CreateRenderPipelineBuilder(); SamplerBuilder* CreateSamplerBuilder(); ShaderModuleBuilder* CreateShaderModuleBuilder(); diff --git a/src/backend/Forward.h b/src/backend/Forward.h index 418dd689a9..1cab93fee5 100644 --- a/src/backend/Forward.h +++ b/src/backend/Forward.h @@ -41,8 +41,8 @@ namespace backend { class PipelineLayoutBuilder; class QueueBase; class QueueBuilder; - class RenderPassInfoBase; - class RenderPassInfoBuilder; + class RenderPassDescriptorBase; + class RenderPassDescriptorBuilder; class RenderPipelineBase; class RenderPipelineBuilder; class SamplerBase; diff --git a/src/backend/RenderPassInfo.cpp b/src/backend/RenderPassDescriptor.cpp similarity index 68% rename from src/backend/RenderPassInfo.cpp rename to src/backend/RenderPassDescriptor.cpp index 1bf09030f1..bfd55d2701 100644 --- a/src/backend/RenderPassInfo.cpp +++ b/src/backend/RenderPassDescriptor.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/Device.h" #include "backend/Texture.h" @@ -21,9 +21,9 @@ namespace backend { - // RenderPassInfo + // RenderPassDescriptor - RenderPassInfoBase::RenderPassInfoBase(RenderPassInfoBuilder* builder) + RenderPassDescriptorBase::RenderPassDescriptorBase(RenderPassDescriptorBuilder* builder) : mColorAttachmentsSet(builder->mColorAttachmentsSet), mColorAttachments(builder->mColorAttachments), mDepthStencilAttachmentSet(builder->mDepthStencilAttachmentSet), @@ -32,15 +32,15 @@ namespace backend { mHeight(builder->mHeight) { } - std::bitset RenderPassInfoBase::GetColorAttachmentMask() const { + std::bitset RenderPassDescriptorBase::GetColorAttachmentMask() const { return mColorAttachmentsSet; } - bool RenderPassInfoBase::HasDepthStencilAttachment() const { + bool RenderPassDescriptorBase::HasDepthStencilAttachment() const { return mDepthStencilAttachmentSet; } - const RenderPassColorAttachmentInfo& RenderPassInfoBase::GetColorAttachment( + const RenderPassColorAttachmentInfo& RenderPassDescriptorBase::GetColorAttachment( uint32_t attachment) const { ASSERT(attachment < kMaxColorAttachments); ASSERT(mColorAttachmentsSet[attachment]); @@ -48,40 +48,41 @@ namespace backend { return mColorAttachments[attachment]; } - RenderPassColorAttachmentInfo& RenderPassInfoBase::GetColorAttachment(uint32_t attachment) { + RenderPassColorAttachmentInfo& RenderPassDescriptorBase::GetColorAttachment( + uint32_t attachment) { ASSERT(attachment < kMaxColorAttachments); ASSERT(mColorAttachmentsSet[attachment]); return mColorAttachments[attachment]; } - const RenderPassDepthStencilAttachmentInfo& RenderPassInfoBase::GetDepthStencilAttachment() - const { + const RenderPassDepthStencilAttachmentInfo& + RenderPassDescriptorBase::GetDepthStencilAttachment() const { ASSERT(mDepthStencilAttachmentSet); return mDepthStencilAttachment; } - RenderPassDepthStencilAttachmentInfo& RenderPassInfoBase::GetDepthStencilAttachment() { + RenderPassDepthStencilAttachmentInfo& RenderPassDescriptorBase::GetDepthStencilAttachment() { ASSERT(mDepthStencilAttachmentSet); return mDepthStencilAttachment; } - uint32_t RenderPassInfoBase::GetWidth() const { + uint32_t RenderPassDescriptorBase::GetWidth() const { return mWidth; } - uint32_t RenderPassInfoBase::GetHeight() const { + uint32_t RenderPassDescriptorBase::GetHeight() const { return mHeight; } - // RenderPassInfoBuilder + // RenderPassDescriptorBuilder - RenderPassInfoBuilder::RenderPassInfoBuilder(DeviceBase* device) : Builder(device) { + RenderPassDescriptorBuilder::RenderPassDescriptorBuilder(DeviceBase* device) : Builder(device) { } - RenderPassInfoBase* RenderPassInfoBuilder::GetResultImpl() { + RenderPassDescriptorBase* RenderPassDescriptorBuilder::GetResultImpl() { auto CheckOrSetSize = [this](const TextureViewBase* attachment) -> bool { if (this->mWidth == 0) { ASSERT(this->mHeight == 0); @@ -120,12 +121,12 @@ namespace backend { return nullptr; } - return mDevice->CreateRenderPassInfo(this); + return mDevice->CreateRenderPassDescriptor(this); } - void RenderPassInfoBuilder::SetColorAttachment(uint32_t attachment, - TextureViewBase* textureView, - nxt::LoadOp loadOp) { + void RenderPassDescriptorBuilder::SetColorAttachment(uint32_t attachment, + TextureViewBase* textureView, + nxt::LoadOp loadOp) { if (attachment >= kMaxColorAttachments) { HandleError("Setting color attachment out of bounds"); return; @@ -141,11 +142,11 @@ namespace backend { mColorAttachments[attachment].view = textureView; } - void RenderPassInfoBuilder::SetColorAttachmentClearColor(uint32_t attachment, - float clearR, - float clearG, - float clearB, - float clearA) { + void RenderPassDescriptorBuilder::SetColorAttachmentClearColor(uint32_t attachment, + float clearR, + float clearG, + float clearB, + float clearA) { if (attachment >= kMaxColorAttachments) { HandleError("Setting color attachment out of bounds"); return; @@ -157,9 +158,9 @@ namespace backend { mColorAttachments[attachment].clearColor[3] = clearA; } - void RenderPassInfoBuilder::SetDepthStencilAttachment(TextureViewBase* textureView, - nxt::LoadOp depthLoadOp, - nxt::LoadOp stencilLoadOp) { + void RenderPassDescriptorBuilder::SetDepthStencilAttachment(TextureViewBase* textureView, + nxt::LoadOp depthLoadOp, + nxt::LoadOp stencilLoadOp) { if (!TextureFormatHasDepthOrStencil(textureView->GetTexture()->GetFormat())) { HandleError("Using color texture as depth stencil attachment"); return; @@ -171,8 +172,8 @@ namespace backend { mDepthStencilAttachment.view = textureView; } - void RenderPassInfoBuilder::SetDepthStencilAttachmentClearValue(float clearDepth, - uint32_t clearStencil) { + void RenderPassDescriptorBuilder::SetDepthStencilAttachmentClearValue(float clearDepth, + uint32_t clearStencil) { mDepthStencilAttachment.clearDepth = clearDepth; mDepthStencilAttachment.clearStencil = clearStencil; } diff --git a/src/backend/RenderPassInfo.h b/src/backend/RenderPassDescriptor.h similarity index 84% rename from src/backend/RenderPassInfo.h rename to src/backend/RenderPassDescriptor.h index 09962d4570..956138af6f 100644 --- a/src/backend/RenderPassInfo.h +++ b/src/backend/RenderPassDescriptor.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BACKEND_RENDERPASSINFO_H_ -#define BACKEND_RENDERPASSINFO_H_ +#ifndef BACKEND_RENDERPASSDESCRIPTOR_H_ +#define BACKEND_RENDERPASSDESCRIPTOR_H_ #include "backend/Builder.h" #include "backend/Forward.h" @@ -42,12 +42,12 @@ namespace backend { Ref view; }; - // RenderPassInfo contains the list of attachments for a renderpass along with data such as the - // load operation and the clear values for the attachments. + // RenderPassDescriptor contains the list of attachments for a renderpass along with data such + // as the load operation and the clear values for the attachments. - class RenderPassInfoBase : public RefCounted { + class RenderPassDescriptorBase : public RefCounted { public: - RenderPassInfoBase(RenderPassInfoBuilder* builder); + RenderPassDescriptorBase(RenderPassDescriptorBuilder* builder); std::bitset GetColorAttachmentMask() const; bool HasDepthStencilAttachment() const; @@ -72,12 +72,12 @@ namespace backend { uint32_t mHeight; }; - class RenderPassInfoBuilder : public Builder { + class RenderPassDescriptorBuilder : public Builder { public: - RenderPassInfoBuilder(DeviceBase* device); + RenderPassDescriptorBuilder(DeviceBase* device); // NXT API - RenderPassInfoBase* GetResultImpl() override; + RenderPassDescriptorBase* GetResultImpl() override; void SetColorAttachment(uint32_t attachment, TextureViewBase* textureView, nxt::LoadOp loadOp); @@ -92,7 +92,7 @@ namespace backend { void SetDepthStencilAttachmentClearValue(float clearDepth, uint32_t clearStencil); private: - friend class RenderPassInfoBase; + friend class RenderPassDescriptorBase; std::bitset mColorAttachmentsSet; std::array mColorAttachments; diff --git a/src/backend/RenderPipeline.cpp b/src/backend/RenderPipeline.cpp index a3aeba56c3..2392d5a947 100644 --- a/src/backend/RenderPipeline.cpp +++ b/src/backend/RenderPipeline.cpp @@ -18,7 +18,7 @@ #include "backend/DepthStencilState.h" #include "backend/Device.h" #include "backend/InputState.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/Texture.h" #include "common/BitSetIterator.h" @@ -102,7 +102,7 @@ namespace backend { return mDepthStencilFormat; } - bool RenderPipelineBase::IsCompatibleWith(const RenderPassInfoBase* renderPass) const { + bool RenderPipelineBase::IsCompatibleWith(const RenderPassDescriptorBase* renderPass) const { // TODO(cwallez@chromium.org): This is called on every SetPipeline command. Optimize it for // example by caching some "attachment compatibility" object that would make the // compatibility check a single pointer comparison. diff --git a/src/backend/RenderPipeline.h b/src/backend/RenderPipeline.h index ad08d18a1b..fe77f7fce6 100644 --- a/src/backend/RenderPipeline.h +++ b/src/backend/RenderPipeline.h @@ -44,7 +44,7 @@ namespace backend { // A pipeline can be used in a render pass if its attachment info matches the actual // attachments in the render pass. This returns whether it is the case. - bool IsCompatibleWith(const RenderPassInfoBase* renderPass) const; + bool IsCompatibleWith(const RenderPassDescriptorBase* renderPass) const; private: Ref mDepthStencilState; diff --git a/src/backend/ToBackend.h b/src/backend/ToBackend.h index 2478e53a67..62288b12f9 100644 --- a/src/backend/ToBackend.h +++ b/src/backend/ToBackend.h @@ -84,8 +84,8 @@ namespace backend { }; template - struct ToBackendTraits { - using BackendType = typename BackendTraits::RenderPassInfoType; + struct ToBackendTraits { + using BackendType = typename BackendTraits::RenderPassDescriptorType; }; template diff --git a/src/backend/d3d12/CommandBufferD3D12.cpp b/src/backend/d3d12/CommandBufferD3D12.cpp index c106537e3c..5df4209e53 100644 --- a/src/backend/d3d12/CommandBufferD3D12.cpp +++ b/src/backend/d3d12/CommandBufferD3D12.cpp @@ -23,7 +23,7 @@ #include "backend/d3d12/DescriptorHeapAllocator.h" #include "backend/d3d12/InputStateD3D12.h" #include "backend/d3d12/PipelineLayoutD3D12.h" -#include "backend/d3d12/RenderPassInfoD3D12.h" +#include "backend/d3d12/RenderPassDescriptorD3D12.h" #include "backend/d3d12/RenderPipelineD3D12.h" #include "backend/d3d12/ResourceAllocator.h" #include "backend/d3d12/SamplerD3D12.h" @@ -265,9 +265,9 @@ namespace backend { namespace d3d12 { case Command::BeginRenderPass: { BeginRenderPassCmd* beginRenderPassCmd = mCommands.NextCommand(); - RenderPassInfo* info = ToBackend(beginRenderPassCmd->info.Get()); + RenderPassDescriptor* info = ToBackend(beginRenderPassCmd->info.Get()); - RenderPassInfo::OMSetRenderTargetArgs args = + RenderPassDescriptor::OMSetRenderTargetArgs args = info->GetSubpassOMSetRenderTargetArgs(); if (args.dsv.ptr) { commandList->OMSetRenderTargets(args.numRTVs, args.RTVs.data(), FALSE, diff --git a/src/backend/d3d12/D3D12Backend.cpp b/src/backend/d3d12/D3D12Backend.cpp index eea2af5a04..97a6ea1efc 100644 --- a/src/backend/d3d12/D3D12Backend.cpp +++ b/src/backend/d3d12/D3D12Backend.cpp @@ -27,7 +27,7 @@ #include "backend/d3d12/NativeSwapChainImplD3D12.h" #include "backend/d3d12/PipelineLayoutD3D12.h" #include "backend/d3d12/QueueD3D12.h" -#include "backend/d3d12/RenderPassInfoD3D12.h" +#include "backend/d3d12/RenderPassDescriptorD3D12.h" #include "backend/d3d12/RenderPipelineD3D12.h" #include "backend/d3d12/ResourceAllocator.h" #include "backend/d3d12/ResourceUploader.h" @@ -291,8 +291,9 @@ namespace backend { namespace d3d12 { QueueBase* Device::CreateQueue(QueueBuilder* builder) { return new Queue(this, builder); } - RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) { - return new RenderPassInfo(this, builder); + RenderPassDescriptorBase* Device::CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) { + return new RenderPassDescriptor(this, builder); } RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) { return new RenderPipeline(builder); diff --git a/src/backend/d3d12/D3D12Backend.h b/src/backend/d3d12/D3D12Backend.h index fd13777a05..4d5514f521 100644 --- a/src/backend/d3d12/D3D12Backend.h +++ b/src/backend/d3d12/D3D12Backend.h @@ -37,7 +37,7 @@ namespace backend { namespace d3d12 { class InputState; class PipelineLayout; class Queue; - class RenderPassInfo; + class RenderPassDescriptor; class RenderPipeline; class Sampler; class ShaderModule; @@ -64,7 +64,7 @@ namespace backend { namespace d3d12 { using InputStateType = InputState; using PipelineLayoutType = PipelineLayout; using QueueType = Queue; - using RenderPassInfoType = RenderPassInfo; + using RenderPassDescriptorType = RenderPassDescriptor; using RenderPipelineType = RenderPipeline; using SamplerType = Sampler; using ShaderModuleType = ShaderModule; @@ -97,7 +97,8 @@ namespace backend { namespace d3d12 { InputStateBase* CreateInputState(InputStateBuilder* builder) override; PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override; QueueBase* CreateQueue(QueueBuilder* builder) override; - RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override; + RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) override; RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override; SamplerBase* CreateSampler(SamplerBuilder* builder) override; ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override; diff --git a/src/backend/d3d12/GeneratedCodeIncludes.h b/src/backend/d3d12/GeneratedCodeIncludes.h index d54873ab10..c02e291299 100644 --- a/src/backend/d3d12/GeneratedCodeIncludes.h +++ b/src/backend/d3d12/GeneratedCodeIncludes.h @@ -23,7 +23,7 @@ #include "backend/d3d12/InputStateD3D12.h" #include "backend/d3d12/PipelineLayoutD3D12.h" #include "backend/d3d12/QueueD3D12.h" -#include "backend/d3d12/RenderPassInfoD3D12.h" +#include "backend/d3d12/RenderPassDescriptorD3D12.h" #include "backend/d3d12/RenderPipelineD3D12.h" #include "backend/d3d12/SamplerD3D12.h" #include "backend/d3d12/ShaderModuleD3D12.h" diff --git a/src/backend/d3d12/RenderPassInfoD3D12.cpp b/src/backend/d3d12/RenderPassDescriptorD3D12.cpp similarity index 85% rename from src/backend/d3d12/RenderPassInfoD3D12.cpp rename to src/backend/d3d12/RenderPassDescriptorD3D12.cpp index c4a9b8e9ad..6481b36777 100644 --- a/src/backend/d3d12/RenderPassInfoD3D12.cpp +++ b/src/backend/d3d12/RenderPassDescriptorD3D12.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "backend/d3d12/RenderPassInfoD3D12.h" +#include "backend/d3d12/RenderPassDescriptorD3D12.h" #include "backend/d3d12/D3D12Backend.h" #include "backend/d3d12/TextureD3D12.h" @@ -20,8 +20,8 @@ namespace backend { namespace d3d12 { - RenderPassInfo::RenderPassInfo(Device* device, RenderPassInfoBuilder* builder) - : RenderPassInfoBase(builder), mDevice(device) { + RenderPassDescriptor::RenderPassDescriptor(Device* device, RenderPassDescriptorBuilder* builder) + : RenderPassDescriptorBase(builder), mDevice(device) { // Get and fill an RTV heap with the color attachments uint32_t colorAttachmentCount = static_cast(GetColorAttachmentMask().count()); if (colorAttachmentCount != 0) { @@ -53,7 +53,8 @@ namespace backend { namespace d3d12 { } } - RenderPassInfo::OMSetRenderTargetArgs RenderPassInfo::GetSubpassOMSetRenderTargetArgs() { + RenderPassDescriptor::OMSetRenderTargetArgs + RenderPassDescriptor::GetSubpassOMSetRenderTargetArgs() { OMSetRenderTargetArgs args = {}; size_t rtvIndex = 0; @@ -70,11 +71,11 @@ namespace backend { namespace d3d12 { return args; } - D3D12_CPU_DESCRIPTOR_HANDLE RenderPassInfo::GetRTVDescriptor(uint32_t attachmentSlot) { + D3D12_CPU_DESCRIPTOR_HANDLE RenderPassDescriptor::GetRTVDescriptor(uint32_t attachmentSlot) { return mRtvHeap.GetCPUHandle(attachmentSlot); } - D3D12_CPU_DESCRIPTOR_HANDLE RenderPassInfo::GetDSVDescriptor() { + D3D12_CPU_DESCRIPTOR_HANDLE RenderPassDescriptor::GetDSVDescriptor() { return mDsvHeap.GetCPUHandle(0); } diff --git a/src/backend/d3d12/RenderPassInfoD3D12.h b/src/backend/d3d12/RenderPassDescriptorD3D12.h similarity index 80% rename from src/backend/d3d12/RenderPassInfoD3D12.h rename to src/backend/d3d12/RenderPassDescriptorD3D12.h index fcd7011010..46313eadce 100644 --- a/src/backend/d3d12/RenderPassInfoD3D12.h +++ b/src/backend/d3d12/RenderPassDescriptorD3D12.h @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BACKEND_D3D12_RENDERPASSINFOD3D12_H_ -#define BACKEND_D3D12_RENDERPASSINFOD3D12_H_ +#ifndef BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_ +#define BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_ -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/d3d12/DescriptorHeapAllocator.h" #include "backend/d3d12/d3d12_platform.h" @@ -28,7 +28,7 @@ namespace backend { namespace d3d12 { class Device; - class RenderPassInfo : public RenderPassInfoBase { + class RenderPassDescriptor : public RenderPassDescriptorBase { public: struct OMSetRenderTargetArgs { unsigned int numRTVs = 0; @@ -36,7 +36,7 @@ namespace backend { namespace d3d12 { D3D12_CPU_DESCRIPTOR_HANDLE dsv = {}; }; - RenderPassInfo(Device* device, RenderPassInfoBuilder* builder); + RenderPassDescriptor(Device* device, RenderPassDescriptorBuilder* builder); OMSetRenderTargetArgs GetSubpassOMSetRenderTargetArgs(); D3D12_CPU_DESCRIPTOR_HANDLE GetRTVDescriptor(uint32_t attachmentSlot); D3D12_CPU_DESCRIPTOR_HANDLE GetDSVDescriptor(); @@ -49,4 +49,4 @@ namespace backend { namespace d3d12 { }} // namespace backend::d3d12 -#endif // BACKEND_D3D12_RENDERPASSINFOD3D12_H_ +#endif // BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_ diff --git a/src/backend/metal/CommandBufferMTL.mm b/src/backend/metal/CommandBufferMTL.mm index e26efbde28..e4a6ac0e45 100644 --- a/src/backend/metal/CommandBufferMTL.mm +++ b/src/backend/metal/CommandBufferMTL.mm @@ -64,7 +64,7 @@ namespace backend { namespace metal { compute = nil; // This will be autoreleased. } - void BeginRenderPass(id commandBuffer, RenderPassInfo* info) { + void BeginRenderPass(id commandBuffer, RenderPassDescriptor* info) { if (render != nil) { [render endEncoding]; render = nil; // This will be autoreleased. @@ -172,7 +172,7 @@ namespace backend { namespace metal { BeginRenderPassCmd* beginRenderPassCmd = mCommands.NextCommand(); - RenderPassInfo* info = ToBackend(beginRenderPassCmd->info.Get()); + RenderPassDescriptor* info = ToBackend(beginRenderPassCmd->info.Get()); encoders.EnsureNoBlitEncoder(); encoders.BeginRenderPass(commandBuffer, info); diff --git a/src/backend/metal/MetalBackend.h b/src/backend/metal/MetalBackend.h index 2b0e3305e2..a61cc77196 100644 --- a/src/backend/metal/MetalBackend.h +++ b/src/backend/metal/MetalBackend.h @@ -21,7 +21,7 @@ #include "backend/BindGroupLayout.h" #include "backend/Device.h" #include "backend/Queue.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/ToBackend.h" #include "common/Serial.h" @@ -44,7 +44,7 @@ namespace backend { namespace metal { class InputState; class PipelineLayout; class Queue; - class RenderPassInfo; + class RenderPassDescriptor; class RenderPipeline; class Sampler; class ShaderModule; @@ -65,7 +65,7 @@ namespace backend { namespace metal { using InputStateType = InputState; using PipelineLayoutType = PipelineLayout; using QueueType = Queue; - using RenderPassInfoType = RenderPassInfo; + using RenderPassDescriptorType = RenderPassDescriptor; using RenderPipelineType = RenderPipeline; using SamplerType = Sampler; using ShaderModuleType = ShaderModule; @@ -98,7 +98,8 @@ namespace backend { namespace metal { InputStateBase* CreateInputState(InputStateBuilder* builder) override; PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override; QueueBase* CreateQueue(QueueBuilder* builder) override; - RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override; + RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) override; RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override; SamplerBase* CreateSampler(SamplerBuilder* builder) override; ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override; @@ -154,10 +155,10 @@ namespace backend { namespace metal { id mCommandQueue = nil; }; - class RenderPassInfo : public RenderPassInfoBase { + class RenderPassDescriptor : public RenderPassDescriptorBase { public: - RenderPassInfo(RenderPassInfoBuilder* builder); - ~RenderPassInfo(); + RenderPassDescriptor(RenderPassDescriptorBuilder* builder); + ~RenderPassDescriptor(); }; }} // namespace backend::metal diff --git a/src/backend/metal/MetalBackend.mm b/src/backend/metal/MetalBackend.mm index 40d5ce9d6e..0c9bf49917 100644 --- a/src/backend/metal/MetalBackend.mm +++ b/src/backend/metal/MetalBackend.mm @@ -110,8 +110,9 @@ namespace backend { namespace metal { QueueBase* Device::CreateQueue(QueueBuilder* builder) { return new Queue(builder); } - RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) { - return new RenderPassInfo(builder); + RenderPassDescriptorBase* Device::CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) { + return new RenderPassDescriptor(builder); } RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) { return new RenderPipeline(builder); @@ -229,10 +230,11 @@ namespace backend { namespace metal { // RenderPass - RenderPassInfo::RenderPassInfo(RenderPassInfoBuilder* builder) : RenderPassInfoBase(builder) { + RenderPassDescriptor::RenderPassDescriptor(RenderPassDescriptorBuilder* builder) + : RenderPassDescriptorBase(builder) { } - RenderPassInfo::~RenderPassInfo() { + RenderPassDescriptor::~RenderPassDescriptor() { } }} // namespace backend::metal diff --git a/src/backend/null/NullBackend.cpp b/src/backend/null/NullBackend.cpp index beefc9ee3b..55ea703849 100644 --- a/src/backend/null/NullBackend.cpp +++ b/src/backend/null/NullBackend.cpp @@ -69,8 +69,9 @@ namespace backend { namespace null { QueueBase* Device::CreateQueue(QueueBuilder* builder) { return new Queue(builder); } - RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) { - return new RenderPassInfo(builder); + RenderPassDescriptorBase* Device::CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) { + return new RenderPassDescriptor(builder); } RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) { return new RenderPipeline(builder); diff --git a/src/backend/null/NullBackend.h b/src/backend/null/NullBackend.h index 217bb12d0c..28366e03cf 100644 --- a/src/backend/null/NullBackend.h +++ b/src/backend/null/NullBackend.h @@ -28,7 +28,7 @@ #include "backend/InputState.h" #include "backend/PipelineLayout.h" #include "backend/Queue.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/RenderPipeline.h" #include "backend/Sampler.h" #include "backend/ShaderModule.h" @@ -50,7 +50,7 @@ namespace backend { namespace null { using InputState = InputStateBase; using PipelineLayout = PipelineLayoutBase; class Queue; - using RenderPassInfo = RenderPassInfoBase; + using RenderPassDescriptor = RenderPassDescriptorBase; using RenderPipeline = RenderPipelineBase; using Sampler = SamplerBase; using ShaderModule = ShaderModuleBase; @@ -71,7 +71,7 @@ namespace backend { namespace null { using InputStateType = InputState; using PipelineLayoutType = PipelineLayout; using QueueType = Queue; - using RenderPassInfoType = RenderPassInfo; + using RenderPassDescriptorType = RenderPassDescriptor; using RenderPipelineType = RenderPipeline; using SamplerType = Sampler; using ShaderModuleType = ShaderModule; @@ -106,7 +106,8 @@ namespace backend { namespace null { InputStateBase* CreateInputState(InputStateBuilder* builder) override; PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override; QueueBase* CreateQueue(QueueBuilder* builder) override; - RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override; + RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) override; RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override; SamplerBase* CreateSampler(SamplerBuilder* builder) override; ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override; diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index 4859c2628c..5343f40d80 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -265,7 +265,7 @@ namespace backend { namespace opengl { case Command::BeginRenderPass: { auto* cmd = mCommands.NextCommand(); - RenderPassInfo* info = ToBackend(cmd->info.Get()); + RenderPassDescriptor* info = ToBackend(cmd->info.Get()); pushConstants.OnBeginPass(); inputBuffers.OnBeginPass(); diff --git a/src/backend/opengl/OpenGLBackend.cpp b/src/backend/opengl/OpenGLBackend.cpp index c0456c44e8..f4a2ae40ad 100644 --- a/src/backend/opengl/OpenGLBackend.cpp +++ b/src/backend/opengl/OpenGLBackend.cpp @@ -79,8 +79,9 @@ namespace backend { namespace opengl { QueueBase* Device::CreateQueue(QueueBuilder* builder) { return new Queue(builder); } - RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) { - return new RenderPassInfo(builder); + RenderPassDescriptorBase* Device::CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) { + return new RenderPassDescriptor(builder); } RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) { return new RenderPipeline(builder); @@ -126,9 +127,10 @@ namespace backend { namespace opengl { } } - // RenderPassInfo + // RenderPassDescriptor - RenderPassInfo::RenderPassInfo(RenderPassInfoBuilder* builder) : RenderPassInfoBase(builder) { + RenderPassDescriptor::RenderPassDescriptor(RenderPassDescriptorBuilder* builder) + : RenderPassDescriptorBase(builder) { } }} // namespace backend::opengl diff --git a/src/backend/opengl/OpenGLBackend.h b/src/backend/opengl/OpenGLBackend.h index 2c2299ef3c..f62d03ba53 100644 --- a/src/backend/opengl/OpenGLBackend.h +++ b/src/backend/opengl/OpenGLBackend.h @@ -25,7 +25,7 @@ #include "backend/Device.h" #include "backend/InputState.h" #include "backend/Queue.h" -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "backend/ToBackend.h" #include "glad/glad.h" @@ -45,7 +45,7 @@ namespace backend { namespace opengl { class PersistentPipelineState; class PipelineLayout; class Queue; - class RenderPassInfo; + class RenderPassDescriptor; class RenderPipeline; class Sampler; class ShaderModule; @@ -66,7 +66,7 @@ namespace backend { namespace opengl { using InputStateType = InputState; using PipelineLayoutType = PipelineLayout; using QueueType = Queue; - using RenderPassInfoType = RenderPassInfo; + using RenderPassDescriptorType = RenderPassDescriptor; using RenderPipelineType = RenderPipeline; using SamplerType = Sampler; using ShaderModuleType = ShaderModule; @@ -94,7 +94,8 @@ namespace backend { namespace opengl { InputStateBase* CreateInputState(InputStateBuilder* builder) override; PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override; QueueBase* CreateQueue(QueueBuilder* builder) override; - RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override; + RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) override; RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override; SamplerBase* CreateSampler(SamplerBuilder* builder) override; ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override; @@ -123,9 +124,9 @@ namespace backend { namespace opengl { void Submit(uint32_t numCommands, CommandBuffer* const* commands); }; - class RenderPassInfo : public RenderPassInfoBase { + class RenderPassDescriptor : public RenderPassDescriptorBase { public: - RenderPassInfo(RenderPassInfoBuilder* builder); + RenderPassDescriptor(RenderPassDescriptorBuilder* builder); }; }} // namespace backend::opengl diff --git a/src/backend/vulkan/CommandBufferVk.cpp b/src/backend/vulkan/CommandBufferVk.cpp index b85012f12e..f465827d0a 100644 --- a/src/backend/vulkan/CommandBufferVk.cpp +++ b/src/backend/vulkan/CommandBufferVk.cpp @@ -19,7 +19,7 @@ #include "backend/vulkan/BufferVk.h" #include "backend/vulkan/ComputePipelineVk.h" #include "backend/vulkan/PipelineLayoutVk.h" -#include "backend/vulkan/RenderPassInfoVk.h" +#include "backend/vulkan/RenderPassDescriptorVk.h" #include "backend/vulkan/RenderPipelineVk.h" #include "backend/vulkan/TextureVk.h" #include "backend/vulkan/VulkanBackend.h" @@ -183,7 +183,7 @@ namespace backend { namespace vulkan { case Command::BeginRenderPass: { BeginRenderPassCmd* cmd = mCommands.NextCommand(); - RenderPassInfo* info = ToBackend(cmd->info.Get()); + RenderPassDescriptor* info = ToBackend(cmd->info.Get()); // NXT has an implicit transition to color attachment on render passes. // Transition the attachments now before we start the render pass. diff --git a/src/backend/vulkan/GeneratedCodeIncludes.h b/src/backend/vulkan/GeneratedCodeIncludes.h index 18e96e72e1..7af9d703fb 100644 --- a/src/backend/vulkan/GeneratedCodeIncludes.h +++ b/src/backend/vulkan/GeneratedCodeIncludes.h @@ -21,7 +21,7 @@ #include "backend/vulkan/DepthStencilStateVk.h" #include "backend/vulkan/InputStateVk.h" #include "backend/vulkan/PipelineLayoutVk.h" -#include "backend/vulkan/RenderPassInfoVk.h" +#include "backend/vulkan/RenderPassDescriptorVk.h" #include "backend/vulkan/RenderPipelineVk.h" #include "backend/vulkan/SamplerVk.h" #include "backend/vulkan/ShaderModuleVk.h" diff --git a/src/backend/vulkan/RenderPassInfoVk.cpp b/src/backend/vulkan/RenderPassDescriptorVk.cpp similarity index 94% rename from src/backend/vulkan/RenderPassInfoVk.cpp rename to src/backend/vulkan/RenderPassDescriptorVk.cpp index 4f046f5ad1..02d433792a 100644 --- a/src/backend/vulkan/RenderPassInfoVk.cpp +++ b/src/backend/vulkan/RenderPassDescriptorVk.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "backend/vulkan/RenderPassInfoVk.h" +#include "backend/vulkan/RenderPassDescriptorVk.h" #include "backend/vulkan/FencedDeleter.h" #include "backend/vulkan/RenderPassCache.h" @@ -22,11 +22,11 @@ namespace backend { namespace vulkan { - RenderPassInfo::RenderPassInfo(RenderPassInfoBuilder* builder) - : RenderPassInfoBase(builder), mDevice(ToBackend(builder->GetDevice())) { + RenderPassDescriptor::RenderPassDescriptor(RenderPassDescriptorBuilder* builder) + : RenderPassDescriptorBase(builder), mDevice(ToBackend(builder->GetDevice())) { } - void RenderPassInfo::RecordBeginRenderPass(VkCommandBuffer commands) { + void RenderPassDescriptor::RecordBeginRenderPass(VkCommandBuffer commands) { // Query a VkRenderPass from the cache VkRenderPass renderPass = VK_NULL_HANDLE; { diff --git a/src/backend/vulkan/RenderPassInfoVk.h b/src/backend/vulkan/RenderPassDescriptorVk.h similarity index 74% rename from src/backend/vulkan/RenderPassInfoVk.h rename to src/backend/vulkan/RenderPassDescriptorVk.h index dcbba41b04..4955b163cd 100644 --- a/src/backend/vulkan/RenderPassInfoVk.h +++ b/src/backend/vulkan/RenderPassDescriptorVk.h @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BACKEND_VULKAN_RENDERPASSINFOVK_H_ -#define BACKEND_VULKAN_RENDERPASSINFOVK_H_ +#ifndef BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_ +#define BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_ -#include "backend/RenderPassInfo.h" +#include "backend/RenderPassDescriptor.h" #include "common/vulkan_platform.h" @@ -23,9 +23,9 @@ namespace backend { namespace vulkan { class Device; - class RenderPassInfo : public RenderPassInfoBase { + class RenderPassDescriptor : public RenderPassDescriptorBase { public: - RenderPassInfo(RenderPassInfoBuilder* builder); + RenderPassDescriptor(RenderPassDescriptorBuilder* builder); // Compute all the arguments for, and record the vkCmdBeginRenderPass command. void RecordBeginRenderPass(VkCommandBuffer commands); @@ -36,4 +36,4 @@ namespace backend { namespace vulkan { }} // namespace backend::vulkan -#endif // BACKEND_VULKAN_RENDERPASSINFOVK_H_ +#endif // BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_ diff --git a/src/backend/vulkan/RenderPipelineVk.cpp b/src/backend/vulkan/RenderPipelineVk.cpp index 03548a065c..37add1ecf0 100644 --- a/src/backend/vulkan/RenderPipelineVk.cpp +++ b/src/backend/vulkan/RenderPipelineVk.cpp @@ -20,7 +20,7 @@ #include "backend/vulkan/InputStateVk.h" #include "backend/vulkan/PipelineLayoutVk.h" #include "backend/vulkan/RenderPassCache.h" -#include "backend/vulkan/RenderPassInfoVk.h" +#include "backend/vulkan/RenderPassDescriptorVk.h" #include "backend/vulkan/ShaderModuleVk.h" #include "backend/vulkan/VulkanBackend.h" diff --git a/src/backend/vulkan/VulkanBackend.cpp b/src/backend/vulkan/VulkanBackend.cpp index e661f7bf67..49f0d87727 100644 --- a/src/backend/vulkan/VulkanBackend.cpp +++ b/src/backend/vulkan/VulkanBackend.cpp @@ -28,7 +28,7 @@ #include "backend/vulkan/NativeSwapChainImplVk.h" #include "backend/vulkan/PipelineLayoutVk.h" #include "backend/vulkan/RenderPassCache.h" -#include "backend/vulkan/RenderPassInfoVk.h" +#include "backend/vulkan/RenderPassDescriptorVk.h" #include "backend/vulkan/RenderPipelineVk.h" #include "backend/vulkan/SamplerVk.h" #include "backend/vulkan/ShaderModuleVk.h" @@ -246,8 +246,9 @@ namespace backend { namespace vulkan { QueueBase* Device::CreateQueue(QueueBuilder* builder) { return new Queue(builder); } - RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) { - return new RenderPassInfo(builder); + RenderPassDescriptorBase* Device::CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) { + return new RenderPassDescriptor(builder); } RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) { return new RenderPipeline(builder); diff --git a/src/backend/vulkan/VulkanBackend.h b/src/backend/vulkan/VulkanBackend.h index a6844bfdfe..c0daf1aaf0 100644 --- a/src/backend/vulkan/VulkanBackend.h +++ b/src/backend/vulkan/VulkanBackend.h @@ -42,7 +42,7 @@ namespace backend { namespace vulkan { class InputState; class PipelineLayout; class Queue; - class RenderPassInfo; + class RenderPassDescriptor; class RenderPipeline; class Sampler; class ShaderModule; @@ -69,7 +69,7 @@ namespace backend { namespace vulkan { using InputStateType = InputState; using PipelineLayoutType = PipelineLayout; using QueueType = Queue; - using RenderPassInfoType = RenderPassInfo; + using RenderPassDescriptorType = RenderPassDescriptor; using RenderPipelineType = RenderPipeline; using SamplerType = Sampler; using ShaderModuleType = ShaderModule; @@ -122,7 +122,8 @@ namespace backend { namespace vulkan { InputStateBase* CreateInputState(InputStateBuilder* builder) override; PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override; QueueBase* CreateQueue(QueueBuilder* builder) override; - RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override; + RenderPassDescriptorBase* CreateRenderPassDescriptor( + RenderPassDescriptorBuilder* builder) override; RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override; SamplerBase* CreateSampler(SamplerBuilder* builder) override; ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override; diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index ea448e7c1c..19ddae61cb 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -50,7 +50,7 @@ list(APPEND UNITTEST_SOURCES ${VALIDATION_TESTS_DIR}/DynamicStateCommandValidationTests.cpp ${VALIDATION_TESTS_DIR}/InputStateValidationTests.cpp ${VALIDATION_TESTS_DIR}/PushConstantsValidationTests.cpp - ${VALIDATION_TESTS_DIR}/RenderPassInfoValidationTests.cpp + ${VALIDATION_TESTS_DIR}/RenderPassDescriptorValidationTests.cpp ${VALIDATION_TESTS_DIR}/RenderPipelineValidationTests.cpp ${VALIDATION_TESTS_DIR}/UsageValidationTests.cpp ${VALIDATION_TESTS_DIR}/VertexBufferValidationTests.cpp diff --git a/src/tests/end2end/BlendStateTests.cpp b/src/tests/end2end/BlendStateTests.cpp index 12ef510c4b..1a7be71a2c 100644 --- a/src/tests/end2end/BlendStateTests.cpp +++ b/src/tests/end2end/BlendStateTests.cpp @@ -707,7 +707,7 @@ TEST_P(BlendStateTest, IndependentBlendState) { renderTargetViews[i] = renderTargets[i].CreateTextureViewBuilder().GetResult(); } - nxt::RenderPassInfo renderpass = device.CreateRenderPassInfoBuilder() + nxt::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetViews[0], nxt::LoadOp::Clear) .SetColorAttachment(1, renderTargetViews[1], nxt::LoadOp::Clear) .SetColorAttachment(2, renderTargetViews[2], nxt::LoadOp::Clear) diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index e7b798f43a..f236aed23e 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -46,7 +46,7 @@ class DepthStencilStateTest : public NXTTest { depthTextureView = depthTexture.CreateTextureViewBuilder().GetResult(); - renderpass = device.CreateRenderPassInfoBuilder() + renderpass = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear) .SetDepthStencilAttachment(depthTextureView, nxt::LoadOp::Clear, nxt::LoadOp::Clear) .GetResult(); @@ -247,7 +247,7 @@ class DepthStencilStateTest : public NXTTest { DoTest(testParams, expected, expected); } - nxt::RenderPassInfo renderpass; + nxt::RenderPassDescriptor renderpass; nxt::Texture renderTarget; nxt::Texture depthTexture; nxt::TextureView renderTargetView; diff --git a/src/tests/end2end/RenderPassLoadOpTests.cpp b/src/tests/end2end/RenderPassLoadOpTests.cpp index cf07f7c320..59c9ae5ad0 100644 --- a/src/tests/end2end/RenderPassLoadOpTests.cpp +++ b/src/tests/end2end/RenderPassLoadOpTests.cpp @@ -111,7 +111,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) { // Part 1: clear once, check to make sure it's cleared - auto renderPassClearZero = device.CreateRenderPassInfoBuilder() + auto renderPassClearZero = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear) .SetColorAttachmentClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f) .GetResult(); @@ -123,7 +123,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) { .EndRenderPass() .GetResult(); - auto renderPassClearGreen = device.CreateRenderPassInfoBuilder() + auto renderPassClearGreen = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear) .SetColorAttachmentClearColor(0, 0.0f, 1.0f, 0.0f, 1.0f) .GetResult(); @@ -143,7 +143,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) { // Part 2: draw a blue quad into the right half of the render target, and check result - auto renderPassLoad = device.CreateRenderPassInfoBuilder() + auto renderPassLoad = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, renderTargetView, nxt::LoadOp::Load) .GetResult(); diff --git a/src/tests/unittests/validation/RenderPassInfoValidationTests.cpp b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp similarity index 80% rename from src/tests/unittests/validation/RenderPassInfoValidationTests.cpp rename to src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp index 9138fd9c3b..11314f96c8 100644 --- a/src/tests/unittests/validation/RenderPassInfoValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp @@ -18,7 +18,7 @@ namespace { -class RenderPassInfoValidationTest : public ValidationTest { +class RenderPassDescriptorValidationTest : public ValidationTest { }; nxt::TextureView Create2DAttachment(nxt::Device& device, uint32_t width, uint32_t height, nxt::TextureFormat format) { @@ -36,42 +36,42 @@ nxt::TextureView Create2DAttachment(nxt::Device& device, uint32_t width, uint32_ } // A render pass with no attachments isn't valid -TEST_F(RenderPassInfoValidationTest, Empty) { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) +TEST_F(RenderPassDescriptorValidationTest, Empty) { + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .GetResult(); } // A render pass with only one color or one depth attachment is ok -TEST_F(RenderPassInfoValidationTest, OneAttachment) { +TEST_F(RenderPassDescriptorValidationTest, OneAttachment) { // One color attachment { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color, nxt::LoadOp::Clear) .GetResult(); } // One depth-stencil attachment { nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint); - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear) .GetResult(); } } // Test OOB color attachment indices are handled -TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) { +TEST_F(RenderPassDescriptorValidationTest, ColorAttachmentOutOfBounds) { // For setting the color attachment, control case { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(kMaxColorAttachments - 1, color, nxt::LoadOp::Clear) .GetResult(); } // For setting the color attachment, OOB { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(kMaxColorAttachments, color, nxt::LoadOp::Clear) .GetResult(); } @@ -79,14 +79,14 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); // For setting the clear color, control case { - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color, nxt::LoadOp::Clear) .SetColorAttachmentClearColor(kMaxColorAttachments - 1, 0.0f, 0.0f, 0.0f, 0.0f) .GetResult(); } // For setting the clear color, OOB { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color, nxt::LoadOp::Clear) .SetColorAttachmentClearColor(kMaxColorAttachments, 0.0f, 0.0f, 0.0f, 0.0f) .GetResult(); @@ -94,12 +94,12 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) { } // Test setting a clear value without an attachment and vice-versa is ok. -TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) { +TEST_F(RenderPassDescriptorValidationTest, ClearAndAttachmentMismatchIsOk) { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); // For cleared attachment 0 doesn't get a color, clear color for 1 is unused { - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color, nxt::LoadOp::Clear) .SetColorAttachmentClearColor(1, 0.0f, 0.0f, 0.0f, 0.0f) .GetResult(); @@ -107,13 +107,13 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) { // Clear depth stencil doesn't get values { nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint); - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear) .GetResult(); } // Clear values for depth-stencil when it isn't used { - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color, nxt::LoadOp::Clear) .SetDepthStencilAttachmentClearValue(0.0f, 0) .GetResult(); @@ -121,7 +121,7 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) { } // Attachments must have the same size -TEST_F(RenderPassInfoValidationTest, SizeMustMatch) { +TEST_F(RenderPassDescriptorValidationTest, SizeMustMatch) { nxt::TextureView color1x1A = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); nxt::TextureView color1x1B = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); nxt::TextureView color2x2 = Create2DAttachment(device, 2, 2, nxt::TextureFormat::R8G8B8A8Unorm); @@ -130,7 +130,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) { // Control case: all the same size (1x1) { - AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear) .SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear) .SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, nxt::LoadOp::Clear) @@ -139,7 +139,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) { // One of the color attachments has a different size { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear) .SetColorAttachment(1, color2x2, nxt::LoadOp::Clear) .SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, nxt::LoadOp::Clear) @@ -148,7 +148,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) { // The depth stencil attachment has a different size { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear) .SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear) .SetDepthStencilAttachment(depthStencil2x2, nxt::LoadOp::Clear, nxt::LoadOp::Clear) @@ -157,20 +157,20 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) { } // Attachments formats must match whether they are used for color or depth-stencil -TEST_F(RenderPassInfoValidationTest, FormatMismatch) { +TEST_F(RenderPassDescriptorValidationTest, FormatMismatch) { nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm); nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint); // Using depth-stencil for color { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, depthStencil, nxt::LoadOp::Clear) .GetResult(); } // Using color for depth-stencil { - AssertWillBeError(device.CreateRenderPassInfoBuilder()) + AssertWillBeError(device.CreateRenderPassDescriptorBuilder()) .SetDepthStencilAttachment(color, nxt::LoadOp::Clear, nxt::LoadOp::Clear) .GetResult(); } diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 4a88345971..5c14e0948b 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -54,7 +54,7 @@ class RenderPipelineValidationTest : public ValidationTest { return builder; } - nxt::RenderPassInfo renderpass; + nxt::RenderPassDescriptor renderpass; nxt::ShaderModule vsModule; nxt::ShaderModule fsModule; nxt::InputState inputState; diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp index 3c2a650162..07dab31425 100644 --- a/src/tests/unittests/validation/ValidationTest.cpp +++ b/src/tests/unittests/validation/ValidationTest.cpp @@ -69,7 +69,7 @@ bool ValidationTest::EndExpectDeviceError() { return mError; } -nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() { +nxt::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() { auto colorBuffer = device.CreateTextureBuilder() .SetDimension(nxt::TextureDimension::e2D) .SetExtent(640, 480, 1) @@ -81,7 +81,7 @@ nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() { auto colorView = colorBuffer.CreateTextureViewBuilder() .GetResult(); - return device.CreateRenderPassInfoBuilder() + return device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, colorView, nxt::LoadOp::Clear) .GetResult(); } @@ -130,7 +130,7 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() { nxt::TextureView view = AssertWillBeSuccess(dummy.attachment.CreateTextureViewBuilder()).GetResult(); - dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassInfoBuilder()) + dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder()) .SetColorAttachment(0, view, nxt::LoadOp::Clear) .GetResult(); diff --git a/src/tests/unittests/validation/ValidationTest.h b/src/tests/unittests/validation/ValidationTest.h index 708d4d265a..2984350b1b 100644 --- a/src/tests/unittests/validation/ValidationTest.h +++ b/src/tests/unittests/validation/ValidationTest.h @@ -48,12 +48,12 @@ class ValidationTest : public testing::Test { void StartExpectDeviceError(); bool EndExpectDeviceError(); - nxt::RenderPassInfo CreateSimpleRenderPass(); + nxt::RenderPassDescriptor CreateSimpleRenderPass(); // Helper functions to create objects to test validation. struct DummyRenderPass { - nxt::RenderPassInfo renderPass; + nxt::RenderPassDescriptor renderPass; nxt::Texture attachment; nxt::TextureFormat attachmentFormat; uint32_t width; diff --git a/src/tests/unittests/validation/VertexBufferValidationTests.cpp b/src/tests/unittests/validation/VertexBufferValidationTests.cpp index 90fdd21b5a..254783430a 100644 --- a/src/tests/unittests/validation/VertexBufferValidationTests.cpp +++ b/src/tests/unittests/validation/VertexBufferValidationTests.cpp @@ -86,7 +86,7 @@ class VertexBufferValidationTest : public ValidationTest { .GetResult(); } - nxt::RenderPassInfo renderpass; + nxt::RenderPassDescriptor renderpass; nxt::ShaderModule fsModule; }; diff --git a/src/utils/NXTHelpers.cpp b/src/utils/NXTHelpers.cpp index c195163c17..7edcc9af24 100644 --- a/src/utils/NXTHelpers.cpp +++ b/src/utils/NXTHelpers.cpp @@ -130,7 +130,7 @@ namespace utils { .GetResult(); nxt::TextureView colorView = result.color.CreateTextureViewBuilder().GetResult(); - result.renderPassInfo = device.CreateRenderPassInfoBuilder() + result.renderPassInfo = device.CreateRenderPassDescriptorBuilder() .SetColorAttachment(0, colorView, nxt::LoadOp::Clear) .GetResult(); diff --git a/src/utils/NXTHelpers.h b/src/utils/NXTHelpers.h index 351804ac59..e2a9bc704a 100644 --- a/src/utils/NXTHelpers.h +++ b/src/utils/NXTHelpers.h @@ -42,7 +42,7 @@ namespace utils { uint32_t height; nxt::Texture color; nxt::TextureFormat colorFormat; - nxt::RenderPassInfo renderPassInfo; + nxt::RenderPassDescriptor renderPassInfo; }; BasicRenderPass CreateBasicRenderPass(const nxt::Device& device, uint32_t width,