Rename mipLevel to levelCount in TextureDescriptor
This patch renames the field "mipLevel" of TextureDescriptor to "levelCount" to align with the WebGPU idl. BUG=dawn:16 Change-Id: I36b30d78831786e4c21ffd641f820375e95a1be5 Reviewed-on: https://dawn-review.googlesource.com/c/2100 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
e92ad5bb89
commit
84cde51741
|
@ -1055,7 +1055,7 @@
|
|||
{"name": "size", "type": "extent 3D"},
|
||||
{"name": "array layer", "type": "uint32_t"},
|
||||
{"name": "format", "type": "texture format"},
|
||||
{"name": "mip level", "type": "uint32_t"}
|
||||
{"name": "level count", "type": "uint32_t"}
|
||||
]
|
||||
},
|
||||
"texture dimension": {
|
||||
|
|
|
@ -55,7 +55,7 @@ void initTextures() {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::Sampled;
|
||||
texture = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ dawn::TextureView CreateDefaultDepthStencilView(const dawn::Device& device) {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
auto depthStencilTexture = device.CreateTexture(&descriptor);
|
||||
return depthStencilTexture.CreateDefaultTextureView();
|
||||
|
|
|
@ -389,7 +389,7 @@ namespace {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::Sampled;
|
||||
auto oTexture = device.CreateTexture(&descriptor);
|
||||
// TODO: release this texture
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace dawn_native {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = mFormat;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = mAllowedUsage;
|
||||
|
||||
auto* texture = GetNextTextureImpl(&descriptor);
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace dawn_native {
|
|||
// TODO(jiawei.shao@intel.com): check stuff based on the dimension
|
||||
if (descriptor->size.width == 0 || descriptor->size.height == 0 ||
|
||||
descriptor->size.depth == 0 || descriptor->arrayLayer == 0 ||
|
||||
descriptor->mipLevel == 0) {
|
||||
descriptor->levelCount == 0) {
|
||||
return DAWN_VALIDATION_ERROR("Cannot create an empty texture");
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ namespace dawn_native {
|
|||
mFormat(descriptor->format),
|
||||
mSize(descriptor->size),
|
||||
mArrayLayers(descriptor->arrayLayer),
|
||||
mNumMipLevels(descriptor->mipLevel),
|
||||
mNumMipLevels(descriptor->levelCount),
|
||||
mUsage(descriptor->usage) {
|
||||
}
|
||||
|
||||
|
|
|
@ -722,7 +722,7 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||
|
||||
for (uint32_t i = 0; i < 4; ++i) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class CopyTests_T2B : public CopyTests {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = textureSpec.arrayLayer;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = textureSpec.level + 1;
|
||||
descriptor.levelCount = textureSpec.level + 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::TransferSrc;
|
||||
dawn::Texture texture = device.CreateTexture(&descriptor);
|
||||
|
||||
|
@ -180,7 +180,7 @@ protected:
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = textureSpec.level + 1;
|
||||
descriptor.levelCount = textureSpec.level + 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::TransferSrc;
|
||||
dawn::Texture texture = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||
renderTargetDescriptor.size.depth = 1;
|
||||
renderTargetDescriptor.arrayLayer = 1;
|
||||
renderTargetDescriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
renderTargetDescriptor.mipLevel = 1;
|
||||
renderTargetDescriptor.levelCount = 1;
|
||||
renderTargetDescriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||
renderTarget = device.CreateTexture(&renderTargetDescriptor);
|
||||
|
||||
|
@ -44,7 +44,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||
depthDescriptor.size.depth = 1;
|
||||
depthDescriptor.arrayLayer = 1;
|
||||
depthDescriptor.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
depthDescriptor.mipLevel = 1;
|
||||
depthDescriptor.levelCount = 1;
|
||||
depthDescriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
depthTexture = device.CreateTexture(&depthDescriptor);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class RenderPassLoadOpTests : public DawnTest {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||
renderTarget = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ protected:
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::Sampled;
|
||||
dawn::Texture texture = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ protected:
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = layerCount;
|
||||
descriptor.format = kFormat;
|
||||
descriptor.mipLevel = levelCount;
|
||||
descriptor.levelCount = levelCount;
|
||||
descriptor.usage = dawn::TextureUsageBit::TransferDst | dawn::TextureUsageBit::Sampled;
|
||||
mTexture = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class CopyCommandTest : public ValidationTest {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = arrayLayer;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevel = levels;
|
||||
descriptor.levelCount = levels;
|
||||
descriptor.usage = usage;
|
||||
dawn::Texture tex = device.CreateTexture(&descriptor);
|
||||
return tex;
|
||||
|
|
|
@ -29,7 +29,7 @@ dawn::TextureView Create2DAttachment(dawn::Device& device, uint32_t width, uint3
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
dawn::Texture attachment = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ dawn::Texture Create2DArrayTexture(dawn::Device& device,
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = arrayLayers;
|
||||
descriptor.format = format;
|
||||
descriptor.mipLevel = kDefaultMipLevels;
|
||||
descriptor.levelCount = kDefaultMipLevels;
|
||||
descriptor.usage = dawn::TextureUsageBit::Sampled;
|
||||
return device.CreateTexture(&descriptor);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ dawn::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
|
||||
auto colorBuffer = device.CreateTexture(&descriptor);
|
||||
|
@ -134,7 +134,7 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dummy.attachmentFormat;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
dummy.attachment = device.CreateTexture(&descriptor);
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace utils {
|
|||
descriptor.size.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = result.colorFormat;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.levelCount = 1;
|
||||
descriptor.usage =
|
||||
dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||
result.color = device.CreateTexture(&descriptor);
|
||||
|
|
Loading…
Reference in New Issue