Rename RenderPassInfo to RenderPassDescriptor

This commit is contained in:
Corentin Wallez
2018-05-11 13:04:44 -04:00
committed by Corentin Wallez
parent 6f7749cce9
commit 8d6b5d2337
61 changed files with 231 additions and 216 deletions

View File

@@ -50,7 +50,7 @@ list(APPEND UNITTEST_SOURCES
${VALIDATION_TESTS_DIR}/DynamicStateCommandValidationTests.cpp
${VALIDATION_TESTS_DIR}/InputStateValidationTests.cpp
${VALIDATION_TESTS_DIR}/PushConstantsValidationTests.cpp
${VALIDATION_TESTS_DIR}/RenderPassInfoValidationTests.cpp
${VALIDATION_TESTS_DIR}/RenderPassDescriptorValidationTests.cpp
${VALIDATION_TESTS_DIR}/RenderPipelineValidationTests.cpp
${VALIDATION_TESTS_DIR}/UsageValidationTests.cpp
${VALIDATION_TESTS_DIR}/VertexBufferValidationTests.cpp

View File

@@ -707,7 +707,7 @@ TEST_P(BlendStateTest, IndependentBlendState) {
renderTargetViews[i] = renderTargets[i].CreateTextureViewBuilder().GetResult();
}
nxt::RenderPassInfo renderpass = device.CreateRenderPassInfoBuilder()
nxt::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, renderTargetViews[0], nxt::LoadOp::Clear)
.SetColorAttachment(1, renderTargetViews[1], nxt::LoadOp::Clear)
.SetColorAttachment(2, renderTargetViews[2], nxt::LoadOp::Clear)

View File

@@ -46,7 +46,7 @@ class DepthStencilStateTest : public NXTTest {
depthTextureView = depthTexture.CreateTextureViewBuilder().GetResult();
renderpass = device.CreateRenderPassInfoBuilder()
renderpass = device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
.SetDepthStencilAttachment(depthTextureView, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
.GetResult();
@@ -247,7 +247,7 @@ class DepthStencilStateTest : public NXTTest {
DoTest(testParams, expected, expected);
}
nxt::RenderPassInfo renderpass;
nxt::RenderPassDescriptor renderpass;
nxt::Texture renderTarget;
nxt::Texture depthTexture;
nxt::TextureView renderTargetView;

View File

@@ -111,7 +111,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
// Part 1: clear once, check to make sure it's cleared
auto renderPassClearZero = device.CreateRenderPassInfoBuilder()
auto renderPassClearZero = device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
.SetColorAttachmentClearColor(0, 0.0f, 0.0f, 0.0f, 0.0f)
.GetResult();
@@ -123,7 +123,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
.EndRenderPass()
.GetResult();
auto renderPassClearGreen = device.CreateRenderPassInfoBuilder()
auto renderPassClearGreen = device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Clear)
.SetColorAttachmentClearColor(0, 0.0f, 1.0f, 0.0f, 1.0f)
.GetResult();
@@ -143,7 +143,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
// Part 2: draw a blue quad into the right half of the render target, and check result
auto renderPassLoad = device.CreateRenderPassInfoBuilder()
auto renderPassLoad = device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, renderTargetView, nxt::LoadOp::Load)
.GetResult();

View File

