Fix dawn.json for upstream webgpu-headers
- Add disabled_tags 'dawn' to webgpu_headers_gen - Rename WGPUSurfaceDescriptorFromXlib to sync with upstream - Other sync with upstream: surface wayland and android enums Bug: dawn:269 Change-Id: I5ca5c5362c54018f9d217af6a6ab4e3e84a5d780 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83000 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
parent
bdf24fb20d
commit
1554a7d8f9
34
dawn.json
34
dawn.json
|
@ -99,7 +99,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tags": ["dawn"],
|
|
||||||
"name": "enumerate features",
|
"name": "enumerate features",
|
||||||
"returns": "size_t",
|
"returns": "size_t",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -1084,7 +1083,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tags": ["dawn"],
|
|
||||||
"name": "has feature",
|
"name": "has feature",
|
||||||
"returns": "bool",
|
"returns": "bool",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -1092,7 +1090,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tags": ["dawn"],
|
|
||||||
"name": "enumerate features",
|
"name": "enumerate features",
|
||||||
"returns": "size_t",
|
"returns": "size_t",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -2306,6 +2303,14 @@
|
||||||
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
|
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"surface descriptor from android native window": {
|
||||||
|
"category": "structure",
|
||||||
|
"chained": "in",
|
||||||
|
"tags": ["native"],
|
||||||
|
"members": [
|
||||||
|
{"name": "window", "type": "void", "annotation": "*"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"surface descriptor from canvas HTML selector": {
|
"surface descriptor from canvas HTML selector": {
|
||||||
"category": "structure",
|
"category": "structure",
|
||||||
"chained": "in",
|
"chained": "in",
|
||||||
|
@ -2330,7 +2335,7 @@
|
||||||
{"name": "hwnd", "type": "void", "annotation": "*"}
|
{"name": "hwnd", "type": "void", "annotation": "*"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"surface descriptor from xlib window": {
|
"surface descriptor from xlib": {
|
||||||
"category": "structure",
|
"category": "structure",
|
||||||
"chained": "in",
|
"chained": "in",
|
||||||
"tags": ["native"],
|
"tags": ["native"],
|
||||||
|
@ -2339,6 +2344,15 @@
|
||||||
{"name": "window", "type": "uint32_t"}
|
{"name": "window", "type": "uint32_t"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"surface descriptor from wayland surface": {
|
||||||
|
"category": "structure",
|
||||||
|
"chained": "in",
|
||||||
|
"tags": ["native"],
|
||||||
|
"members": [
|
||||||
|
{"name": "display", "type": "void", "annotation": "*"},
|
||||||
|
{"name": "surface", "type": "void", "annotation": "*"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"surface descriptor from windows core window": {
|
"surface descriptor from windows core window": {
|
||||||
"category": "structure",
|
"category": "structure",
|
||||||
"chained": "in",
|
"chained": "in",
|
||||||
|
@ -2392,15 +2406,17 @@
|
||||||
{"value": 0, "name": "invalid", "valid": false},
|
{"value": 0, "name": "invalid", "valid": false},
|
||||||
{"value": 1, "name": "surface descriptor from metal layer", "tags": ["native"]},
|
{"value": 1, "name": "surface descriptor from metal layer", "tags": ["native"]},
|
||||||
{"value": 2, "name": "surface descriptor from windows HWND", "tags": ["native"]},
|
{"value": 2, "name": "surface descriptor from windows HWND", "tags": ["native"]},
|
||||||
{"value": 3, "name": "surface descriptor from xlib window", "tags": ["native"]},
|
{"value": 3, "name": "surface descriptor from xlib", "tags": ["native"]},
|
||||||
{"value": 4, "name": "surface descriptor from canvas HTML selector"},
|
{"value": 4, "name": "surface descriptor from canvas HTML selector"},
|
||||||
{"value": 5, "name": "shader module SPIRV descriptor"},
|
{"value": 5, "name": "shader module SPIRV descriptor"},
|
||||||
{"value": 6, "name": "shader module WGSL descriptor"},
|
{"value": 6, "name": "shader module WGSL descriptor"},
|
||||||
{"value": 7, "name": "primitive depth clip control", "tags": ["upstream", "emscripten"]},
|
{"value": 7, "name": "primitive depth clip control", "tags": ["upstream", "emscripten"]},
|
||||||
{"value": 8, "name": "surface descriptor from windows core window", "tags": ["dawn"]},
|
{"value": 8, "name": "surface descriptor from wayland surface", "tags": ["native"]},
|
||||||
{"value": 9, "name": "external texture binding entry", "tags": ["dawn"]},
|
{"value": 9, "name": "surface descriptor from android native window", "tags": ["native"]},
|
||||||
{"value": 10, "name": "external texture binding layout", "tags": ["dawn"]},
|
{"value": 10, "name": "surface descriptor from windows core window", "tags": ["dawn"]},
|
||||||
{"value": 11, "name": "surface descriptor from windows swap chain panel", "tags": ["dawn"]},
|
{"value": 11, "name": "external texture binding entry", "tags": ["dawn"]},
|
||||||
|
{"value": 12, "name": "external texture binding layout", "tags": ["dawn"]},
|
||||||
|
{"value": 13, "name": "surface descriptor from windows swap chain panel", "tags": ["dawn"]},
|
||||||
{"value": 1000, "name": "dawn texture internal usage descriptor", "tags": ["dawn"]},
|
{"value": 1000, "name": "dawn texture internal usage descriptor", "tags": ["dawn"]},
|
||||||
{"value": 1001, "name": "primitive depth clamping state", "tags": ["dawn", "emscripten"]},
|
{"value": 1001, "name": "primitive depth clamping state", "tags": ["dawn", "emscripten"]},
|
||||||
{"value": 1002, "name": "dawn toggles device descriptor", "tags": ["dawn", "native"]},
|
{"value": 1002, "name": "dawn toggles device descriptor", "tags": ["dawn", "native"]},
|
||||||
|
|
|
@ -843,7 +843,8 @@ class MultiGeneratorFromDawnJSON(Generator):
|
||||||
|
|
||||||
if 'webgpu_headers' in targets:
|
if 'webgpu_headers' in targets:
|
||||||
params_upstream = parse_json(loaded_json,
|
params_upstream = parse_json(loaded_json,
|
||||||
enabled_tags=['upstream', 'native'])
|
enabled_tags=['upstream', 'native'],
|
||||||
|
disabled_tags=['dawn'])
|
||||||
renders.append(
|
renders.append(
|
||||||
FileRender('api.h', 'webgpu-headers/' + api + '.h',
|
FileRender('api.h', 'webgpu-headers/' + api + '.h',
|
||||||
[RENDER_PARAMS_BASE, params_upstream]))
|
[RENDER_PARAMS_BASE, params_upstream]))
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace dawn::native {
|
||||||
wgpu::SType::SurfaceDescriptorFromWindowsHWND,
|
wgpu::SType::SurfaceDescriptorFromWindowsHWND,
|
||||||
wgpu::SType::SurfaceDescriptorFromWindowsCoreWindow,
|
wgpu::SType::SurfaceDescriptorFromWindowsCoreWindow,
|
||||||
wgpu::SType::SurfaceDescriptorFromWindowsSwapChainPanel,
|
wgpu::SType::SurfaceDescriptorFromWindowsSwapChainPanel,
|
||||||
wgpu::SType::SurfaceDescriptorFromXlibWindow));
|
wgpu::SType::SurfaceDescriptorFromXlib));
|
||||||
|
|
||||||
#if defined(DAWN_ENABLE_BACKEND_METAL)
|
#if defined(DAWN_ENABLE_BACKEND_METAL)
|
||||||
const SurfaceDescriptorFromMetalLayer* metalDesc = nullptr;
|
const SurfaceDescriptorFromMetalLayer* metalDesc = nullptr;
|
||||||
|
@ -116,7 +116,7 @@ namespace dawn::native {
|
||||||
#endif // defined(DAWN_PLATFORM_WINDOWS)
|
#endif // defined(DAWN_PLATFORM_WINDOWS)
|
||||||
|
|
||||||
#if defined(DAWN_USE_X11)
|
#if defined(DAWN_USE_X11)
|
||||||
const SurfaceDescriptorFromXlibWindow* xDesc = nullptr;
|
const SurfaceDescriptorFromXlib* xDesc = nullptr;
|
||||||
FindInChain(descriptor->nextInChain, &xDesc);
|
FindInChain(descriptor->nextInChain, &xDesc);
|
||||||
if (xDesc) {
|
if (xDesc) {
|
||||||
// Check the validity of the window by calling a getter function on the window that
|
// Check the validity of the window by calling a getter function on the window that
|
||||||
|
@ -146,7 +146,7 @@ namespace dawn::native {
|
||||||
const SurfaceDescriptorFromWindowsHWND* hwndDesc = nullptr;
|
const SurfaceDescriptorFromWindowsHWND* hwndDesc = nullptr;
|
||||||
const SurfaceDescriptorFromWindowsCoreWindow* coreWindowDesc = nullptr;
|
const SurfaceDescriptorFromWindowsCoreWindow* coreWindowDesc = nullptr;
|
||||||
const SurfaceDescriptorFromWindowsSwapChainPanel* swapChainPanelDesc = nullptr;
|
const SurfaceDescriptorFromWindowsSwapChainPanel* swapChainPanelDesc = nullptr;
|
||||||
const SurfaceDescriptorFromXlibWindow* xDesc = nullptr;
|
const SurfaceDescriptorFromXlib* xDesc = nullptr;
|
||||||
FindInChain(descriptor->nextInChain, &metalDesc);
|
FindInChain(descriptor->nextInChain, &metalDesc);
|
||||||
FindInChain(descriptor->nextInChain, &hwndDesc);
|
FindInChain(descriptor->nextInChain, &hwndDesc);
|
||||||
FindInChain(descriptor->nextInChain, &coreWindowDesc);
|
FindInChain(descriptor->nextInChain, &coreWindowDesc);
|
||||||
|
|
|
@ -181,12 +181,12 @@ TEST_F(WindowSurfaceInstanceTests, CorrectSTypeXlib) {
|
||||||
GLFWwindow* window = CreateWindow();
|
GLFWwindow* window = CreateWindow();
|
||||||
std::unique_ptr<wgpu::ChainedStruct> chainedDescriptor =
|
std::unique_ptr<wgpu::ChainedStruct> chainedDescriptor =
|
||||||
utils::SetupWindowAndGetSurfaceDescriptorForTesting(window);
|
utils::SetupWindowAndGetSurfaceDescriptorForTesting(window);
|
||||||
ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlibWindow);
|
ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlib);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test with setting an invalid window
|
// Test with setting an invalid window
|
||||||
TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) {
|
TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) {
|
||||||
wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor;
|
wgpu::SurfaceDescriptorFromXlib chainedDescriptor;
|
||||||
chainedDescriptor.display = XOpenDisplay(nullptr);
|
chainedDescriptor.display = XOpenDisplay(nullptr);
|
||||||
// From the "X Window System Protocol" "X Version 11, Release 6.8" page 2 at
|
// From the "X Window System Protocol" "X Version 11, Release 6.8" page 2 at
|
||||||
// https://www.x.org/releases/X11R7.5/doc/x11proto/proto.pdf
|
// https://www.x.org/releases/X11R7.5/doc/x11proto/proto.pdf
|
||||||
|
@ -203,7 +203,7 @@ TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) {
|
||||||
|
|
||||||
// Test using Xlib when it is not supported
|
// Test using Xlib when it is not supported
|
||||||
TEST_F(WindowSurfaceInstanceTests, XlibSurfacesAreInvalid) {
|
TEST_F(WindowSurfaceInstanceTests, XlibSurfacesAreInvalid) {
|
||||||
wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor;
|
wgpu::SurfaceDescriptorFromXlib chainedDescriptor;
|
||||||
chainedDescriptor.display = nullptr;
|
chainedDescriptor.display = nullptr;
|
||||||
chainedDescriptor.window = 0;
|
chainedDescriptor.window = 0;
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,8 @@ namespace utils {
|
||||||
#elif defined(DAWN_USE_X11)
|
#elif defined(DAWN_USE_X11)
|
||||||
std::unique_ptr<wgpu::ChainedStruct> SetupWindowAndGetSurfaceDescriptorForTesting(
|
std::unique_ptr<wgpu::ChainedStruct> SetupWindowAndGetSurfaceDescriptorForTesting(
|
||||||
GLFWwindow* window) {
|
GLFWwindow* window) {
|
||||||
std::unique_ptr<wgpu::SurfaceDescriptorFromXlibWindow> desc =
|
std::unique_ptr<wgpu::SurfaceDescriptorFromXlib> desc =
|
||||||
std::make_unique<wgpu::SurfaceDescriptorFromXlibWindow>();
|
std::make_unique<wgpu::SurfaceDescriptorFromXlib>();
|
||||||
desc->display = glfwGetX11Display();
|
desc->display = glfwGetX11Display();
|
||||||
desc->window = glfwGetX11Window(window);
|
desc->window = glfwGetX11Window(window);
|
||||||
return std::move(desc);
|
return std::move(desc);
|
||||||
|
|
Loading…
Reference in New Issue