Rename RenderPassInfo to RenderPassDescriptor
This commit is contained in:
parent
6f7749cce9
commit
8d6b5d2337
|
@ -129,8 +129,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
static int f = 0;
|
static int f = 0;
|
||||||
f++;
|
f++;
|
||||||
|
|
|
@ -81,12 +81,12 @@ void frame() {
|
||||||
backbufferView = nxtTextureViewBuilderGetResult(builder);
|
backbufferView = nxtTextureViewBuilderGetResult(builder);
|
||||||
nxtTextureViewBuilderRelease(builder);
|
nxtTextureViewBuilderRelease(builder);
|
||||||
}
|
}
|
||||||
nxtRenderPassInfo renderpassInfo;
|
nxtRenderPassDescriptor renderpassInfo;
|
||||||
{
|
{
|
||||||
nxtRenderPassInfoBuilder builder = nxtDeviceCreateRenderPassInfoBuilder(device);
|
nxtRenderPassDescriptorBuilder builder = nxtDeviceCreateRenderPassDescriptorBuilder(device);
|
||||||
nxtRenderPassInfoBuilderSetColorAttachment(builder, 0, backbufferView, NXT_LOAD_OP_CLEAR);
|
nxtRenderPassDescriptorBuilderSetColorAttachment(builder, 0, backbufferView, NXT_LOAD_OP_CLEAR);
|
||||||
renderpassInfo = nxtRenderPassInfoBuilderGetResult(builder);
|
renderpassInfo = nxtRenderPassDescriptorBuilderGetResult(builder);
|
||||||
nxtRenderPassInfoBuilderRelease(builder);
|
nxtRenderPassDescriptorBuilderRelease(builder);
|
||||||
}
|
}
|
||||||
nxtCommandBuffer commands;
|
nxtCommandBuffer commands;
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ void frame() {
|
||||||
nxtCommandBufferRelease(commands);
|
nxtCommandBufferRelease(commands);
|
||||||
nxtTextureTransitionUsage(backbuffer, NXT_TEXTURE_USAGE_BIT_PRESENT);
|
nxtTextureTransitionUsage(backbuffer, NXT_TEXTURE_USAGE_BIT_PRESENT);
|
||||||
nxtSwapChainPresent(swapchain, backbuffer);
|
nxtSwapChainPresent(swapchain, backbuffer);
|
||||||
nxtRenderPassInfoRelease(renderpassInfo);
|
nxtRenderPassDescriptorRelease(renderpassInfo);
|
||||||
nxtTextureViewRelease(backbufferView);
|
nxtTextureViewRelease(backbufferView);
|
||||||
|
|
||||||
DoFlush();
|
DoFlush();
|
||||||
|
|
|
@ -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};
|
static const uint32_t zeroOffsets[1] = {0};
|
||||||
auto& bufferSrc = particleBuffers[i];
|
auto& bufferSrc = particleBuffers[i];
|
||||||
auto& bufferDst = particleBuffers[(i + 1) % 2];
|
auto& bufferDst = particleBuffers[(i + 1) % 2];
|
||||||
|
@ -298,8 +298,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
nxt::CommandBuffer commandBuffer = createCommandBuffer(renderPass, pingpong);
|
nxt::CommandBuffer commandBuffer = createCommandBuffer(renderPass, pingpong);
|
||||||
queue.Submit(1, &commandBuffer);
|
queue.Submit(1, &commandBuffer);
|
||||||
|
|
|
@ -132,8 +132,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
.TransitionBufferUsage(buffer, nxt::BufferUsageBit::Storage)
|
.TransitionBufferUsage(buffer, nxt::BufferUsageBit::Storage)
|
||||||
|
|
|
@ -278,8 +278,8 @@ void frame() {
|
||||||
cameraBuffer.SetSubData(0, sizeof(CameraData), reinterpret_cast<uint8_t*>(&cameraData));
|
cameraBuffer.SetSubData(0, sizeof(CameraData), reinterpret_cast<uint8_t*>(&cameraData));
|
||||||
|
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
.BeginRenderPass(renderPass)
|
.BeginRenderPass(renderPass)
|
||||||
|
|
|
@ -87,8 +87,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
static const uint32_t vertexBufferOffsets[1] = {0};
|
static const uint32_t vertexBufferOffsets[1] = {0};
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
|
|
|
@ -92,8 +92,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
static const uint32_t vertexBufferOffsets[1] = {0};
|
static const uint32_t vertexBufferOffsets[1] = {0};
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
|
|
|
@ -149,8 +149,8 @@ void frame() {
|
||||||
if (s.b >= 1.0f) {s.b = 0.0f;}
|
if (s.b >= 1.0f) {s.b = 0.0f;}
|
||||||
|
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
static const uint32_t vertexBufferOffsets[1] = {0};
|
static const uint32_t vertexBufferOffsets[1] = {0};
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
|
|
|
@ -98,8 +98,8 @@ void frame() {
|
||||||
buffer.SetSubData(0, sizeof(s), reinterpret_cast<uint8_t*>(&s));
|
buffer.SetSubData(0, sizeof(s), reinterpret_cast<uint8_t*>(&s));
|
||||||
|
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
.BeginRenderPass(renderPass)
|
.BeginRenderPass(renderPass)
|
||||||
|
|
|
@ -81,8 +81,8 @@ void init() {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
static const uint32_t vertexBufferOffsets[1] = {0};
|
static const uint32_t vertexBufferOffsets[1] = {0};
|
||||||
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
nxt::CommandBuffer commands = device.CreateCommandBufferBuilder()
|
||||||
|
|
|
@ -166,11 +166,11 @@ void frame() {
|
||||||
nxt::Texture backbuffer = swapchain.GetNextTexture();
|
nxt::Texture backbuffer = swapchain.GetNextTexture();
|
||||||
auto backbufferView = backbuffer.CreateTextureViewBuilder().GetResult();
|
auto backbufferView = backbuffer.CreateTextureViewBuilder().GetResult();
|
||||||
|
|
||||||
nxt::RenderPassInfo renderPass1 = device.CreateRenderPassInfoBuilder()
|
nxt::RenderPassDescriptor renderPass1 = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
nxt::RenderPassInfo renderPass2 = device.CreateRenderPassInfoBuilder()
|
nxt::RenderPassDescriptor renderPass2 = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
|
|
|
@ -147,14 +147,14 @@ nxt::TextureView CreateDefaultDepthStencilView(const nxt::Device& device) {
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetNextRenderPassInfo(const nxt::Device& device,
|
void GetNextRenderPassDescriptor(const nxt::Device& device,
|
||||||
const nxt::SwapChain& swapchain,
|
const nxt::SwapChain& swapchain,
|
||||||
const nxt::TextureView& depthStencilView,
|
const nxt::TextureView& depthStencilView,
|
||||||
nxt::Texture* backbuffer,
|
nxt::Texture* backbuffer,
|
||||||
nxt::RenderPassInfo* info) {
|
nxt::RenderPassDescriptor* info) {
|
||||||
*backbuffer = swapchain.GetNextTexture();
|
*backbuffer = swapchain.GetNextTexture();
|
||||||
auto backbufferView = backbuffer->CreateTextureViewBuilder().GetResult();
|
auto backbufferView = backbuffer->CreateTextureViewBuilder().GetResult();
|
||||||
*info = device.CreateRenderPassInfoBuilder()
|
*info = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, backbufferView, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthStencilView, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
.SetDepthStencilAttachment(depthStencilView, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
|
@ -27,8 +27,8 @@ uint64_t GetSwapChainImplementation();
|
||||||
nxt::TextureFormat GetPreferredSwapChainTextureFormat();
|
nxt::TextureFormat GetPreferredSwapChainTextureFormat();
|
||||||
nxt::SwapChain GetSwapChain(const nxt::Device& device);
|
nxt::SwapChain GetSwapChain(const nxt::Device& device);
|
||||||
nxt::TextureView CreateDefaultDepthStencilView(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::SwapChain& swapchain,
|
||||||
const nxt::TextureView& depthStencilView,
|
const nxt::TextureView& depthStencilView,
|
||||||
nxt::Texture* backbuffer,
|
nxt::Texture* backbuffer,
|
||||||
nxt::RenderPassInfo* info);
|
nxt::RenderPassDescriptor* info);
|
||||||
|
|
|
@ -584,8 +584,8 @@ namespace {
|
||||||
|
|
||||||
void frame() {
|
void frame() {
|
||||||
nxt::Texture backbuffer;
|
nxt::Texture backbuffer;
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
GetNextRenderPassInfo(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
GetNextRenderPassDescriptor(device, swapchain, depthStencilView, &backbuffer, &renderPass);
|
||||||
|
|
||||||
const auto& defaultSceneNodes = scene.scenes.at(scene.defaultScene);
|
const auto& defaultSceneNodes = scene.scenes.at(scene.defaultScene);
|
||||||
nxt::CommandBufferBuilder cmd = device.CreateCommandBufferBuilder()
|
nxt::CommandBufferBuilder cmd = device.CreateCommandBufferBuilder()
|
||||||
|
|
12
next.json
12
next.json
|
@ -345,7 +345,7 @@
|
||||||
{
|
{
|
||||||
"name": "begin render pass",
|
"name": "begin render pass",
|
||||||
"args": [
|
"args": [
|
||||||
{"name": "info", "type": "render pass info"}
|
{"name": "info", "type": "render pass descriptor"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -592,8 +592,8 @@
|
||||||
"returns": "depth stencil state builder"
|
"returns": "depth stencil state builder"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "create render pass info builder",
|
"name": "create render pass descriptor builder",
|
||||||
"returns": "render pass info builder"
|
"returns": "render pass descriptor builder"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "create input state builder",
|
"name": "create input state builder",
|
||||||
|
@ -814,12 +814,12 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"render pass info builder": {
|
"render pass descriptor builder": {
|
||||||
"category": "object",
|
"category": "object",
|
||||||
"methods": [
|
"methods": [
|
||||||
{
|
{
|
||||||
"name": "get result",
|
"name": "get result",
|
||||||
"returns": "render pass info"
|
"returns": "render pass descriptor"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "set color attachment",
|
"name": "set color attachment",
|
||||||
|
@ -858,7 +858,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"render pass info": {
|
"render pass descriptor": {
|
||||||
"category": "object"
|
"category": "object"
|
||||||
},
|
},
|
||||||
"render pipeline": {
|
"render pipeline": {
|
||||||
|
|
|
@ -249,8 +249,8 @@ if (NXT_ENABLE_D3D12)
|
||||||
${D3D12_DIR}/PipelineLayoutD3D12.h
|
${D3D12_DIR}/PipelineLayoutD3D12.h
|
||||||
${D3D12_DIR}/QueueD3D12.cpp
|
${D3D12_DIR}/QueueD3D12.cpp
|
||||||
${D3D12_DIR}/QueueD3D12.h
|
${D3D12_DIR}/QueueD3D12.h
|
||||||
${D3D12_DIR}/RenderPassInfoD3D12.cpp
|
${D3D12_DIR}/RenderPassDescriptorD3D12.cpp
|
||||||
${D3D12_DIR}/RenderPassInfoD3D12.h
|
${D3D12_DIR}/RenderPassDescriptorD3D12.h
|
||||||
${D3D12_DIR}/RenderPipelineD3D12.cpp
|
${D3D12_DIR}/RenderPipelineD3D12.cpp
|
||||||
${D3D12_DIR}/RenderPipelineD3D12.h
|
${D3D12_DIR}/RenderPipelineD3D12.h
|
||||||
${D3D12_DIR}/ResourceAllocator.cpp
|
${D3D12_DIR}/ResourceAllocator.cpp
|
||||||
|
@ -318,8 +318,8 @@ if (NXT_ENABLE_VULKAN)
|
||||||
${VULKAN_DIR}/PipelineLayoutVk.h
|
${VULKAN_DIR}/PipelineLayoutVk.h
|
||||||
${VULKAN_DIR}/RenderPassCache.cpp
|
${VULKAN_DIR}/RenderPassCache.cpp
|
||||||
${VULKAN_DIR}/RenderPassCache.h
|
${VULKAN_DIR}/RenderPassCache.h
|
||||||
${VULKAN_DIR}/RenderPassInfoVk.cpp
|
${VULKAN_DIR}/RenderPassDescriptorVk.cpp
|
||||||
${VULKAN_DIR}/RenderPassInfoVk.h
|
${VULKAN_DIR}/RenderPassDescriptorVk.h
|
||||||
${VULKAN_DIR}/RenderPipelineVk.cpp
|
${VULKAN_DIR}/RenderPipelineVk.cpp
|
||||||
${VULKAN_DIR}/RenderPipelineVk.h
|
${VULKAN_DIR}/RenderPipelineVk.h
|
||||||
${VULKAN_DIR}/SamplerVk.cpp
|
${VULKAN_DIR}/SamplerVk.cpp
|
||||||
|
@ -379,8 +379,8 @@ list(APPEND BACKEND_SOURCES
|
||||||
${BACKEND_DIR}/PipelineLayout.h
|
${BACKEND_DIR}/PipelineLayout.h
|
||||||
${BACKEND_DIR}/Queue.cpp
|
${BACKEND_DIR}/Queue.cpp
|
||||||
${BACKEND_DIR}/Queue.h
|
${BACKEND_DIR}/Queue.h
|
||||||
${BACKEND_DIR}/RenderPassInfo.cpp
|
${BACKEND_DIR}/RenderPassDescriptor.cpp
|
||||||
${BACKEND_DIR}/RenderPassInfo.h
|
${BACKEND_DIR}/RenderPassDescriptor.h
|
||||||
${BACKEND_DIR}/RefCounted.cpp
|
${BACKEND_DIR}/RefCounted.cpp
|
||||||
${BACKEND_DIR}/RefCounted.h
|
${BACKEND_DIR}/RefCounted.h
|
||||||
${BACKEND_DIR}/Sampler.cpp
|
${BACKEND_DIR}/Sampler.cpp
|
||||||
|
|
|
@ -368,7 +368,7 @@ namespace backend {
|
||||||
|
|
||||||
case Command::BeginRenderPass: {
|
case Command::BeginRenderPass: {
|
||||||
BeginRenderPassCmd* cmd = mIterator.NextCommand<BeginRenderPassCmd>();
|
BeginRenderPassCmd* cmd = mIterator.NextCommand<BeginRenderPassCmd>();
|
||||||
RenderPassInfoBase* info = cmd->info.Get();
|
RenderPassDescriptorBase* info = cmd->info.Get();
|
||||||
if (!mState->BeginRenderPass(info)) {
|
if (!mState->BeginRenderPass(info)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -578,7 +578,7 @@ namespace backend {
|
||||||
mAllocator.Allocate<BeginComputePassCmd>(Command::BeginComputePass);
|
mAllocator.Allocate<BeginComputePassCmd>(Command::BeginComputePass);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandBufferBuilder::BeginRenderPass(RenderPassInfoBase* info) {
|
void CommandBufferBuilder::BeginRenderPass(RenderPassDescriptorBase* info) {
|
||||||
BeginRenderPassCmd* cmd = mAllocator.Allocate<BeginRenderPassCmd>(Command::BeginRenderPass);
|
BeginRenderPassCmd* cmd = mAllocator.Allocate<BeginRenderPassCmd>(Command::BeginRenderPass);
|
||||||
new (cmd) BeginRenderPassCmd;
|
new (cmd) BeginRenderPassCmd;
|
||||||
cmd->info = info;
|
cmd->info = info;
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace backend {
|
||||||
|
|
||||||
// NXT API
|
// NXT API
|
||||||
void BeginComputePass();
|
void BeginComputePass();
|
||||||
void BeginRenderPass(RenderPassInfoBase* info);
|
void BeginRenderPass(RenderPassDescriptorBase* info);
|
||||||
void CopyBufferToBuffer(BufferBase* source,
|
void CopyBufferToBuffer(BufferBase* source,
|
||||||
uint32_t sourceOffset,
|
uint32_t sourceOffset,
|
||||||
BufferBase* destination,
|
BufferBase* destination,
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "backend/Forward.h"
|
#include "backend/Forward.h"
|
||||||
#include "backend/InputState.h"
|
#include "backend/InputState.h"
|
||||||
#include "backend/PipelineLayout.h"
|
#include "backend/PipelineLayout.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/RenderPipeline.h"
|
#include "backend/RenderPipeline.h"
|
||||||
#include "backend/Texture.h"
|
#include "backend/Texture.h"
|
||||||
#include "common/Assert.h"
|
#include "common/Assert.h"
|
||||||
|
@ -166,7 +166,7 @@ namespace backend {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandBufferStateTracker::BeginRenderPass(RenderPassInfoBase* info) {
|
bool CommandBufferStateTracker::BeginRenderPass(RenderPassDescriptorBase* info) {
|
||||||
if (mAspects[VALIDATION_ASPECT_COMPUTE_PASS]) {
|
if (mAspects[VALIDATION_ASPECT_COMPUTE_PASS]) {
|
||||||
mBuilder->HandleError("Cannot begin a render pass while a compute pass is active");
|
mBuilder->HandleError("Cannot begin a render pass while a compute pass is active");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace backend {
|
||||||
// State-modifying methods
|
// State-modifying methods
|
||||||
bool BeginComputePass();
|
bool BeginComputePass();
|
||||||
bool EndComputePass();
|
bool EndComputePass();
|
||||||
bool BeginRenderPass(RenderPassInfoBase* info);
|
bool BeginRenderPass(RenderPassDescriptorBase* info);
|
||||||
bool EndRenderPass();
|
bool EndRenderPass();
|
||||||
bool SetComputePipeline(ComputePipelineBase* pipeline);
|
bool SetComputePipeline(ComputePipelineBase* pipeline);
|
||||||
bool SetRenderPipeline(RenderPipelineBase* pipeline);
|
bool SetRenderPipeline(RenderPipelineBase* pipeline);
|
||||||
|
@ -106,7 +106,7 @@ namespace backend {
|
||||||
std::map<BufferBase*, nxt::BufferUsageBit> mMostRecentBufferUsages;
|
std::map<BufferBase*, nxt::BufferUsageBit> mMostRecentBufferUsages;
|
||||||
std::map<TextureBase*, nxt::TextureUsageBit> mMostRecentTextureUsages;
|
std::map<TextureBase*, nxt::TextureUsageBit> mMostRecentTextureUsages;
|
||||||
|
|
||||||
RenderPassInfoBase* mCurrentRenderPass = nullptr;
|
RenderPassDescriptorBase* mCurrentRenderPass = nullptr;
|
||||||
};
|
};
|
||||||
} // namespace backend
|
} // namespace backend
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#ifndef BACKEND_COMMANDS_H_
|
#ifndef BACKEND_COMMANDS_H_
|
||||||
#define BACKEND_COMMANDS_H_
|
#define BACKEND_COMMANDS_H_
|
||||||
|
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/Texture.h"
|
#include "backend/Texture.h"
|
||||||
|
|
||||||
#include "nxt/nxtcpp.h"
|
#include "nxt/nxtcpp.h"
|
||||||
|
@ -53,7 +53,7 @@ namespace backend {
|
||||||
struct BeginComputePassCmd {};
|
struct BeginComputePassCmd {};
|
||||||
|
|
||||||
struct BeginRenderPassCmd {
|
struct BeginRenderPassCmd {
|
||||||
Ref<RenderPassInfoBase> info;
|
Ref<RenderPassDescriptorBase> info;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BufferCopyLocation {
|
struct BufferCopyLocation {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "backend/InputState.h"
|
#include "backend/InputState.h"
|
||||||
#include "backend/PipelineLayout.h"
|
#include "backend/PipelineLayout.h"
|
||||||
#include "backend/Queue.h"
|
#include "backend/Queue.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/RenderPipeline.h"
|
#include "backend/RenderPipeline.h"
|
||||||
#include "backend/Sampler.h"
|
#include "backend/Sampler.h"
|
||||||
#include "backend/ShaderModule.h"
|
#include "backend/ShaderModule.h"
|
||||||
|
@ -124,8 +124,8 @@ namespace backend {
|
||||||
QueueBuilder* DeviceBase::CreateQueueBuilder() {
|
QueueBuilder* DeviceBase::CreateQueueBuilder() {
|
||||||
return new QueueBuilder(this);
|
return new QueueBuilder(this);
|
||||||
}
|
}
|
||||||
RenderPassInfoBuilder* DeviceBase::CreateRenderPassInfoBuilder() {
|
RenderPassDescriptorBuilder* DeviceBase::CreateRenderPassDescriptorBuilder() {
|
||||||
return new RenderPassInfoBuilder(this);
|
return new RenderPassDescriptorBuilder(this);
|
||||||
}
|
}
|
||||||
RenderPipelineBuilder* DeviceBase::CreateRenderPipelineBuilder() {
|
RenderPipelineBuilder* DeviceBase::CreateRenderPipelineBuilder() {
|
||||||
return new RenderPipelineBuilder(this);
|
return new RenderPipelineBuilder(this);
|
||||||
|
|
|
@ -46,7 +46,8 @@ namespace backend {
|
||||||
virtual InputStateBase* CreateInputState(InputStateBuilder* builder) = 0;
|
virtual InputStateBase* CreateInputState(InputStateBuilder* builder) = 0;
|
||||||
virtual PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) = 0;
|
virtual PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) = 0;
|
||||||
virtual QueueBase* CreateQueue(QueueBuilder* 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 RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) = 0;
|
||||||
virtual SamplerBase* CreateSampler(SamplerBuilder* builder) = 0;
|
virtual SamplerBase* CreateSampler(SamplerBuilder* builder) = 0;
|
||||||
virtual ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) = 0;
|
virtual ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) = 0;
|
||||||
|
@ -85,7 +86,7 @@ namespace backend {
|
||||||
InputStateBuilder* CreateInputStateBuilder();
|
InputStateBuilder* CreateInputStateBuilder();
|
||||||
PipelineLayoutBuilder* CreatePipelineLayoutBuilder();
|
PipelineLayoutBuilder* CreatePipelineLayoutBuilder();
|
||||||
QueueBuilder* CreateQueueBuilder();
|
QueueBuilder* CreateQueueBuilder();
|
||||||
RenderPassInfoBuilder* CreateRenderPassInfoBuilder();
|
RenderPassDescriptorBuilder* CreateRenderPassDescriptorBuilder();
|
||||||
RenderPipelineBuilder* CreateRenderPipelineBuilder();
|
RenderPipelineBuilder* CreateRenderPipelineBuilder();
|
||||||
SamplerBuilder* CreateSamplerBuilder();
|
SamplerBuilder* CreateSamplerBuilder();
|
||||||
ShaderModuleBuilder* CreateShaderModuleBuilder();
|
ShaderModuleBuilder* CreateShaderModuleBuilder();
|
||||||
|
|
|
@ -41,8 +41,8 @@ namespace backend {
|
||||||
class PipelineLayoutBuilder;
|
class PipelineLayoutBuilder;
|
||||||
class QueueBase;
|
class QueueBase;
|
||||||
class QueueBuilder;
|
class QueueBuilder;
|
||||||
class RenderPassInfoBase;
|
class RenderPassDescriptorBase;
|
||||||
class RenderPassInfoBuilder;
|
class RenderPassDescriptorBuilder;
|
||||||
class RenderPipelineBase;
|
class RenderPipelineBase;
|
||||||
class RenderPipelineBuilder;
|
class RenderPipelineBuilder;
|
||||||
class SamplerBase;
|
class SamplerBase;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
|
|
||||||
#include "backend/Device.h"
|
#include "backend/Device.h"
|
||||||
#include "backend/Texture.h"
|
#include "backend/Texture.h"
|
||||||
|
@ -21,9 +21,9 @@
|
||||||
|
|
||||||
namespace backend {
|
namespace backend {
|
||||||
|
|
||||||
// RenderPassInfo
|
// RenderPassDescriptor
|
||||||
|
|
||||||
RenderPassInfoBase::RenderPassInfoBase(RenderPassInfoBuilder* builder)
|
RenderPassDescriptorBase::RenderPassDescriptorBase(RenderPassDescriptorBuilder* builder)
|
||||||
: mColorAttachmentsSet(builder->mColorAttachmentsSet),
|
: mColorAttachmentsSet(builder->mColorAttachmentsSet),
|
||||||
mColorAttachments(builder->mColorAttachments),
|
mColorAttachments(builder->mColorAttachments),
|
||||||
mDepthStencilAttachmentSet(builder->mDepthStencilAttachmentSet),
|
mDepthStencilAttachmentSet(builder->mDepthStencilAttachmentSet),
|
||||||
|
@ -32,15 +32,15 @@ namespace backend {
|
||||||
mHeight(builder->mHeight) {
|
mHeight(builder->mHeight) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::bitset<kMaxColorAttachments> RenderPassInfoBase::GetColorAttachmentMask() const {
|
std::bitset<kMaxColorAttachments> RenderPassDescriptorBase::GetColorAttachmentMask() const {
|
||||||
return mColorAttachmentsSet;
|
return mColorAttachmentsSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderPassInfoBase::HasDepthStencilAttachment() const {
|
bool RenderPassDescriptorBase::HasDepthStencilAttachment() const {
|
||||||
return mDepthStencilAttachmentSet;
|
return mDepthStencilAttachmentSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RenderPassColorAttachmentInfo& RenderPassInfoBase::GetColorAttachment(
|
const RenderPassColorAttachmentInfo& RenderPassDescriptorBase::GetColorAttachment(
|
||||||
uint32_t attachment) const {
|
uint32_t attachment) const {
|
||||||
ASSERT(attachment < kMaxColorAttachments);
|
ASSERT(attachment < kMaxColorAttachments);
|
||||||
ASSERT(mColorAttachmentsSet[attachment]);
|
ASSERT(mColorAttachmentsSet[attachment]);
|
||||||
|
@ -48,40 +48,41 @@ namespace backend {
|
||||||
return mColorAttachments[attachment];
|
return mColorAttachments[attachment];
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderPassColorAttachmentInfo& RenderPassInfoBase::GetColorAttachment(uint32_t attachment) {
|
RenderPassColorAttachmentInfo& RenderPassDescriptorBase::GetColorAttachment(
|
||||||
|
uint32_t attachment) {
|
||||||
ASSERT(attachment < kMaxColorAttachments);
|
ASSERT(attachment < kMaxColorAttachments);
|
||||||
ASSERT(mColorAttachmentsSet[attachment]);
|
ASSERT(mColorAttachmentsSet[attachment]);
|
||||||
|
|
||||||
return mColorAttachments[attachment];
|
return mColorAttachments[attachment];
|
||||||
}
|
}
|
||||||
|
|
||||||
const RenderPassDepthStencilAttachmentInfo& RenderPassInfoBase::GetDepthStencilAttachment()
|
const RenderPassDepthStencilAttachmentInfo&
|
||||||
const {
|
RenderPassDescriptorBase::GetDepthStencilAttachment() const {
|
||||||
ASSERT(mDepthStencilAttachmentSet);
|
ASSERT(mDepthStencilAttachmentSet);
|
||||||
|
|
||||||
return mDepthStencilAttachment;
|
return mDepthStencilAttachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderPassDepthStencilAttachmentInfo& RenderPassInfoBase::GetDepthStencilAttachment() {
|
RenderPassDepthStencilAttachmentInfo& RenderPassDescriptorBase::GetDepthStencilAttachment() {
|
||||||
ASSERT(mDepthStencilAttachmentSet);
|
ASSERT(mDepthStencilAttachmentSet);
|
||||||
|
|
||||||
return mDepthStencilAttachment;
|
return mDepthStencilAttachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RenderPassInfoBase::GetWidth() const {
|
uint32_t RenderPassDescriptorBase::GetWidth() const {
|
||||||
return mWidth;
|
return mWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RenderPassInfoBase::GetHeight() const {
|
uint32_t RenderPassDescriptorBase::GetHeight() const {
|
||||||
return mHeight;
|
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 {
|
auto CheckOrSetSize = [this](const TextureViewBase* attachment) -> bool {
|
||||||
if (this->mWidth == 0) {
|
if (this->mWidth == 0) {
|
||||||
ASSERT(this->mHeight == 0);
|
ASSERT(this->mHeight == 0);
|
||||||
|
@ -120,12 +121,12 @@ namespace backend {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDevice->CreateRenderPassInfo(this);
|
return mDevice->CreateRenderPassDescriptor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassInfoBuilder::SetColorAttachment(uint32_t attachment,
|
void RenderPassDescriptorBuilder::SetColorAttachment(uint32_t attachment,
|
||||||
TextureViewBase* textureView,
|
TextureViewBase* textureView,
|
||||||
nxt::LoadOp loadOp) {
|
nxt::LoadOp loadOp) {
|
||||||
if (attachment >= kMaxColorAttachments) {
|
if (attachment >= kMaxColorAttachments) {
|
||||||
HandleError("Setting color attachment out of bounds");
|
HandleError("Setting color attachment out of bounds");
|
||||||
return;
|
return;
|
||||||
|
@ -141,11 +142,11 @@ namespace backend {
|
||||||
mColorAttachments[attachment].view = textureView;
|
mColorAttachments[attachment].view = textureView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassInfoBuilder::SetColorAttachmentClearColor(uint32_t attachment,
|
void RenderPassDescriptorBuilder::SetColorAttachmentClearColor(uint32_t attachment,
|
||||||
float clearR,
|
float clearR,
|
||||||
float clearG,
|
float clearG,
|
||||||
float clearB,
|
float clearB,
|
||||||
float clearA) {
|
float clearA) {
|
||||||
if (attachment >= kMaxColorAttachments) {
|
if (attachment >= kMaxColorAttachments) {
|
||||||
HandleError("Setting color attachment out of bounds");
|
HandleError("Setting color attachment out of bounds");
|
||||||
return;
|
return;
|
||||||
|
@ -157,9 +158,9 @@ namespace backend {
|
||||||
mColorAttachments[attachment].clearColor[3] = clearA;
|
mColorAttachments[attachment].clearColor[3] = clearA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassInfoBuilder::SetDepthStencilAttachment(TextureViewBase* textureView,
|
void RenderPassDescriptorBuilder::SetDepthStencilAttachment(TextureViewBase* textureView,
|
||||||
nxt::LoadOp depthLoadOp,
|
nxt::LoadOp depthLoadOp,
|
||||||
nxt::LoadOp stencilLoadOp) {
|
nxt::LoadOp stencilLoadOp) {
|
||||||
if (!TextureFormatHasDepthOrStencil(textureView->GetTexture()->GetFormat())) {
|
if (!TextureFormatHasDepthOrStencil(textureView->GetTexture()->GetFormat())) {
|
||||||
HandleError("Using color texture as depth stencil attachment");
|
HandleError("Using color texture as depth stencil attachment");
|
||||||
return;
|
return;
|
||||||
|
@ -171,8 +172,8 @@ namespace backend {
|
||||||
mDepthStencilAttachment.view = textureView;
|
mDepthStencilAttachment.view = textureView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassInfoBuilder::SetDepthStencilAttachmentClearValue(float clearDepth,
|
void RenderPassDescriptorBuilder::SetDepthStencilAttachmentClearValue(float clearDepth,
|
||||||
uint32_t clearStencil) {
|
uint32_t clearStencil) {
|
||||||
mDepthStencilAttachment.clearDepth = clearDepth;
|
mDepthStencilAttachment.clearDepth = clearDepth;
|
||||||
mDepthStencilAttachment.clearStencil = clearStencil;
|
mDepthStencilAttachment.clearStencil = clearStencil;
|
||||||
}
|
}
|
|
@ -12,8 +12,8 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#ifndef BACKEND_RENDERPASSINFO_H_
|
#ifndef BACKEND_RENDERPASSDESCRIPTOR_H_
|
||||||
#define BACKEND_RENDERPASSINFO_H_
|
#define BACKEND_RENDERPASSDESCRIPTOR_H_
|
||||||
|
|
||||||
#include "backend/Builder.h"
|
#include "backend/Builder.h"
|
||||||
#include "backend/Forward.h"
|
#include "backend/Forward.h"
|
||||||
|
@ -42,12 +42,12 @@ namespace backend {
|
||||||
Ref<TextureViewBase> view;
|
Ref<TextureViewBase> view;
|
||||||
};
|
};
|
||||||
|
|
||||||
// RenderPassInfo contains the list of attachments for a renderpass along with data such as the
|
// RenderPassDescriptor contains the list of attachments for a renderpass along with data such
|
||||||
// load operation and the clear values for the attachments.
|
// as the load operation and the clear values for the attachments.
|
||||||
|
|
||||||
class RenderPassInfoBase : public RefCounted {
|
class RenderPassDescriptorBase : public RefCounted {
|
||||||
public:
|
public:
|
||||||
RenderPassInfoBase(RenderPassInfoBuilder* builder);
|
RenderPassDescriptorBase(RenderPassDescriptorBuilder* builder);
|
||||||
|
|
||||||
std::bitset<kMaxColorAttachments> GetColorAttachmentMask() const;
|
std::bitset<kMaxColorAttachments> GetColorAttachmentMask() const;
|
||||||
bool HasDepthStencilAttachment() const;
|
bool HasDepthStencilAttachment() const;
|
||||||
|
@ -72,12 +72,12 @@ namespace backend {
|
||||||
uint32_t mHeight;
|
uint32_t mHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RenderPassInfoBuilder : public Builder<RenderPassInfoBase> {
|
class RenderPassDescriptorBuilder : public Builder<RenderPassDescriptorBase> {
|
||||||
public:
|
public:
|
||||||
RenderPassInfoBuilder(DeviceBase* device);
|
RenderPassDescriptorBuilder(DeviceBase* device);
|
||||||
|
|
||||||
// NXT API
|
// NXT API
|
||||||
RenderPassInfoBase* GetResultImpl() override;
|
RenderPassDescriptorBase* GetResultImpl() override;
|
||||||
void SetColorAttachment(uint32_t attachment,
|
void SetColorAttachment(uint32_t attachment,
|
||||||
TextureViewBase* textureView,
|
TextureViewBase* textureView,
|
||||||
nxt::LoadOp loadOp);
|
nxt::LoadOp loadOp);
|
||||||
|
@ -92,7 +92,7 @@ namespace backend {
|
||||||
void SetDepthStencilAttachmentClearValue(float clearDepth, uint32_t clearStencil);
|
void SetDepthStencilAttachmentClearValue(float clearDepth, uint32_t clearStencil);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class RenderPassInfoBase;
|
friend class RenderPassDescriptorBase;
|
||||||
|
|
||||||
std::bitset<kMaxColorAttachments> mColorAttachmentsSet;
|
std::bitset<kMaxColorAttachments> mColorAttachmentsSet;
|
||||||
std::array<RenderPassColorAttachmentInfo, kMaxColorAttachments> mColorAttachments;
|
std::array<RenderPassColorAttachmentInfo, kMaxColorAttachments> mColorAttachments;
|
|
@ -18,7 +18,7 @@
|
||||||
#include "backend/DepthStencilState.h"
|
#include "backend/DepthStencilState.h"
|
||||||
#include "backend/Device.h"
|
#include "backend/Device.h"
|
||||||
#include "backend/InputState.h"
|
#include "backend/InputState.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/Texture.h"
|
#include "backend/Texture.h"
|
||||||
#include "common/BitSetIterator.h"
|
#include "common/BitSetIterator.h"
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ namespace backend {
|
||||||
return mDepthStencilFormat;
|
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
|
// 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
|
// example by caching some "attachment compatibility" object that would make the
|
||||||
// compatibility check a single pointer comparison.
|
// compatibility check a single pointer comparison.
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace backend {
|
||||||
|
|
||||||
// A pipeline can be used in a render pass if its attachment info matches the actual
|
// 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.
|
// 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:
|
private:
|
||||||
Ref<DepthStencilStateBase> mDepthStencilState;
|
Ref<DepthStencilStateBase> mDepthStencilState;
|
||||||
|
|
|
@ -84,8 +84,8 @@ namespace backend {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename BackendTraits>
|
template <typename BackendTraits>
|
||||||
struct ToBackendTraits<RenderPassInfoBase, BackendTraits> {
|
struct ToBackendTraits<RenderPassDescriptorBase, BackendTraits> {
|
||||||
using BackendType = typename BackendTraits::RenderPassInfoType;
|
using BackendType = typename BackendTraits::RenderPassDescriptorType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename BackendTraits>
|
template <typename BackendTraits>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "backend/d3d12/DescriptorHeapAllocator.h"
|
#include "backend/d3d12/DescriptorHeapAllocator.h"
|
||||||
#include "backend/d3d12/InputStateD3D12.h"
|
#include "backend/d3d12/InputStateD3D12.h"
|
||||||
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
||||||
#include "backend/d3d12/RenderPassInfoD3D12.h"
|
#include "backend/d3d12/RenderPassDescriptorD3D12.h"
|
||||||
#include "backend/d3d12/RenderPipelineD3D12.h"
|
#include "backend/d3d12/RenderPipelineD3D12.h"
|
||||||
#include "backend/d3d12/ResourceAllocator.h"
|
#include "backend/d3d12/ResourceAllocator.h"
|
||||||
#include "backend/d3d12/SamplerD3D12.h"
|
#include "backend/d3d12/SamplerD3D12.h"
|
||||||
|
@ -265,9 +265,9 @@ namespace backend { namespace d3d12 {
|
||||||
case Command::BeginRenderPass: {
|
case Command::BeginRenderPass: {
|
||||||
BeginRenderPassCmd* beginRenderPassCmd =
|
BeginRenderPassCmd* beginRenderPassCmd =
|
||||||
mCommands.NextCommand<BeginRenderPassCmd>();
|
mCommands.NextCommand<BeginRenderPassCmd>();
|
||||||
RenderPassInfo* info = ToBackend(beginRenderPassCmd->info.Get());
|
RenderPassDescriptor* info = ToBackend(beginRenderPassCmd->info.Get());
|
||||||
|
|
||||||
RenderPassInfo::OMSetRenderTargetArgs args =
|
RenderPassDescriptor::OMSetRenderTargetArgs args =
|
||||||
info->GetSubpassOMSetRenderTargetArgs();
|
info->GetSubpassOMSetRenderTargetArgs();
|
||||||
if (args.dsv.ptr) {
|
if (args.dsv.ptr) {
|
||||||
commandList->OMSetRenderTargets(args.numRTVs, args.RTVs.data(), FALSE,
|
commandList->OMSetRenderTargets(args.numRTVs, args.RTVs.data(), FALSE,
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "backend/d3d12/NativeSwapChainImplD3D12.h"
|
#include "backend/d3d12/NativeSwapChainImplD3D12.h"
|
||||||
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
||||||
#include "backend/d3d12/QueueD3D12.h"
|
#include "backend/d3d12/QueueD3D12.h"
|
||||||
#include "backend/d3d12/RenderPassInfoD3D12.h"
|
#include "backend/d3d12/RenderPassDescriptorD3D12.h"
|
||||||
#include "backend/d3d12/RenderPipelineD3D12.h"
|
#include "backend/d3d12/RenderPipelineD3D12.h"
|
||||||
#include "backend/d3d12/ResourceAllocator.h"
|
#include "backend/d3d12/ResourceAllocator.h"
|
||||||
#include "backend/d3d12/ResourceUploader.h"
|
#include "backend/d3d12/ResourceUploader.h"
|
||||||
|
@ -291,8 +291,9 @@ namespace backend { namespace d3d12 {
|
||||||
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
||||||
return new Queue(this, builder);
|
return new Queue(this, builder);
|
||||||
}
|
}
|
||||||
RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) {
|
RenderPassDescriptorBase* Device::CreateRenderPassDescriptor(
|
||||||
return new RenderPassInfo(this, builder);
|
RenderPassDescriptorBuilder* builder) {
|
||||||
|
return new RenderPassDescriptor(this, builder);
|
||||||
}
|
}
|
||||||
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
||||||
return new RenderPipeline(builder);
|
return new RenderPipeline(builder);
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace backend { namespace d3d12 {
|
||||||
class InputState;
|
class InputState;
|
||||||
class PipelineLayout;
|
class PipelineLayout;
|
||||||
class Queue;
|
class Queue;
|
||||||
class RenderPassInfo;
|
class RenderPassDescriptor;
|
||||||
class RenderPipeline;
|
class RenderPipeline;
|
||||||
class Sampler;
|
class Sampler;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
|
@ -64,7 +64,7 @@ namespace backend { namespace d3d12 {
|
||||||
using InputStateType = InputState;
|
using InputStateType = InputState;
|
||||||
using PipelineLayoutType = PipelineLayout;
|
using PipelineLayoutType = PipelineLayout;
|
||||||
using QueueType = Queue;
|
using QueueType = Queue;
|
||||||
using RenderPassInfoType = RenderPassInfo;
|
using RenderPassDescriptorType = RenderPassDescriptor;
|
||||||
using RenderPipelineType = RenderPipeline;
|
using RenderPipelineType = RenderPipeline;
|
||||||
using SamplerType = Sampler;
|
using SamplerType = Sampler;
|
||||||
using ShaderModuleType = ShaderModule;
|
using ShaderModuleType = ShaderModule;
|
||||||
|
@ -97,7 +97,8 @@ namespace backend { namespace d3d12 {
|
||||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||||
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
||||||
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
||||||
RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override;
|
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||||
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
||||||
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "backend/d3d12/InputStateD3D12.h"
|
#include "backend/d3d12/InputStateD3D12.h"
|
||||||
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
#include "backend/d3d12/PipelineLayoutD3D12.h"
|
||||||
#include "backend/d3d12/QueueD3D12.h"
|
#include "backend/d3d12/QueueD3D12.h"
|
||||||
#include "backend/d3d12/RenderPassInfoD3D12.h"
|
#include "backend/d3d12/RenderPassDescriptorD3D12.h"
|
||||||
#include "backend/d3d12/RenderPipelineD3D12.h"
|
#include "backend/d3d12/RenderPipelineD3D12.h"
|
||||||
#include "backend/d3d12/SamplerD3D12.h"
|
#include "backend/d3d12/SamplerD3D12.h"
|
||||||
#include "backend/d3d12/ShaderModuleD3D12.h"
|
#include "backend/d3d12/ShaderModuleD3D12.h"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "backend/d3d12/RenderPassInfoD3D12.h"
|
#include "backend/d3d12/RenderPassDescriptorD3D12.h"
|
||||||
|
|
||||||
#include "backend/d3d12/D3D12Backend.h"
|
#include "backend/d3d12/D3D12Backend.h"
|
||||||
#include "backend/d3d12/TextureD3D12.h"
|
#include "backend/d3d12/TextureD3D12.h"
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
|
|
||||||
namespace backend { namespace d3d12 {
|
namespace backend { namespace d3d12 {
|
||||||
|
|
||||||
RenderPassInfo::RenderPassInfo(Device* device, RenderPassInfoBuilder* builder)
|
RenderPassDescriptor::RenderPassDescriptor(Device* device, RenderPassDescriptorBuilder* builder)
|
||||||
: RenderPassInfoBase(builder), mDevice(device) {
|
: RenderPassDescriptorBase(builder), mDevice(device) {
|
||||||
// Get and fill an RTV heap with the color attachments
|
// Get and fill an RTV heap with the color attachments
|
||||||
uint32_t colorAttachmentCount = static_cast<uint32_t>(GetColorAttachmentMask().count());
|
uint32_t colorAttachmentCount = static_cast<uint32_t>(GetColorAttachmentMask().count());
|
||||||
if (colorAttachmentCount != 0) {
|
if (colorAttachmentCount != 0) {
|
||||||
|
@ -53,7 +53,8 @@ namespace backend { namespace d3d12 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderPassInfo::OMSetRenderTargetArgs RenderPassInfo::GetSubpassOMSetRenderTargetArgs() {
|
RenderPassDescriptor::OMSetRenderTargetArgs
|
||||||
|
RenderPassDescriptor::GetSubpassOMSetRenderTargetArgs() {
|
||||||
OMSetRenderTargetArgs args = {};
|
OMSetRenderTargetArgs args = {};
|
||||||
|
|
||||||
size_t rtvIndex = 0;
|
size_t rtvIndex = 0;
|
||||||
|
@ -70,11 +71,11 @@ namespace backend { namespace d3d12 {
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE RenderPassInfo::GetRTVDescriptor(uint32_t attachmentSlot) {
|
D3D12_CPU_DESCRIPTOR_HANDLE RenderPassDescriptor::GetRTVDescriptor(uint32_t attachmentSlot) {
|
||||||
return mRtvHeap.GetCPUHandle(attachmentSlot);
|
return mRtvHeap.GetCPUHandle(attachmentSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE RenderPassInfo::GetDSVDescriptor() {
|
D3D12_CPU_DESCRIPTOR_HANDLE RenderPassDescriptor::GetDSVDescriptor() {
|
||||||
return mDsvHeap.GetCPUHandle(0);
|
return mDsvHeap.GetCPUHandle(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#ifndef BACKEND_D3D12_RENDERPASSINFOD3D12_H_
|
#ifndef BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_
|
||||||
#define BACKEND_D3D12_RENDERPASSINFOD3D12_H_
|
#define BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_
|
||||||
|
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
|
|
||||||
#include "backend/d3d12/DescriptorHeapAllocator.h"
|
#include "backend/d3d12/DescriptorHeapAllocator.h"
|
||||||
#include "backend/d3d12/d3d12_platform.h"
|
#include "backend/d3d12/d3d12_platform.h"
|
||||||
|
@ -28,7 +28,7 @@ namespace backend { namespace d3d12 {
|
||||||
|
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
class RenderPassInfo : public RenderPassInfoBase {
|
class RenderPassDescriptor : public RenderPassDescriptorBase {
|
||||||
public:
|
public:
|
||||||
struct OMSetRenderTargetArgs {
|
struct OMSetRenderTargetArgs {
|
||||||
unsigned int numRTVs = 0;
|
unsigned int numRTVs = 0;
|
||||||
|
@ -36,7 +36,7 @@ namespace backend { namespace d3d12 {
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE dsv = {};
|
D3D12_CPU_DESCRIPTOR_HANDLE dsv = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
RenderPassInfo(Device* device, RenderPassInfoBuilder* builder);
|
RenderPassDescriptor(Device* device, RenderPassDescriptorBuilder* builder);
|
||||||
OMSetRenderTargetArgs GetSubpassOMSetRenderTargetArgs();
|
OMSetRenderTargetArgs GetSubpassOMSetRenderTargetArgs();
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE GetRTVDescriptor(uint32_t attachmentSlot);
|
D3D12_CPU_DESCRIPTOR_HANDLE GetRTVDescriptor(uint32_t attachmentSlot);
|
||||||
D3D12_CPU_DESCRIPTOR_HANDLE GetDSVDescriptor();
|
D3D12_CPU_DESCRIPTOR_HANDLE GetDSVDescriptor();
|
||||||
|
@ -49,4 +49,4 @@ namespace backend { namespace d3d12 {
|
||||||
|
|
||||||
}} // namespace backend::d3d12
|
}} // namespace backend::d3d12
|
||||||
|
|
||||||
#endif // BACKEND_D3D12_RENDERPASSINFOD3D12_H_
|
#endif // BACKEND_D3D12_RENDERPASSDESCRIPTORD3D12_H_
|
|
@ -64,7 +64,7 @@ namespace backend { namespace metal {
|
||||||
compute = nil; // This will be autoreleased.
|
compute = nil; // This will be autoreleased.
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeginRenderPass(id<MTLCommandBuffer> commandBuffer, RenderPassInfo* info) {
|
void BeginRenderPass(id<MTLCommandBuffer> commandBuffer, RenderPassDescriptor* info) {
|
||||||
if (render != nil) {
|
if (render != nil) {
|
||||||
[render endEncoding];
|
[render endEncoding];
|
||||||
render = nil; // This will be autoreleased.
|
render = nil; // This will be autoreleased.
|
||||||
|
@ -172,7 +172,7 @@ namespace backend { namespace metal {
|
||||||
BeginRenderPassCmd* beginRenderPassCmd =
|
BeginRenderPassCmd* beginRenderPassCmd =
|
||||||
mCommands.NextCommand<BeginRenderPassCmd>();
|
mCommands.NextCommand<BeginRenderPassCmd>();
|
||||||
|
|
||||||
RenderPassInfo* info = ToBackend(beginRenderPassCmd->info.Get());
|
RenderPassDescriptor* info = ToBackend(beginRenderPassCmd->info.Get());
|
||||||
|
|
||||||
encoders.EnsureNoBlitEncoder();
|
encoders.EnsureNoBlitEncoder();
|
||||||
encoders.BeginRenderPass(commandBuffer, info);
|
encoders.BeginRenderPass(commandBuffer, info);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "backend/BindGroupLayout.h"
|
#include "backend/BindGroupLayout.h"
|
||||||
#include "backend/Device.h"
|
#include "backend/Device.h"
|
||||||
#include "backend/Queue.h"
|
#include "backend/Queue.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/ToBackend.h"
|
#include "backend/ToBackend.h"
|
||||||
#include "common/Serial.h"
|
#include "common/Serial.h"
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ namespace backend { namespace metal {
|
||||||
class InputState;
|
class InputState;
|
||||||
class PipelineLayout;
|
class PipelineLayout;
|
||||||
class Queue;
|
class Queue;
|
||||||
class RenderPassInfo;
|
class RenderPassDescriptor;
|
||||||
class RenderPipeline;
|
class RenderPipeline;
|
||||||
class Sampler;
|
class Sampler;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
|
@ -65,7 +65,7 @@ namespace backend { namespace metal {
|
||||||
using InputStateType = InputState;
|
using InputStateType = InputState;
|
||||||
using PipelineLayoutType = PipelineLayout;
|
using PipelineLayoutType = PipelineLayout;
|
||||||
using QueueType = Queue;
|
using QueueType = Queue;
|
||||||
using RenderPassInfoType = RenderPassInfo;
|
using RenderPassDescriptorType = RenderPassDescriptor;
|
||||||
using RenderPipelineType = RenderPipeline;
|
using RenderPipelineType = RenderPipeline;
|
||||||
using SamplerType = Sampler;
|
using SamplerType = Sampler;
|
||||||
using ShaderModuleType = ShaderModule;
|
using ShaderModuleType = ShaderModule;
|
||||||
|
@ -98,7 +98,8 @@ namespace backend { namespace metal {
|
||||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||||
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
||||||
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
||||||
RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override;
|
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||||
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
||||||
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
||||||
|
@ -154,10 +155,10 @@ namespace backend { namespace metal {
|
||||||
id<MTLCommandQueue> mCommandQueue = nil;
|
id<MTLCommandQueue> mCommandQueue = nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RenderPassInfo : public RenderPassInfoBase {
|
class RenderPassDescriptor : public RenderPassDescriptorBase {
|
||||||
public:
|
public:
|
||||||
RenderPassInfo(RenderPassInfoBuilder* builder);
|
RenderPassDescriptor(RenderPassDescriptorBuilder* builder);
|
||||||
~RenderPassInfo();
|
~RenderPassDescriptor();
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace backend::metal
|
}} // namespace backend::metal
|
||||||
|
|
|
@ -110,8 +110,9 @@ namespace backend { namespace metal {
|
||||||
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
||||||
return new Queue(builder);
|
return new Queue(builder);
|
||||||
}
|
}
|
||||||
RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) {
|
RenderPassDescriptorBase* Device::CreateRenderPassDescriptor(
|
||||||
return new RenderPassInfo(builder);
|
RenderPassDescriptorBuilder* builder) {
|
||||||
|
return new RenderPassDescriptor(builder);
|
||||||
}
|
}
|
||||||
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
||||||
return new RenderPipeline(builder);
|
return new RenderPipeline(builder);
|
||||||
|
@ -229,10 +230,11 @@ namespace backend { namespace metal {
|
||||||
|
|
||||||
// RenderPass
|
// RenderPass
|
||||||
|
|
||||||
RenderPassInfo::RenderPassInfo(RenderPassInfoBuilder* builder) : RenderPassInfoBase(builder) {
|
RenderPassDescriptor::RenderPassDescriptor(RenderPassDescriptorBuilder* builder)
|
||||||
|
: RenderPassDescriptorBase(builder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderPassInfo::~RenderPassInfo() {
|
RenderPassDescriptor::~RenderPassDescriptor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace backend::metal
|
}} // namespace backend::metal
|
||||||
|
|
|
@ -69,8 +69,9 @@ namespace backend { namespace null {
|
||||||
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
||||||
return new Queue(builder);
|
return new Queue(builder);
|
||||||
}
|
}
|
||||||
RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) {
|
RenderPassDescriptorBase* Device::CreateRenderPassDescriptor(
|
||||||
return new RenderPassInfo(builder);
|
RenderPassDescriptorBuilder* builder) {
|
||||||
|
return new RenderPassDescriptor(builder);
|
||||||
}
|
}
|
||||||
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
||||||
return new RenderPipeline(builder);
|
return new RenderPipeline(builder);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "backend/InputState.h"
|
#include "backend/InputState.h"
|
||||||
#include "backend/PipelineLayout.h"
|
#include "backend/PipelineLayout.h"
|
||||||
#include "backend/Queue.h"
|
#include "backend/Queue.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/RenderPipeline.h"
|
#include "backend/RenderPipeline.h"
|
||||||
#include "backend/Sampler.h"
|
#include "backend/Sampler.h"
|
||||||
#include "backend/ShaderModule.h"
|
#include "backend/ShaderModule.h"
|
||||||
|
@ -50,7 +50,7 @@ namespace backend { namespace null {
|
||||||
using InputState = InputStateBase;
|
using InputState = InputStateBase;
|
||||||
using PipelineLayout = PipelineLayoutBase;
|
using PipelineLayout = PipelineLayoutBase;
|
||||||
class Queue;
|
class Queue;
|
||||||
using RenderPassInfo = RenderPassInfoBase;
|
using RenderPassDescriptor = RenderPassDescriptorBase;
|
||||||
using RenderPipeline = RenderPipelineBase;
|
using RenderPipeline = RenderPipelineBase;
|
||||||
using Sampler = SamplerBase;
|
using Sampler = SamplerBase;
|
||||||
using ShaderModule = ShaderModuleBase;
|
using ShaderModule = ShaderModuleBase;
|
||||||
|
@ -71,7 +71,7 @@ namespace backend { namespace null {
|
||||||
using InputStateType = InputState;
|
using InputStateType = InputState;
|
||||||
using PipelineLayoutType = PipelineLayout;
|
using PipelineLayoutType = PipelineLayout;
|
||||||
using QueueType = Queue;
|
using QueueType = Queue;
|
||||||
using RenderPassInfoType = RenderPassInfo;
|
using RenderPassDescriptorType = RenderPassDescriptor;
|
||||||
using RenderPipelineType = RenderPipeline;
|
using RenderPipelineType = RenderPipeline;
|
||||||
using SamplerType = Sampler;
|
using SamplerType = Sampler;
|
||||||
using ShaderModuleType = ShaderModule;
|
using ShaderModuleType = ShaderModule;
|
||||||
|
@ -106,7 +106,8 @@ namespace backend { namespace null {
|
||||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||||
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
||||||
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
||||||
RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override;
|
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||||
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
||||||
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
||||||
|
|
|
@ -265,7 +265,7 @@ namespace backend { namespace opengl {
|
||||||
|
|
||||||
case Command::BeginRenderPass: {
|
case Command::BeginRenderPass: {
|
||||||
auto* cmd = mCommands.NextCommand<BeginRenderPassCmd>();
|
auto* cmd = mCommands.NextCommand<BeginRenderPassCmd>();
|
||||||
RenderPassInfo* info = ToBackend(cmd->info.Get());
|
RenderPassDescriptor* info = ToBackend(cmd->info.Get());
|
||||||
|
|
||||||
pushConstants.OnBeginPass();
|
pushConstants.OnBeginPass();
|
||||||
inputBuffers.OnBeginPass();
|
inputBuffers.OnBeginPass();
|
||||||
|
|
|
@ -79,8 +79,9 @@ namespace backend { namespace opengl {
|
||||||
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
||||||
return new Queue(builder);
|
return new Queue(builder);
|
||||||
}
|
}
|
||||||
RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) {
|
RenderPassDescriptorBase* Device::CreateRenderPassDescriptor(
|
||||||
return new RenderPassInfo(builder);
|
RenderPassDescriptorBuilder* builder) {
|
||||||
|
return new RenderPassDescriptor(builder);
|
||||||
}
|
}
|
||||||
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
||||||
return new RenderPipeline(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
|
}} // namespace backend::opengl
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "backend/Device.h"
|
#include "backend/Device.h"
|
||||||
#include "backend/InputState.h"
|
#include "backend/InputState.h"
|
||||||
#include "backend/Queue.h"
|
#include "backend/Queue.h"
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
#include "backend/ToBackend.h"
|
#include "backend/ToBackend.h"
|
||||||
|
|
||||||
#include "glad/glad.h"
|
#include "glad/glad.h"
|
||||||
|
@ -45,7 +45,7 @@ namespace backend { namespace opengl {
|
||||||
class PersistentPipelineState;
|
class PersistentPipelineState;
|
||||||
class PipelineLayout;
|
class PipelineLayout;
|
||||||
class Queue;
|
class Queue;
|
||||||
class RenderPassInfo;
|
class RenderPassDescriptor;
|
||||||
class RenderPipeline;
|
class RenderPipeline;
|
||||||
class Sampler;
|
class Sampler;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
|
@ -66,7 +66,7 @@ namespace backend { namespace opengl {
|
||||||
using InputStateType = InputState;
|
using InputStateType = InputState;
|
||||||
using PipelineLayoutType = PipelineLayout;
|
using PipelineLayoutType = PipelineLayout;
|
||||||
using QueueType = Queue;
|
using QueueType = Queue;
|
||||||
using RenderPassInfoType = RenderPassInfo;
|
using RenderPassDescriptorType = RenderPassDescriptor;
|
||||||
using RenderPipelineType = RenderPipeline;
|
using RenderPipelineType = RenderPipeline;
|
||||||
using SamplerType = Sampler;
|
using SamplerType = Sampler;
|
||||||
using ShaderModuleType = ShaderModule;
|
using ShaderModuleType = ShaderModule;
|
||||||
|
@ -94,7 +94,8 @@ namespace backend { namespace opengl {
|
||||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||||
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
||||||
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
||||||
RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override;
|
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||||
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
||||||
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
||||||
|
@ -123,9 +124,9 @@ namespace backend { namespace opengl {
|
||||||
void Submit(uint32_t numCommands, CommandBuffer* const* commands);
|
void Submit(uint32_t numCommands, CommandBuffer* const* commands);
|
||||||
};
|
};
|
||||||
|
|
||||||
class RenderPassInfo : public RenderPassInfoBase {
|
class RenderPassDescriptor : public RenderPassDescriptorBase {
|
||||||
public:
|
public:
|
||||||
RenderPassInfo(RenderPassInfoBuilder* builder);
|
RenderPassDescriptor(RenderPassDescriptorBuilder* builder);
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace backend::opengl
|
}} // namespace backend::opengl
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "backend/vulkan/BufferVk.h"
|
#include "backend/vulkan/BufferVk.h"
|
||||||
#include "backend/vulkan/ComputePipelineVk.h"
|
#include "backend/vulkan/ComputePipelineVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
#include "backend/vulkan/RenderPassInfoVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/RenderPipelineVk.h"
|
#include "backend/vulkan/RenderPipelineVk.h"
|
||||||
#include "backend/vulkan/TextureVk.h"
|
#include "backend/vulkan/TextureVk.h"
|
||||||
#include "backend/vulkan/VulkanBackend.h"
|
#include "backend/vulkan/VulkanBackend.h"
|
||||||
|
@ -183,7 +183,7 @@ namespace backend { namespace vulkan {
|
||||||
|
|
||||||
case Command::BeginRenderPass: {
|
case Command::BeginRenderPass: {
|
||||||
BeginRenderPassCmd* cmd = mCommands.NextCommand<BeginRenderPassCmd>();
|
BeginRenderPassCmd* cmd = mCommands.NextCommand<BeginRenderPassCmd>();
|
||||||
RenderPassInfo* info = ToBackend(cmd->info.Get());
|
RenderPassDescriptor* info = ToBackend(cmd->info.Get());
|
||||||
|
|
||||||
// NXT has an implicit transition to color attachment on render passes.
|
// NXT has an implicit transition to color attachment on render passes.
|
||||||
// Transition the attachments now before we start the render pass.
|
// Transition the attachments now before we start the render pass.
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "backend/vulkan/DepthStencilStateVk.h"
|
#include "backend/vulkan/DepthStencilStateVk.h"
|
||||||
#include "backend/vulkan/InputStateVk.h"
|
#include "backend/vulkan/InputStateVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
#include "backend/vulkan/RenderPassInfoVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/RenderPipelineVk.h"
|
#include "backend/vulkan/RenderPipelineVk.h"
|
||||||
#include "backend/vulkan/SamplerVk.h"
|
#include "backend/vulkan/SamplerVk.h"
|
||||||
#include "backend/vulkan/ShaderModuleVk.h"
|
#include "backend/vulkan/ShaderModuleVk.h"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "backend/vulkan/RenderPassInfoVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
|
|
||||||
#include "backend/vulkan/FencedDeleter.h"
|
#include "backend/vulkan/FencedDeleter.h"
|
||||||
#include "backend/vulkan/RenderPassCache.h"
|
#include "backend/vulkan/RenderPassCache.h"
|
||||||
|
@ -22,11 +22,11 @@
|
||||||
|
|
||||||
namespace backend { namespace vulkan {
|
namespace backend { namespace vulkan {
|
||||||
|
|
||||||
RenderPassInfo::RenderPassInfo(RenderPassInfoBuilder* builder)
|
RenderPassDescriptor::RenderPassDescriptor(RenderPassDescriptorBuilder* builder)
|
||||||
: RenderPassInfoBase(builder), mDevice(ToBackend(builder->GetDevice())) {
|
: RenderPassDescriptorBase(builder), mDevice(ToBackend(builder->GetDevice())) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPassInfo::RecordBeginRenderPass(VkCommandBuffer commands) {
|
void RenderPassDescriptor::RecordBeginRenderPass(VkCommandBuffer commands) {
|
||||||
// Query a VkRenderPass from the cache
|
// Query a VkRenderPass from the cache
|
||||||
VkRenderPass renderPass = VK_NULL_HANDLE;
|
VkRenderPass renderPass = VK_NULL_HANDLE;
|
||||||
{
|
{
|
|
@ -12,10 +12,10 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#ifndef BACKEND_VULKAN_RENDERPASSINFOVK_H_
|
#ifndef BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_
|
||||||
#define BACKEND_VULKAN_RENDERPASSINFOVK_H_
|
#define BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_
|
||||||
|
|
||||||
#include "backend/RenderPassInfo.h"
|
#include "backend/RenderPassDescriptor.h"
|
||||||
|
|
||||||
#include "common/vulkan_platform.h"
|
#include "common/vulkan_platform.h"
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ namespace backend { namespace vulkan {
|
||||||
|
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
class RenderPassInfo : public RenderPassInfoBase {
|
class RenderPassDescriptor : public RenderPassDescriptorBase {
|
||||||
public:
|
public:
|
||||||
RenderPassInfo(RenderPassInfoBuilder* builder);
|
RenderPassDescriptor(RenderPassDescriptorBuilder* builder);
|
||||||
|
|
||||||
// Compute all the arguments for, and record the vkCmdBeginRenderPass command.
|
// Compute all the arguments for, and record the vkCmdBeginRenderPass command.
|
||||||
void RecordBeginRenderPass(VkCommandBuffer commands);
|
void RecordBeginRenderPass(VkCommandBuffer commands);
|
||||||
|
@ -36,4 +36,4 @@ namespace backend { namespace vulkan {
|
||||||
|
|
||||||
}} // namespace backend::vulkan
|
}} // namespace backend::vulkan
|
||||||
|
|
||||||
#endif // BACKEND_VULKAN_RENDERPASSINFOVK_H_
|
#endif // BACKEND_VULKAN_RENDERPASSDESCRIPTORVK_H_
|
|
@ -20,7 +20,7 @@
|
||||||
#include "backend/vulkan/InputStateVk.h"
|
#include "backend/vulkan/InputStateVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
#include "backend/vulkan/RenderPassCache.h"
|
#include "backend/vulkan/RenderPassCache.h"
|
||||||
#include "backend/vulkan/RenderPassInfoVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/ShaderModuleVk.h"
|
#include "backend/vulkan/ShaderModuleVk.h"
|
||||||
#include "backend/vulkan/VulkanBackend.h"
|
#include "backend/vulkan/VulkanBackend.h"
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "backend/vulkan/NativeSwapChainImplVk.h"
|
#include "backend/vulkan/NativeSwapChainImplVk.h"
|
||||||
#include "backend/vulkan/PipelineLayoutVk.h"
|
#include "backend/vulkan/PipelineLayoutVk.h"
|
||||||
#include "backend/vulkan/RenderPassCache.h"
|
#include "backend/vulkan/RenderPassCache.h"
|
||||||
#include "backend/vulkan/RenderPassInfoVk.h"
|
#include "backend/vulkan/RenderPassDescriptorVk.h"
|
||||||
#include "backend/vulkan/RenderPipelineVk.h"
|
#include "backend/vulkan/RenderPipelineVk.h"
|
||||||
#include "backend/vulkan/SamplerVk.h"
|
#include "backend/vulkan/SamplerVk.h"
|
||||||
#include "backend/vulkan/ShaderModuleVk.h"
|
#include "backend/vulkan/ShaderModuleVk.h"
|
||||||
|
@ -246,8 +246,9 @@ namespace backend { namespace vulkan {
|
||||||
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
QueueBase* Device::CreateQueue(QueueBuilder* builder) {
|
||||||
return new Queue(builder);
|
return new Queue(builder);
|
||||||
}
|
}
|
||||||
RenderPassInfoBase* Device::CreateRenderPassInfo(RenderPassInfoBuilder* builder) {
|
RenderPassDescriptorBase* Device::CreateRenderPassDescriptor(
|
||||||
return new RenderPassInfo(builder);
|
RenderPassDescriptorBuilder* builder) {
|
||||||
|
return new RenderPassDescriptor(builder);
|
||||||
}
|
}
|
||||||
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
RenderPipelineBase* Device::CreateRenderPipeline(RenderPipelineBuilder* builder) {
|
||||||
return new RenderPipeline(builder);
|
return new RenderPipeline(builder);
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace backend { namespace vulkan {
|
||||||
class InputState;
|
class InputState;
|
||||||
class PipelineLayout;
|
class PipelineLayout;
|
||||||
class Queue;
|
class Queue;
|
||||||
class RenderPassInfo;
|
class RenderPassDescriptor;
|
||||||
class RenderPipeline;
|
class RenderPipeline;
|
||||||
class Sampler;
|
class Sampler;
|
||||||
class ShaderModule;
|
class ShaderModule;
|
||||||
|
@ -69,7 +69,7 @@ namespace backend { namespace vulkan {
|
||||||
using InputStateType = InputState;
|
using InputStateType = InputState;
|
||||||
using PipelineLayoutType = PipelineLayout;
|
using PipelineLayoutType = PipelineLayout;
|
||||||
using QueueType = Queue;
|
using QueueType = Queue;
|
||||||
using RenderPassInfoType = RenderPassInfo;
|
using RenderPassDescriptorType = RenderPassDescriptor;
|
||||||
using RenderPipelineType = RenderPipeline;
|
using RenderPipelineType = RenderPipeline;
|
||||||
using SamplerType = Sampler;
|
using SamplerType = Sampler;
|
||||||
using ShaderModuleType = ShaderModule;
|
using ShaderModuleType = ShaderModule;
|
||||||
|
@ -122,7 +122,8 @@ namespace backend { namespace vulkan {
|
||||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||||
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
PipelineLayoutBase* CreatePipelineLayout(PipelineLayoutBuilder* builder) override;
|
||||||
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
QueueBase* CreateQueue(QueueBuilder* builder) override;
|
||||||
RenderPassInfoBase* CreateRenderPassInfo(RenderPassInfoBuilder* builder) override;
|
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||||
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
SamplerBase* CreateSampler(SamplerBuilder* builder) override;
|
||||||
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
ShaderModuleBase* CreateShaderModule(ShaderModuleBuilder* builder) override;
|
||||||
|
|
|
@ -50,7 +50,7 @@ list(APPEND UNITTEST_SOURCES
|
||||||
${VALIDATION_TESTS_DIR}/DynamicStateCommandValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/DynamicStateCommandValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/InputStateValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/InputStateValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/PushConstantsValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/PushConstantsValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/RenderPassInfoValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/RenderPassDescriptorValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/RenderPipelineValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/RenderPipelineValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/UsageValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/UsageValidationTests.cpp
|
||||||
${VALIDATION_TESTS_DIR}/VertexBufferValidationTests.cpp
|
${VALIDATION_TESTS_DIR}/VertexBufferValidationTests.cpp
|
||||||
|
|
|
@ -707,7 +707,7 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
||||||
renderTargetViews[i] = renderTargets[i].CreateTextureViewBuilder().GetResult();
|
renderTargetViews[i] = renderTargets[i].CreateTextureViewBuilder().GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPassInfo renderpass = device.CreateRenderPassInfoBuilder()
|
nxt::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetViews[0], nxt::LoadOp::Clear)
|
.SetColorAttachment(0, renderTargetViews[0], nxt::LoadOp::Clear)
|
||||||
.SetColorAttachment(1, renderTargetViews[1], nxt::LoadOp::Clear)
|
.SetColorAttachment(1, renderTargetViews[1], nxt::LoadOp::Clear)
|
||||||
.SetColorAttachment(2, renderTargetViews[2], nxt::LoadOp::Clear)
|
.SetColorAttachment(2, renderTargetViews[2], nxt::LoadOp::Clear)
|
||||||
|
|
|
@ -46,7 +46,7 @@ class DepthStencilStateTest : public NXTTest {
|
||||||
|
|
||||||
depthTextureView = depthTexture.CreateTextureViewBuilder().GetResult();
|
depthTextureView = depthTexture.CreateTextureViewBuilder().GetResult();
|
||||||
|
|
||||||
renderpass = device.CreateRenderPassInfoBuilder()
|
renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthTextureView, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
.SetDepthStencilAttachment(depthTextureView, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
@ -247,7 +247,7 @@ class DepthStencilStateTest : public NXTTest {
|
||||||
DoTest(testParams, expected, expected);
|
DoTest(testParams, expected, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPassInfo renderpass;
|
nxt::RenderPassDescriptor renderpass;
|
||||||
nxt::Texture renderTarget;
|
nxt::Texture renderTarget;
|
||||||
nxt::Texture depthTexture;
|
nxt::Texture depthTexture;
|
||||||
nxt::TextureView renderTargetView;
|
nxt::TextureView renderTargetView;
|
||||||
|
|
|
@ -111,7 +111,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
||||||
|
|
||||||
// Part 1: clear once, check to make sure it's cleared
|
// 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)
|
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachmentClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f)
|
.SetColorAttachmentClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
@ -123,7 +123,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
||||||
.EndRenderPass()
|
.EndRenderPass()
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
auto renderPassClearGreen = device.CreateRenderPassInfoBuilder()
|
auto renderPassClearGreen = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachmentClearColor(0, 0.0f, 1.0f, 0.0f, 1.0f)
|
.SetColorAttachmentClearColor(0, 0.0f, 1.0f, 0.0f, 1.0f)
|
||||||
.GetResult();
|
.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
|
// 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)
|
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Load)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class RenderPassInfoValidationTest : public ValidationTest {
|
class RenderPassDescriptorValidationTest : public ValidationTest {
|
||||||
};
|
};
|
||||||
|
|
||||||
nxt::TextureView Create2DAttachment(nxt::Device& device, uint32_t width, uint32_t height, nxt::TextureFormat format) {
|
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
|
// A render pass with no attachments isn't valid
|
||||||
TEST_F(RenderPassInfoValidationTest, Empty) {
|
TEST_F(RenderPassDescriptorValidationTest, Empty) {
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// A render pass with only one color or one depth attachment is ok
|
// A render pass with only one color or one depth attachment is ok
|
||||||
TEST_F(RenderPassInfoValidationTest, OneAttachment) {
|
TEST_F(RenderPassDescriptorValidationTest, OneAttachment) {
|
||||||
// One color attachment
|
// One color attachment
|
||||||
{
|
{
|
||||||
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// One depth-stencil attachment
|
// One depth-stencil attachment
|
||||||
{
|
{
|
||||||
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test OOB color attachment indices are handled
|
// Test OOB color attachment indices are handled
|
||||||
TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
|
TEST_F(RenderPassDescriptorValidationTest, ColorAttachmentOutOfBounds) {
|
||||||
// For setting the color attachment, control case
|
// For setting the color attachment, control case
|
||||||
{
|
{
|
||||||
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(kMaxColorAttachments - 1, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(kMaxColorAttachments - 1, color, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// For setting the color attachment, OOB
|
// For setting the color attachment, OOB
|
||||||
{
|
{
|
||||||
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(kMaxColorAttachments, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(kMaxColorAttachments, color, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
@ -79,14 +79,14 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
|
||||||
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
// For setting the clear color, control case
|
// For setting the clear color, control case
|
||||||
{
|
{
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachmentClearColor(kMaxColorAttachments - 1, 0.0f, 0.0f, 0.0f, 0.0f)
|
.SetColorAttachmentClearColor(kMaxColorAttachments - 1, 0.0f, 0.0f, 0.0f, 0.0f)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// For setting the clear color, OOB
|
// For setting the clear color, OOB
|
||||||
{
|
{
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachmentClearColor(kMaxColorAttachments, 0.0f, 0.0f, 0.0f, 0.0f)
|
.SetColorAttachmentClearColor(kMaxColorAttachments, 0.0f, 0.0f, 0.0f, 0.0f)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
@ -94,12 +94,12 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test setting a clear value without an attachment and vice-versa is ok.
|
// 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);
|
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
|
// 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)
|
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachmentClearColor(1, 0.0f, 0.0f, 0.0f, 0.0f)
|
.SetColorAttachmentClearColor(1, 0.0f, 0.0f, 0.0f, 0.0f)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
@ -107,13 +107,13 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) {
|
||||||
// Clear depth stencil doesn't get values
|
// Clear depth stencil doesn't get values
|
||||||
{
|
{
|
||||||
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
// Clear values for depth-stencil when it isn't used
|
// Clear values for depth-stencil when it isn't used
|
||||||
{
|
{
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachmentClearValue(0.0f, 0)
|
.SetDepthStencilAttachmentClearValue(0.0f, 0)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
@ -121,7 +121,7 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attachments must have the same size
|
// 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 color1x1A = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
nxt::TextureView color1x1B = 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);
|
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)
|
// Control case: all the same size (1x1)
|
||||||
{
|
{
|
||||||
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
|
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, 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
|
// One of the color attachments has a different size
|
||||||
{
|
{
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachment(1, color2x2, nxt::LoadOp::Clear)
|
.SetColorAttachment(1, color2x2, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, 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
|
// The depth stencil attachment has a different size
|
||||||
{
|
{
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
|
||||||
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
|
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthStencil2x2, nxt::LoadOp::Clear, 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
|
// 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 color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
|
||||||
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
|
||||||
|
|
||||||
// Using depth-stencil for color
|
// Using depth-stencil for color
|
||||||
{
|
{
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, depthStencil, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, depthStencil, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using color for depth-stencil
|
// Using color for depth-stencil
|
||||||
{
|
{
|
||||||
AssertWillBeError(device.CreateRenderPassInfoBuilder())
|
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetDepthStencilAttachment(color, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
.SetDepthStencilAttachment(color, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
|
@ -54,7 +54,7 @@ class RenderPipelineValidationTest : public ValidationTest {
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPassInfo renderpass;
|
nxt::RenderPassDescriptor renderpass;
|
||||||
nxt::ShaderModule vsModule;
|
nxt::ShaderModule vsModule;
|
||||||
nxt::ShaderModule fsModule;
|
nxt::ShaderModule fsModule;
|
||||||
nxt::InputState inputState;
|
nxt::InputState inputState;
|
||||||
|
|
|
@ -69,7 +69,7 @@ bool ValidationTest::EndExpectDeviceError() {
|
||||||
return mError;
|
return mError;
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() {
|
nxt::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
|
||||||
auto colorBuffer = device.CreateTextureBuilder()
|
auto colorBuffer = device.CreateTextureBuilder()
|
||||||
.SetDimension(nxt::TextureDimension::e2D)
|
.SetDimension(nxt::TextureDimension::e2D)
|
||||||
.SetExtent(640, 480, 1)
|
.SetExtent(640, 480, 1)
|
||||||
|
@ -81,7 +81,7 @@ nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() {
|
||||||
auto colorView = colorBuffer.CreateTextureViewBuilder()
|
auto colorView = colorBuffer.CreateTextureViewBuilder()
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
return device.CreateRenderPassInfoBuilder()
|
return device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, colorView, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
|
||||||
|
|
||||||
nxt::TextureView view = AssertWillBeSuccess(dummy.attachment.CreateTextureViewBuilder()).GetResult();
|
nxt::TextureView view = AssertWillBeSuccess(dummy.attachment.CreateTextureViewBuilder()).GetResult();
|
||||||
|
|
||||||
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
|
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, view, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, view, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
|
|
|
@ -48,12 +48,12 @@ class ValidationTest : public testing::Test {
|
||||||
void StartExpectDeviceError();
|
void StartExpectDeviceError();
|
||||||
bool EndExpectDeviceError();
|
bool EndExpectDeviceError();
|
||||||
|
|
||||||
nxt::RenderPassInfo CreateSimpleRenderPass();
|
nxt::RenderPassDescriptor CreateSimpleRenderPass();
|
||||||
|
|
||||||
// Helper functions to create objects to test validation.
|
// Helper functions to create objects to test validation.
|
||||||
|
|
||||||
struct DummyRenderPass {
|
struct DummyRenderPass {
|
||||||
nxt::RenderPassInfo renderPass;
|
nxt::RenderPassDescriptor renderPass;
|
||||||
nxt::Texture attachment;
|
nxt::Texture attachment;
|
||||||
nxt::TextureFormat attachmentFormat;
|
nxt::TextureFormat attachmentFormat;
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
|
|
@ -86,7 +86,7 @@ class VertexBufferValidationTest : public ValidationTest {
|
||||||
.GetResult();
|
.GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
nxt::RenderPassInfo renderpass;
|
nxt::RenderPassDescriptor renderpass;
|
||||||
nxt::ShaderModule fsModule;
|
nxt::ShaderModule fsModule;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ namespace utils {
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
nxt::TextureView colorView = result.color.CreateTextureViewBuilder().GetResult();
|
nxt::TextureView colorView = result.color.CreateTextureViewBuilder().GetResult();
|
||||||
result.renderPassInfo = device.CreateRenderPassInfoBuilder()
|
result.renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, nxt::LoadOp::Clear)
|
.SetColorAttachment(0, colorView, nxt::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace utils {
|
||||||
uint32_t height;
|
uint32_t height;
|
||||||
nxt::Texture color;
|
nxt::Texture color;
|
||||||
nxt::TextureFormat colorFormat;
|
nxt::TextureFormat colorFormat;
|
||||||
nxt::RenderPassInfo renderPassInfo;
|
nxt::RenderPassDescriptor renderPassInfo;
|
||||||
};
|
};
|
||||||
BasicRenderPass CreateBasicRenderPass(const nxt::Device& device,
|
BasicRenderPass CreateBasicRenderPass(const nxt::Device& device,
|
||||||
uint32_t width,
|
uint32_t width,
|
||||||
|
|
Loading…
Reference in New Issue