@@ -18,7 +18,7 @@
namespace {
class RenderPassInfoValidationTest : public ValidationTest {
class RenderPassDescriptorValidationTest : public ValidationTest {
};
nxt::TextureView Create2DAttachment(nxt::Device& device, uint32_t width, uint32_t height, nxt::TextureFormat format) {
@@ -36,42 +36,42 @@ nxt::TextureView Create2DAttachment(nxt::Device& device, uint32_t width, uint32_
}
// A render pass with no attachments isn't valid
TEST_F(RenderPassInfoValidationTest, Empty) {
AssertWillBeError(device.CreateRenderPassInfoBuilder())
TEST_F(RenderPassDescriptorValidationTest, Empty) {
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.GetResult();
}
// A render pass with only one color or one depth attachment is ok
TEST_F(RenderPassInfoValidationTest, OneAttachment) {
TEST_F(RenderPassDescriptorValidationTest, OneAttachment) {
// One color attachment
{
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
.GetResult();
}
// One depth-stencil attachment
{
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
.GetResult();
}
}
// Test OOB color attachment indices are handled
TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
TEST_F(RenderPassDescriptorValidationTest, ColorAttachmentOutOfBounds) {
// For setting the color attachment, control case
{
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(kMaxColorAttachments - 1, color, nxt::LoadOp::Clear)
.GetResult();
}
// For setting the color attachment, OOB
{
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(kMaxColorAttachments, color, nxt::LoadOp::Clear)
.GetResult();
}
@@ -79,14 +79,14 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
// For setting the clear color, control case
{
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
.SetColorAttachmentClearColor(kMaxColorAttachments - 1, 0.0f, 0.0f, 0.0f, 0.0f)
.GetResult();
}
// For setting the clear color, OOB
{
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
.SetColorAttachmentClearColor(kMaxColorAttachments, 0.0f, 0.0f, 0.0f, 0.0f)
.GetResult();
@@ -94,12 +94,12 @@ TEST_F(RenderPassInfoValidationTest, ColorAttachmentOutOfBounds) {
}
// Test setting a clear value without an attachment and vice-versa is ok.
TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) {
TEST_F(RenderPassDescriptorValidationTest, ClearAndAttachmentMismatchIsOk) {
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
// For cleared attachment 0 doesn't get a color, clear color for 1 is unused
{
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
.SetColorAttachmentClearColor(1, 0.0f, 0.0f, 0.0f, 0.0f)
.GetResult();
@@ -107,13 +107,13 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) {
// Clear depth stencil doesn't get values
{
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetDepthStencilAttachment(depthStencil, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
.GetResult();
}
// Clear values for depth-stencil when it isn't used
{
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color, nxt::LoadOp::Clear)
.SetDepthStencilAttachmentClearValue(0.0f, 0)
.GetResult();
@@ -121,7 +121,7 @@ TEST_F(RenderPassInfoValidationTest, ClearAndAttachmentMismatchIsOk) {
}
// Attachments must have the same size
TEST_F(RenderPassInfoValidationTest, SizeMustMatch) {
TEST_F(RenderPassDescriptorValidationTest, SizeMustMatch) {
nxt::TextureView color1x1A = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
nxt::TextureView color1x1B = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
nxt::TextureView color2x2 = Create2DAttachment(device, 2, 2, nxt::TextureFormat::R8G8B8A8Unorm);
@@ -130,7 +130,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) {
// Control case: all the same size (1x1)
{
AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
.SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
@@ -139,7 +139,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) {
// One of the color attachments has a different size
{
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
.SetColorAttachment(1, color2x2, nxt::LoadOp::Clear)
.SetDepthStencilAttachment(depthStencil1x1, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
@@ -148,7 +148,7 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) {
// The depth stencil attachment has a different size
{
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, color1x1A, nxt::LoadOp::Clear)
.SetColorAttachment(1, color1x1B, nxt::LoadOp::Clear)
.SetDepthStencilAttachment(depthStencil2x2, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
@@ -157,20 +157,20 @@ TEST_F(RenderPassInfoValidationTest, SizeMustMatch) {
}
// Attachments formats must match whether they are used for color or depth-stencil
TEST_F(RenderPassInfoValidationTest, FormatMismatch) {
TEST_F(RenderPassDescriptorValidationTest, FormatMismatch) {
nxt::TextureView color = Create2DAttachment(device, 1, 1, nxt::TextureFormat::R8G8B8A8Unorm);
nxt::TextureView depthStencil = Create2DAttachment(device, 1, 1, nxt::TextureFormat::D32FloatS8Uint);
// Using depth-stencil for color
{
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, depthStencil, nxt::LoadOp::Clear)
.GetResult();
}
// Using color for depth-stencil
{
AssertWillBeError(device.CreateRenderPassInfoBuilder())
AssertWillBeError(device.CreateRenderPassDescriptorBuilder())
.SetDepthStencilAttachment(color, nxt::LoadOp::Clear, nxt::LoadOp::Clear)
.GetResult();
}

View File

@@ -54,7 +54,7 @@ class RenderPipelineValidationTest : public ValidationTest {
return builder;
}
nxt::RenderPassInfo renderpass;
nxt::RenderPassDescriptor renderpass;
nxt::ShaderModule vsModule;
nxt::ShaderModule fsModule;
nxt::InputState inputState;

View File

@@ -69,7 +69,7 @@ bool ValidationTest::EndExpectDeviceError() {
return mError;
}
nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() {
nxt::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
auto colorBuffer = device.CreateTextureBuilder()
.SetDimension(nxt::TextureDimension::e2D)
.SetExtent(640, 480, 1)
@@ -81,7 +81,7 @@ nxt::RenderPassInfo ValidationTest::CreateSimpleRenderPass() {
auto colorView = colorBuffer.CreateTextureViewBuilder()
.GetResult();
return device.CreateRenderPassInfoBuilder()
return device.CreateRenderPassDescriptorBuilder()
.SetColorAttachment(0, colorView, nxt::LoadOp::Clear)
.GetResult();
}
@@ -130,7 +130,7 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
nxt::TextureView view = AssertWillBeSuccess(dummy.attachment.CreateTextureViewBuilder()).GetResult();
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassInfoBuilder())
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
.SetColorAttachment(0, view, nxt::LoadOp::Clear)
.GetResult();

View File

@@ -48,12 +48,12 @@ class ValidationTest : public testing::Test {
void StartExpectDeviceError();
bool EndExpectDeviceError();
nxt::RenderPassInfo CreateSimpleRenderPass();
nxt::RenderPassDescriptor CreateSimpleRenderPass();
// Helper functions to create objects to test validation.
struct DummyRenderPass {
nxt::RenderPassInfo renderPass;
nxt::RenderPassDescriptor renderPass;
nxt::Texture attachment;
nxt::TextureFormat attachmentFormat;
uint32_t width;

View File

@@ -86,7 +86,7 @@ class VertexBufferValidationTest : public ValidationTest {
.GetResult();
}
nxt::RenderPassInfo renderpass;
nxt::RenderPassDescriptor renderpass;
nxt::ShaderModule fsModule;
};