Commit 077e346a authored by Austin Eng's avatar Austin Eng Committed by Commit Bot

WebGPU: Add rgb9e5ufloat and deprecate bc6h-rgb-sfloat, rg11b10float

Change-Id: Iada015382d0a5c66ea0f09935703bc18054181f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473759
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817409}
parent 291faaf5
......@@ -222,11 +222,18 @@ WGPUTextureFormat AsDawnEnum<WGPUTextureFormat>(
}
// Packed 32 bit formats
if (webgpu_enum == "rgb9e5ufloat") {
return WGPUTextureFormat_RGB9E5Ufloat;
}
if (webgpu_enum == "rgb10a2unorm") {
return WGPUTextureFormat_RGB10A2Unorm;
}
if (webgpu_enum == "rg11b10float") {
return WGPUTextureFormat_RG11B10Float;
// Deprecated.
return WGPUTextureFormat_RG11B10Ufloat;
}
if (webgpu_enum == "rg11b10ufloat") {
return WGPUTextureFormat_RG11B10Ufloat;
}
// Normal 64 bit formats
......@@ -305,8 +312,12 @@ WGPUTextureFormat AsDawnEnum<WGPUTextureFormat>(
if (webgpu_enum == "bc6h-rgb-ufloat") {
return WGPUTextureFormat_BC6HRGBUfloat;
}
if (webgpu_enum == "bc6h-rgb-float") {
return WGPUTextureFormat_BC6HRGBFloat;
}
if (webgpu_enum == "bc6h-rgb-sfloat") {
return WGPUTextureFormat_BC6HRGBSfloat;
// Deprecated.
return WGPUTextureFormat_BC6HRGBFloat;
}
if (webgpu_enum == "bc7-rgba-unorm") {
return WGPUTextureFormat_BC7RGBAUnorm;
......
......@@ -27,6 +27,14 @@ WGPUTextureDescriptor AsDawnType(const GPUTextureDescriptor* webgpu_desc,
dawn_desc.dimension =
AsDawnEnum<WGPUTextureDimension>(webgpu_desc->dimension());
dawn_desc.size = AsDawnType(&webgpu_desc->size());
if (webgpu_desc->format() == "rg11b10float") {
device->AddConsoleWarning(
"rg11b10float is deprecated. Use rg11b10ufloat instead.");
}
if (webgpu_desc->format() == "bc6h-rgb-sfloat") {
device->AddConsoleWarning(
"bc6h-rgb-sfloat is deprecated. Use bc6h-rgb-float instead.");
}
dawn_desc.format = AsDawnEnum<WGPUTextureFormat>(webgpu_desc->format());
dawn_desc.mipLevelCount = webgpu_desc->mipLevelCount();
dawn_desc.sampleCount = webgpu_desc->sampleCount();
......
......@@ -48,8 +48,10 @@ enum GPUTextureFormat {
"bgra8unorm",
"bgra8unorm-srgb",
/* Packed 32 bit formats */
"rgb9e5ufloat",
"rgb10a2unorm",
"rg11b10float",
"rg11b10ufloat",
/* Normal 64 bit formats */
"rg32uint",
"rg32sint",
......@@ -77,6 +79,7 @@ enum GPUTextureFormat {
"bc5-rg-unorm",
"bc5-rg-snorm",
"bc6h-rgb-ufloat",
"bc6h-rgb-float",
"bc6h-rgb-sfloat",
"bc7-rgba-unorm",
"bc7-rgba-unorm-srgb"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment